|
string const | OPENAPI_VERSION = '3.1.0' |
| The OpenAPI version represented in this specification.
|
|
|
callable[] array | $commonresponses = [] |
| A list of common responses that are frequently found in paths.
|
|
stdClass stdClass | $data |
| The data which forms the specification.
|
|
bool bool | $finalised = false |
| Whether the data has been finalised for output yet.
|
|
◆ add_component()
core\router\schema\specification::add_component |
( |
openapi_base | $object | ) |
|
Add a component to the components object.
https://spec.openapis.org/oas/v3.1.0#components-object
Note: The following component types are supported:
- schemas
- responses
- parameters
- examples
- requestBodies
- headers
At this time, other component types are not supported.
- Parameters
-
- Return values
-
- Exceptions
-
coding_exception | If the component type is unknown. |
◆ add_example()
core\router\schema\specification::add_example |
( |
example | $example | ) |
|
|
protected |
Add an example to the shared components section of the specification.
- Parameters
-
- Return values
-
◆ add_header()
core\router\schema\specification::add_header |
( |
header_object | $header | ) |
|
|
protected |
Add a header to the shared components section of the specification.
- Parameters
-
- Return values
-
◆ add_parameter()
core\router\schema\specification::add_parameter |
( |
parameter | $parameter | ) |
|
|
protected |
Add a schema to the shared components section of the specification.
- Parameters
-
- Return values
-
◆ add_path()
core\router\schema\specification::add_path |
( |
string | $component, |
|
|
route | $route ) |
Add an API Path.
- Parameters
-
string | $component | The Moodle component |
route | $route | The route which handles this request |
- Return values
-
◆ add_request_body()
core\router\schema\specification::add_request_body |
( |
request_body | $body | ) |
|
|
protected |
Add a request body to the shared components section of the specification.
- Parameters
-
- Return values
-
◆ add_response()
core\router\schema\specification::add_response |
( |
response | $response | ) |
|
|
protected |
Add a response to the shared components section of the specification.
- Parameters
-
- Return values
-
◆ add_schema()
core\router\schema\specification::add_schema |
( |
type_base | $schema | ) |
|
|
protected |
Add a schema to the shared components section of the specification.
- Parameters
-
- Return values
-
◆ add_server()
core\router\schema\specification::add_server |
( |
string | $url, |
|
|
string | $description ) |
Add a server to the specification.
- Parameters
-
string | $url | The URL of the API base |
string | $description | |
- Return values
-
◆ generate_common_responses()
core\router\schema\specification::generate_common_responses |
( |
| ) |
|
|
protected |
Generate the callables for common responses that are frequently found in paths.
- Return values
-
◆ get_common_request_responses()
core\router\schema\specification::get_common_request_responses |
( |
| ) |
|
Get the common request responses.
- Return values
-
◆ get_openapi_schema_for_route()
core\router\schema\specification::get_openapi_schema_for_route |
( |
route | $route, |
|
|
string | $component, |
|
|
string | $path ) |
Get the OpenAPI description for this route.
- Parameters
-
route | $route | |
string | $component | |
string | $path | |
- Return values
-
◆ get_schema()
core\router\schema\specification::get_schema |
( |
| ) |
|
|
final |
Get the OpenAPI schema.
- Return values
-
◆ is_reference_defined()
core\router\schema\specification::is_reference_defined |
( |
string | $ref | ) |
|
Check whether a reference is defined.
- Parameters
-
- Return values
-
◆ jsonSerialize()
core\router\schema\specification::jsonSerialize |
( |
| ) |
|
Implement the json serialisation interface.
- Return values
-
The documentation for this class was generated from the following file:
- lib/classes/router/schema/specification.php