Files
NodeBB/public/openapi/components/schemas/CommonProps.yaml
Julian Lam ccc6118d30 Testing suite integration for openapi spec (#8263)
* feat: testing suite integration for openapi spec

The testing suite now takes the openapi spec into account. It will
check each route defined, make a call to it, and compare the
response with the defined schema. Any mismatches will cause the
test to fail.

* fix(openapi): removed debug stuff from tests

* fix(openapi): fixed some tests

* fix(openapi): added additional check to tests, test fixes

* fix(openapi): better tests, fixed spec errors

* fix(openapi): bad conditional in test

* fix: oops

* fix(openapi): more tests fixing

* fix(openapi): more tests

* fix(openapi): fix some more tests

* fix: verbose'd an info log

* fix: topic pagination route returns schema-optimized pagination block

* fix(openapi): more test/spec fixes

* fix(openapi): accidentally sending in authenticated jar for anon routes

* fix(openapi): more test/spec fixes

* fix(openapi): more spec fixes

* fix: timestampReadable Invalid Date

* fix(openapi): more tests... almost there

* fix(openapi): more tests fixing

* fix(openapi): finally all tests passing

* fix(openapi): added reverse test to compare response to spec

... and fixed all the tests that broke

* fix: remove tests related to group covers, as route is gone

* fix(openapi): broken test on travis

* fix(openapi): broken test on travis

* fix(openapi): broken test on travis

* fix(openapi): object cache is not present for psql

* fix: tests

Co-authored-by: Barış Soner Uşaklı <barisusakli@gmail.com>
2020-04-23 21:50:08 -04:00

79 lines
2.7 KiB
YAML

CommonProps:
type: object
properties:
loggedIn:
type: boolean
description: True if user is logged in, false otherwise
relative_path:
type: string
description: |
If NodeBB is installed in a subfolder this becomes the path to the forum. For example if your forum url is
`example.org/community` then relative_path will be `/community`. If your forum url is `example.com` then relative path will be an empty string.
template:
type: object
properties:
name:
type: string
description: The path to the template, which acts as a unique name
example: admin/settings/general
additionalProperties:
description: There will be one additional property added to all routes here. It is a boolean value whose key is the path to the current template. It is used on the client-side to verify the current page inside of a conditional (e.g. `if (ajaxify.data.template.topic)` to ensure a script is run only on the topic page)
type: boolean
enum: [true]
url:
type: string
description: Base url of the current page, does not include query params
bodyClass:
type: string
description: The css class string that is appended to the body element
_header:
type: object
description: List of meta and link tags that are added to the head element
properties:
tags:
type: object
properties:
meta:
type: array
items:
type: object
properties:
name:
type: string
content:
type: string
noEscape:
type: boolean
property:
type: string
required:
- content
link:
type: array
items:
type: object
properties:
rel:
type: string
type:
type: string
href:
type: string
title:
type: string
sizes:
type: string
required:
- rel
- href
widgets:
type: object
description: Each widget area will have its own property in this object
additionalProperties:
type: array
description: A collection of HTML snippets that are appended to each widget area
items:
type: object
properties:
html:
type: string