|
| | __construct (protected string string $name, protected string string $in, protected string|null ?string $description=null, protected bool|null ?bool $required=null, protected bool|null ?bool $deprecated=false, protected param|null ?param $type=null, protected mixed|null mixed $default=null, protected type_base|null ?type_base $schema=null, protected example|null ?example $example=null, protected example[] array $examples=[],... $extra,) |
| | Constructor for a Parameter Object.
|
| |
| | get_in () |
| | Get the OpenAPI 'in' property.
|
| |
| | get_name () |
| | Get the name of the parameter.
|
| |
| | get_openapi_description (specification $api, ?string $path=null,) |
| | Get the OpenAPI data to include in the OpenAPI specification.
|
| |
| | get_openapi_schema (specification $api, ?string $path=null,) |
| | Get the OpenAPI data to include in the OpenAPI specification.
|
| |
| | get_reference (bool $qualify=true,) |
| | Get the $ref for this class.
|
| |
| | get_schema_from_type (param $type) |
| | Get the schema for a given type.
|
| |
| | get_type () |
| | Fetch the underlying param.
|
| |
| | is_required (route $route) |
| | Whether this property is required.
|
| |
|
|
string const | IN_COOKIE = 'cookie' |
| | A cookie parameter.
|
| |
|
string const | IN_HEADER = 'header' |
| | A header parameter.
|
| |
|
string const | IN_PATH = 'path' |
| | A URI path parameter.
|
| |
|
string const | IN_QUERY = 'query' |
| | A query parameter.
|
| |
◆ __construct()
| core\router\schema\parameter::__construct |
( |
protected string string | $name, |
|
|
protected string string | $in, |
|
|
protected string|null ?string | $description = null, |
|
|
protected bool|null ?bool | $required = null, |
|
|
protected bool|null ?bool | $deprecated = false, |
|
|
protected param|null ?param | $type = null, |
|
|
protected mixed|null mixed | $default = null, |
|
|
protected type_base|null ?type_base | $schema = null, |
|
|
protected example|null ?example | $example = null, |
|
|
protected example[]array | $examples = [], |
|
|
| ... ) |
Constructor for a Parameter Object.
- Parameters
-
| string | $name | The name of the parameter. Parameter names are case sensitive.
- If in is "path", the name field MUST correspond to a template expression occurring within the path field in the Paths Object. See Path Templating for further information.
- If in is "header" and the name field is "Accept", "Content-Type" or "Authorization", the parameter definition SHALL be ignored.
- For all other cases, the name corresponds to the parameter name used by the in property.
|
| string | $in | The location of the parameter. Possible values are "query", "header", "path" or "cookie". |
| null | string | $description | |
| null | bool | $required | |
| null | bool | $deprecated | Specifies that a parameter is deprecated and SHOULD be transitioned out of usage. |
| null | param | $type | A Moodle parameter type, which can be used instead of a schema. |
| mixed | $default | The default value |
| null | type_base | $schema | |
| null | example | $example | |
| example[] | $examples | |
| mixed[] | ...$extra |
- Exceptions
-
- Parameters
-
| $name | The name of the parameter. Parameter names are case sensitive |
| $in | The location of the parameter |
| $description | A description of the parameter |
| $required | Whether the parameter is required |
| $deprecated | Whether the parameter is deprecated |
| $type | A Moodle parameter type |
| $default | The default value of the parameter |
| $schema | The schema |
| $example | An example |
| $examples | An array of examples |
◆ escape_reference()
| static core\router\schema\openapi_base::escape_reference |
( |
string | $reference | ) |
|
|
staticinherited |
◆ get_in()
| core\router\schema\parameter::get_in |
( |
| ) |
|
Get the OpenAPI 'in' property.
- Return values
-
◆ get_name()
| core\router\schema\parameter::get_name |
( |
| ) |
|
Get the name of the parameter.
- Return values
-
◆ get_openapi_description()
| core\router\schema\parameter::get_openapi_description |
( |
specification | $api, |
|
|
?string | $path = null ) |
◆ get_openapi_schema()
| core\router\schema\openapi_base::get_openapi_schema |
( |
specification | $api, |
|
|
?string | $path = null ) |
|
finalinherited |
Get the OpenAPI data to include in the OpenAPI specification.
- Parameters
-
| specification | $api | |
| null | string | $path | |
- Return values
-
- Exceptions
-
◆ get_reference()
| core\router\schema\openapi_base::get_reference |
( |
bool | $qualify = true | ) |
|
|
inherited |
Get the $ref for this class.
- Parameters
-
| bool | $qualify | Whether to qualify the reference with the #/components/ part. |
- Return values
-
◆ get_reference_for_class()
| static core\router\schema\openapi_base::get_reference_for_class |
( |
string | $classname, |
|
|
bool | $qualify = true ) |
|
staticinherited |
◆ get_reference_for_example()
| static core\router\schema\openapi_base::get_reference_for_example |
( |
string | $reference | ) |
|
|
staticinherited |
Get the qualified $ref for an example.
- Parameters
-
- Return values
-
◆ get_reference_for_header()
| static core\router\schema\openapi_base::get_reference_for_header |
( |
string | $reference | ) |
|
|
staticinherited |
Get the qualified $ref for a parameter.
- Parameters
-
- Return values
-
◆ get_reference_for_parameter()
| static core\router\schema\openapi_base::get_reference_for_parameter |
( |
string | $reference | ) |
|
|
staticinherited |
Get the qualified $ref for a parameter.
- Parameters
-
- Return values
-
◆ get_reference_for_request_body()
| static core\router\schema\openapi_base::get_reference_for_request_body |
( |
string | $reference | ) |
|
|
staticinherited |
Get the qualified $ref for a request body.
- Parameters
-
- Return values
-
◆ get_reference_for_response()
| static core\router\schema\openapi_base::get_reference_for_response |
( |
string | $reference | ) |
|
|
staticinherited |
Get the qualified $ref for a response.
- Parameters
-
- Return values
-
◆ get_reference_for_schema()
| static core\router\schema\openapi_base::get_reference_for_schema |
( |
string | $reference | ) |
|
|
staticinherited |
Get the qualified $ref for a schema.
- Parameters
-
- Return values
-
◆ get_schema_from_type()
| core\router\schema\openapi_base::get_schema_from_type |
( |
param | $type | ) |
|
|
inherited |
Get the schema for a given type.
- Parameters
-
- Return values
-
◆ get_type()
| core\router\schema\parameter::get_type |
( |
| ) |
|
Fetch the underlying param.
- Return values
-
◆ is_required()
| core\router\schema\parameter::is_required |
( |
route | $route | ) |
|
The documentation for this class was generated from the following file:
- lib/classes/router/schema/parameter.php