Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250620) (7d9030acd6e)
core\router\schema\header_object Class Reference
Inheritance diagram for core\router\schema\header_object:
core\router\schema\parameters\header_object core\router\schema\parameter core\router\schema\openapi_base

Public Member Functions

 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.
 
 validate (ServerRequestInterface $request,)
 Validate the parameter.
 

Static Public Member Functions

static escape_reference (string $reference)
 Escape a reference following rules defined at https://swagger.io/docs/specification/using-ref/.
 
static get_reference_for_class (string $classname, bool $qualify=true,)
 Get the $ref a class name.
 
static get_reference_for_example (string $reference)
 Get the qualified $ref for an example.
 
static get_reference_for_header (string $reference)
 Get the qualified $ref for a parameter.
 
static get_reference_for_parameter (string $reference)
 Get the qualified $ref for a parameter.
 
static get_reference_for_request_body (string $reference)
 Get the qualified $ref for a request body.
 
static get_reference_for_response (string $reference)
 Get the qualified $ref for a response.
 
static get_reference_for_schema (string $reference)
 Get the qualified $ref for a schema.
 

Public Attributes

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.
 

Member Function Documentation

◆ escape_reference()

static core\router\schema\openapi_base::escape_reference ( string $reference)
staticinherited

Escape a reference following rules defined at https://swagger.io/docs/specification/using-ref/.

Parameters
string$reference
Return values
string

◆ get_in()

core\router\schema\parameter::get_in ( )
inherited

Get the OpenAPI 'in' property.

Return values
string

◆ get_name()

core\router\schema\parameter::get_name ( )
inherited

Get the name of the parameter.

Return values
string

◆ get_openapi_description()

core\router\schema\header_object::get_openapi_description ( specification $api,
?string $path = null )
final

Get the OpenAPI data to include in the OpenAPI specification.

Parameters
specification$api
null | string$path
Return values
null|stdClass

Reimplemented from core\router\schema\parameter.

◆ 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
null|stdClass
Exceptions
coding_exception

◆ get_reference()

core\router\schema\openapi_base::get_reference ( bool $qualify = true)
inherited

Get the $ref for this class.

Parameters
bool$qualifyWhether to qualify the reference with the #/components/ part.
Return values
string

◆ get_reference_for_class()

static core\router\schema\openapi_base::get_reference_for_class ( string $classname,
bool $qualify = true )
staticinherited

Get the $ref a class name.

https://swagger.io/docs/specification/using-ref/

Parameters
string$classnameThe class to get a reference for
bool$qualifyWhether to qualify the reference with the #/components/ part
Return values
stringThe reference
Exceptions
coding_exception

◆ 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
string$reference
Return values
string

◆ 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
string$reference
Return values
string

◆ 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
string$reference
Return values
string

◆ 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
string$reference
Return values
string

◆ 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
string$reference
Return values
string

◆ 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
string$reference
Return values
string

◆ get_schema_from_type()

core\router\schema\openapi_base::get_schema_from_type ( param $type)
inherited

Get the schema for a given type.

Parameters
param$type
Return values
stdClass

◆ get_type()

core\router\schema\parameter::get_type ( )
inherited

Fetch the underlying param.

Return values
param

◆ is_required()

core\router\schema\parameter::is_required ( route $route)
inherited

Whether this property is required.

Parameters
route$route
Return values
bool

Reimplemented in core\router\schema\parameters\path_parameter.

◆ validate()

core\router\schema\parameters\header_object::validate ( ServerRequestInterface $request)
inherited

Validate the parameter.

Parameters
ServerRequestInterface$requestThe request to validate.
Return values
ServerRequestInterfaceThe request with the validated parameter.
Exceptions
invalid_parameter_exceptionIf the parameter is invalid.

The documentation for this class was generated from the following file: