Skip to content

Annotation Reference โ€‹

This page is generated automatically from the swagger-php sources.

For improvements head over to GitHub and create a PR ๐Ÿ˜‰

In addition to this page, there are also a number of examples which might help you out.

Annotations โ€‹

AdditionalProperties โ€‹

Allowed in โ€‹


Schema, Property, Items, JsonContent, XmlContent, AdditionalProperties

Nested elements โ€‹


Discriminator, Items, Property, ExternalDocumentation, Examples, Xml, AdditionalProperties, Attachable

Attachable โ€‹

A container for custom data to be attached to an annotation.

These will be ignored by swagger-php but can be used for custom processing.

Allowed in โ€‹


AdditionalProperties, Components, Contact, Delete, Discriminator, Encoding, Examples, ExternalDocumentation, Flow, Get, Head, Header, Info, Items, JsonContent, License, Link, MediaType, OpenApi, Operation, Options, Parameter, Patch, PathItem, PathParameter, Post, Property, Put, RequestBody, Response, Schema, SecurityScheme, Server, ServerVariable, Tag, Trace, Webhook, Xml, XmlContent

Components โ€‹

Holds a set of reusable objects for different aspects of the OA.

All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.

Allowed in โ€‹


OpenApi

Nested elements โ€‹


Response, Parameter, PathParameter, RequestBody, Examples, Header, SecurityScheme, Link, Schema, Attachable

Properties โ€‹


callbacks : array

Reusable Callbacks.

Required:no

Reference โ€‹


Contact โ€‹

Contact information for the exposed API.

Allowed in โ€‹


Info

Nested elements โ€‹


Attachable

Properties โ€‹


name : string

The identifying name of the contact person/organization.

Required:no
url : string

The URL pointing to the contact information.

Required:no
email : string

The email address of the contact person/organization.

Required:no

Reference โ€‹


CookieParameter โ€‹

A @OA\Request cookie parameter.

Allowed in โ€‹


Components, PathItem, Operation, Get, Post, Put, Delete, Patch, Head, Options, Trace

Nested elements โ€‹


Schema, Examples, Attachable

Properties โ€‹


in : string

No details available.

Required:yes

Delete โ€‹

Allowed in โ€‹


PathItem

Nested elements โ€‹


Parameter, PathParameter, Response, ExternalDocumentation, Server, RequestBody, Attachable

Properties โ€‹


method : string

No details available.

Required:no

Discriminator โ€‹

The discriminator is a specific object in a schema which is used to inform the consumer of the specification of an alternative schema based on the value associated with it.

This object is based on the JSON Schema Specification and uses a predefined subset of it. On top of this subset, there are extensions provided by this specification to allow for more complete documentation.

Allowed in โ€‹


Schema, Property, AdditionalProperties, Items, JsonContent, XmlContent

Nested elements โ€‹


Attachable

Properties โ€‹


propertyName : string

The name of the property in the payload that will hold the discriminator value.

Required:yes
mapping : array<string,string>

An object to hold mappings between payload values and schema names or references.

Required:no

Reference โ€‹


Encoding โ€‹

A single encoding definition applied to a single schema property.

Allowed in โ€‹


JsonContent, XmlContent, MediaType, Property

Nested elements โ€‹


Header, Attachable

Properties โ€‹


property : string

The property name to which the encoding applies.

Required:no
contentType : string

The content type.

Required:no
style : string

No details available.

Required:no
explode : bool

No details available.

Required:no
allowReserved : bool

No details available.

Required:no

Reference โ€‹


Examples โ€‹

Allowed in โ€‹


AdditionalProperties, Components, Items, Schema, Parameter, PathParameter, Property, MediaType, JsonContent, XmlContent

Nested elements โ€‹


Attachable

Properties โ€‹


ref : string|class-string|object

The relative or absolute path to an example.

Required:no
See:Reference Object
example : string

The key into #/components/examples.

Required:no
summary : string

Short description for the example.

Required:yes
description : string

Embedded literal example.

The value field and externalValue field are mutually exclusive.

To represent examples of media types that cannot naturally be represented
in JSON or YAML, use a string value to contain the example, escaping where necessary.

Required:no
value : int|string|array

Embedded literal example.

The value field and externalValue field are mutually exclusive.

To represent examples of media types that cannot naturally be represented
in JSON or YAML, use a string value to contain the example, escaping where necessary.

Required:no
externalValue : string

An URL that points to the literal example.

This provides the capability to reference examples that cannot easily be included
in JSON or YAML documents.

The value field and externalValue field are mutually exclusive.

Required:no

ExternalDocumentation โ€‹

Allows referencing an external resource for extended documentation.

Allowed in โ€‹


OpenApi, Tag, Schema, AdditionalProperties, Property, Operation, Get, Post, Put, Delete, Patch, Head, Options, Trace, Items, JsonContent, XmlContent

Nested elements โ€‹


Attachable

Properties โ€‹


description : string

A short description of the target documentation. GFM syntax can be used for rich text representation.

Required:no
url : string

The URL for the target documentation.

Required:yes

Reference โ€‹


Flow โ€‹

Configuration details for a supported OAuth flow.

Allowed in โ€‹


SecurityScheme

Nested elements โ€‹


Attachable

Properties โ€‹


authorizationUrl : string

The authorization url to be used for this flow.

This must be in the form of an url.

Required:no
tokenUrl : string

The token URL to be used for this flow.

This must be in the form of an url.

Required:no
refreshUrl : string

The URL to be used for obtaining refresh tokens.

This must be in the form of an url.

Required:no
flow : 'authorizationCode'|'clientCredentials'|'implicit'|'password'

Flow name.

One of ['implicit', 'password', 'authorizationCode', 'clientCredentials'].

Required:yes
scopes : array

The available scopes for the OAuth2 security scheme.

A map between the scope name and a short description for it.

Required:yes

Reference โ€‹


Get โ€‹

Allowed in โ€‹


PathItem

Nested elements โ€‹


Parameter, PathParameter, Response, ExternalDocumentation, Server, RequestBody, Attachable

Properties โ€‹


method : string

No details available.

Required:no

Allowed in โ€‹


PathItem

Nested elements โ€‹


Parameter, PathParameter, Response, ExternalDocumentation, Server, RequestBody, Attachable

Properties โ€‹


method : string

No details available.

Required:no

Allowed in โ€‹


Encoding, Components, Response

Nested elements โ€‹


Schema, Attachable

Properties โ€‹


ref : string|class-string|object

The relative or absolute path to the endpoint.

Required:no
See:Reference Object
header : string

No details available.

Required:yes
description : string

A brief description of the parameter.

This could contain examples of use.
CommonMark syntax MAY be used for rich text representation.

Required:no
required : bool

No details available.

Required:no
deprecated : bool

Specifies that a parameter is deprecated and SHOULD be transitioned out of usage.

Required:no
allowEmptyValue : bool

Sets the ability to pass empty-valued parameters.

This is valid only for query parameters and allows sending a parameter with an empty value.

Default value is false.

If style is used, and if behavior is n/a (cannot be serialized), the value of allowEmptyValue SHALL be ignored.

Required:no

Reference โ€‹


HeaderParameter โ€‹

A @OA\Request header parameter.

Allowed in โ€‹


Components, PathItem, Operation, Get, Post, Put, Delete, Patch, Head, Options, Trace

Nested elements โ€‹


Schema, Examples, Attachable

Properties โ€‹


in : string

No details available.

Required:yes

Info โ€‹

The object provides metadata about the API.

The metadata may be used by the clients if needed and may be presented in editing or documentation generation tools for convenience.

Allowed in โ€‹


OpenApi

Nested elements โ€‹


Contact, License, Attachable

Properties โ€‹


title : string

The title of the application.

Required:yes
description : string

A short description of the application.

CommonMark syntax may be used for rich text representation.

Required:no
termsOfService : string

An URL to the Terms of Service for the API.

Must be in the format of an url.

Required:no
version : string

The version of the OpenAPI document (which is distinct from the OpenAPI Specification version or the API implementation version).

Required:yes

Reference โ€‹


Items โ€‹

The description of an item in a Schema with type array.

Allowed in โ€‹


Property, AdditionalProperties, Schema, JsonContent, XmlContent, Items

Nested elements โ€‹


Discriminator, Items, Property, ExternalDocumentation, Examples, Xml, AdditionalProperties, Attachable

JsonContent โ€‹

Shorthand for a json response.

Example:

php
@OA\JsonContent(
    ref="#/components/schemas/user"
)

vs.

php
@OA\MediaType(
    mediaType="application/json",
    @OA\Schema(
        ref="#/components/schemas/user"
    )
)

Nested elements โ€‹


Discriminator, Items, Property, ExternalDocumentation, AdditionalProperties, Encoding, Examples, Attachable

License โ€‹

License information for the exposed API.

Allowed in โ€‹


Info

Nested elements โ€‹


Attachable

Properties โ€‹


name : string

The license name used for the API.

Required:yes
identifier : string

An SPDX license expression for the API. The identifier field is mutually exclusive of the url field.

@since OpenAPI 3.1.0

Required:no
url : string

A URL to the license used for the API. This MUST be in the form of a URL.

The url field is mutually exclusive of the identifier field.

Required:no

Reference โ€‹


The Link object represents a possible design-time link for a response.

The presence of a link does not guarantee the caller's ability to successfully invoke it, rather it provides a known relationship and traversal mechanism between responses and other operations.

Unlike dynamic links (i.e. links provided in the response payload), the OA linking mechanism does not require link information in the runtime response.

For computing links, and providing instructions to execute them, a runtime expression is used for accessing values in an operation and using them as parameters while invoking the linked operation.

Allowed in โ€‹


Components, Response

Nested elements โ€‹


Server, Attachable

Properties โ€‹


ref : string|class-string|object

No details available.

Required:no
See:Reference Object
link : string

The key into MediaType->links array.

Required:no
operationRef : string

A relative or absolute reference to an OA operation.

This field is mutually exclusive of the operationId field, and must point to an Operation object.

Relative values may be used to locate an existing Operation object in the OpenAPI definition.

Required:no
operationId : string

The name of an existing, resolvable OA operation, as defined with a unique operationId.

This field is mutually exclusive of the operationRef field.

Required:no
parameters : array<string,mixed>

A map representing parameters to pass to an operation as specified with operationId or identified via
operationRef.

The key is the parameter name to be used, whereas the value can be a constant or an expression to
be evaluated and passed to the linked operation.
The parameter name can be qualified using the parameter location [{in}.]{name} for operations
that use the same parameter name in different locations (e.g. path.id).

Required:no
requestBody : mixed

A literal value or {expression} to use as a request body when calling the target operation.

Required:no
description : string

A description of the link.

CommonMark syntax may be used for rich text representation.

Required:no

Reference โ€‹


MediaType โ€‹

Each Media Type object provides schema and examples for the media type identified by its key.

Parameter encodings can be set either here, or on nested Property annotations directly.

Allowed in โ€‹


Response, RequestBody

Nested elements โ€‹


Schema, Examples, Encoding, Attachable

Properties โ€‹


mediaType : string

The key into Operation->content array.

Required:no
example : mixed

Example of the media type.

The example object should be in the correct format as specified by the media type.
The example object is mutually exclusive of the examples object.

Furthermore, if referencing a schema which contains an example,
the example value shall override the example provided by the schema.

Required:no

Reference โ€‹


OpenApi โ€‹

This is the root document object for the API specification.

Nested elements โ€‹


Info, Server, PathItem, Components, Tag, ExternalDocumentation, Webhook, Attachable

Properties โ€‹


openapi : string

The semantic version number of the OpenAPI Specification version that the OpenAPI document uses.

The openapi field should be used by tooling specifications and clients to interpret the OpenAPI document.

A version specified via Generator::setVersion() will overwrite this value.

NOTE: This is not related to the API info::version string.

Required:yes
security : array

A declaration of which security mechanisms can be used across the API.

The list of values includes alternative security requirement objects that can be used.
Only one of the security requirement objects need to be satisfied to authorize a request.
Individual operations can override this definition.
To make security optional, an empty security requirement ({}) can be included in the array.

Required:no

Reference โ€‹


Options โ€‹

Allowed in โ€‹


PathItem

Nested elements โ€‹


Parameter, PathParameter, Response, ExternalDocumentation, Server, RequestBody, Attachable

Properties โ€‹


method : string

No details available.

Required:no

Parameter โ€‹

Describes a single operation parameter.

A unique parameter is defined by a combination of a name and location.

Allowed in โ€‹


Components, PathItem, Operation, Get, Post, Put, Delete, Patch, Head, Options, Trace

Nested elements โ€‹


Schema, Examples, Attachable

Properties โ€‹


ref : string|class-string|object

The relative or absolute path to the endpoint.

Required:no
See:Reference Object
parameter : string

The key into Components::parameters or PathItem::parameters array.

Required:no
name : string

The (case-sensitive) name of the parameter.

If in is "path", the name field must correspond to the associated path segment from the path field in the Paths Object.

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.

Required:yes
in : string

The location of the parameter.

Possible values are "query", "header", "path" or "cookie".

Required:yes
description : string

A brief description of the parameter.

This could contain examples of use.

CommonMark syntax may be used for rich text representation.

Required:no
required : bool

Determines whether this parameter is mandatory.

If the parameter location is "path", this property is required and its value must be true.
Otherwise, the property may be included and its default value is false.

Required:no
deprecated : bool

Specifies that a parameter is deprecated and should be transitioned out of usage.

Required:no
allowEmptyValue : bool

Sets the ability to pass empty-valued parameters.

This is valid only for query parameters and allows sending a parameter with an empty value.

Default value is false.

If style is used, and if behavior is n/a (cannot be serialized), the value of allowEmptyValue shall be ignored.

Required:no
style : string

Describes how the parameter value will be serialized depending on the type of the parameter value.

Default values (based on value of in): for query - form; for path - simple; for header - simple; for cookie - form.

Required:no
explode : bool

When this is true, parameter values of type array or object generate separate parameters for each value of the array or key-value pair of the map.

For other types of parameters this property has no effect.

When style is form, the default value is true.
For all other styles, the default value is false.

Required:no
allowReserved : bool

Determines whether the parameter value should allow reserved characters, as defined by RFC3986 :/?#[]@!$&'()*+,;= to be included without percent-encoding.

This property only applies to parameters with an in value of query.

The default value is false.

Required:no
example : mixed

Example of the media type.

The example should match the specified schema and encoding properties if present.
The example object is mutually exclusive of the examples object.
Furthermore, if referencing a schema which contains an example, the example value shall override the example provided by the schema.
To represent examples of media types that cannot naturally be represented in JSON or YAML, a string value can contain the example with escaping where necessary.

Required:no
content : array<MediaType>|JsonContent|XmlContent|Attachable

A map containing the representations for the parameter.

The key is the media type and the value describes it.
The map must only contain one entry.

Required:no
matrix : string

Path-style parameters defined by RFC6570.

Required:no
See:RFC6570
label : string

Label style parameters defined by RFC6570.

Required:no
See:RFC6570
form : mixed

Form style parameters defined by RFC6570.

This option replaces collectionFormat with a csv (when explode is false) or multi (when explode is true) value from OpenAPI 2.0.

Required:no
See:RFC6570
simple : array

Simple style parameters defined by RFC6570.

This option replaces collectionFormat with a csv value from OpenAPI 2.0.

Required:no
See:RFC6570
spaceDelimited : array

Space separated array values.

This option replaces collectionFormat equal to ssv from OpenAPI 2.0.

Required:no
pipeDelimited : array

Pipe separated array values.

This option replaces collectionFormat equal to pipes from OpenAPI 2.0.

Required:no
deepObject : mixed

Provides a simple way of rendering nested objects using form parameters.

Required:no

Reference โ€‹


Patch โ€‹

Allowed in โ€‹


PathItem

Nested elements โ€‹


Parameter, PathParameter, Response, ExternalDocumentation, Server, RequestBody, Attachable

Properties โ€‹


method : string

No details available.

Required:no

PathItem โ€‹

Describes the operations available on a single path.

A Path Item may be empty, due to ACL constraints. The path itself is still exposed to the documentation viewer, but they will not know which operations and parameters are available.

Allowed in โ€‹


OpenApi

Nested elements โ€‹


Get, Post, Put, Delete, Patch, Trace, Head, Options, Query, Parameter, PathParameter, Server, Attachable

Properties โ€‹


ref : string|class-string|object

No details available.

Required:no
See:Reference Object
summary : string

An optional, string summary, intended to apply to all operations in this path.

Required:no
description : string

An optional, string description, intended to apply to all operations in this path.

Required:no
path : string

Key for the Path Object (OpenApi->paths array).

Required:no

Reference โ€‹


PathParameter โ€‹

A @OA\Request path parameter.

Allowed in โ€‹


Components, PathItem, Operation, Get, Post, Put, Delete, Patch, Head, Options, Trace

Nested elements โ€‹


Schema, Examples, Attachable

Properties โ€‹


in : string

No details available.

Required:no
required : bool

No details available.

Required:no

Post โ€‹

Allowed in โ€‹


PathItem

Nested elements โ€‹


Parameter, PathParameter, Response, ExternalDocumentation, Server, RequestBody, Attachable

Properties โ€‹


method : string

No details available.

Required:no

Property โ€‹

Allowed in โ€‹


AdditionalProperties, Schema, JsonContent, XmlContent, Property, Items

Nested elements โ€‹


Discriminator, Items, Property, ExternalDocumentation, Examples, Xml, AdditionalProperties, Encoding, Attachable

Properties โ€‹


property : string

The key into Schema->properties array.

Required:no

Put โ€‹

Allowed in โ€‹


PathItem

Nested elements โ€‹


Parameter, PathParameter, Response, ExternalDocumentation, Server, RequestBody, Attachable

Properties โ€‹


method : string

No details available.

Required:no

Query โ€‹

@since OpenAPI 3.2.0

Allowed in โ€‹


PathItem

Nested elements โ€‹


Parameter, PathParameter, Response, ExternalDocumentation, Server, RequestBody, Attachable

Properties โ€‹


method : string

No details available.

Required:no

QueryParameter โ€‹

A @OA\Request query parameter.

Allowed in โ€‹


Components, PathItem, Operation, Get, Post, Put, Delete, Patch, Head, Options, Trace

Nested elements โ€‹


Schema, Examples, Attachable

Properties โ€‹


in : string

This takes 'query' as the default location

Required:yes

RequestBody โ€‹

Describes a single request body.

Allowed in โ€‹


Components, Delete, Get, Head, Operation, Options, Patch, Post, Trace, Put

Nested elements โ€‹


MediaType, Attachable

Properties โ€‹


ref : string|class-string|object

The relative or absolute path to a request body.

Required:no
See:Reference Object
request : string

The key into Components->requestBodies array.

Required:no
description : string

A brief description of the parameter.

This could contain examples of use.

CommonMark syntax may be used for rich text representation.

Required:no
required : bool

Determines whether this parameter is mandatory.

If the parameter location is "path", this property is required and its value must be true.
Otherwise, the property may be included and its default value is false.

Required:no

Reference โ€‹


Response โ€‹

Describes a single response from an API Operation, including design-time, static links to operations based on the response.

Allowed in โ€‹


Components, Operation, Get, Post, Put, Patch, Delete, Head, Options, Trace

Nested elements โ€‹


MediaType, Header, Link, Attachable

Properties โ€‹


ref : string|class-string|object

The relative or absolute path to a response.

Required:no
See:Reference Object
response : string|int

The key into Operations->responses array.

A HTTP status code or default.

Required:no
description : string

A short description of the response.

CommonMark syntax may be used for rich text representation.

Required:no

Reference โ€‹


Schema โ€‹

The definition of input and output data types.

These types can be objects, but also primitives and arrays.

This object is based on the JSON Schema Specification and uses a predefined subset of it. On top of this subset, there are extensions provided by this specification to allow for more complete documentation.

Allowed in โ€‹


Components, Parameter, PathParameter, MediaType, Header

Nested elements โ€‹


Discriminator, Items, Property, ExternalDocumentation, Examples, Xml, AdditionalProperties, Attachable

Properties โ€‹


ref : string|class-string|object

The relative or absolute path to the endpoint.

Required:no
See:Reference Object
schema : string

The key into Components->schemas array.

Required:no
title : string

Can be used to decorate a user interface with information about the data produced by this user interface.

Preferably short; use description for more details.

Required:no
description : string

A description will provide explanation about the purpose of the instance described by this schema.

Required:no
maxProperties : int

The maximum number of properties allowed in an object instance.
An object instance is valid against this property if its number of properties is less than, or equal to, the
value of this attribute.

Required:no
minProperties : int

The minimum number of properties allowed in an object instance.
An object instance is valid against this property if its number of properties is greater than, or equal to, the
value of this attribute.

Required:no
required : list<string>

An object instance is valid against this property if its property set contains all elements in this property's
array value.

Required:no
type : string|non-empty-array<string>

The type of the schema/property.

OpenApi v3.0: The value MUST be one of "string", "number", "integer", "boolean", "array" or "object".

Since OpenApi v3.1 an array of types may be used.

Required:no
format : string

The extending format for the previously mentioned type.

Required:no
See:Data Types
collectionFormat : string

Determines the format of the array if type array is used.

Possible values are:
- csv: comma separated values foo,bar.
- ssv: space separated values foo bar.
- tsv: tab separated values foo\tbar.
- pipes: pipe separated values foo|bar.
- multi: corresponds to multiple parameter instances instead of multiple values for a single instance
foo=bar&foo=baz. This is valid only for parameters of type query or formData. Default
value is csv.

Required:no
pattern : string

A string instance is considered valid if the regular expression matches the instance successfully.

Required:no
multipleOf : int|float

A numeric instance is valid against "multipleOf" if the result of the division of the instance by this
property's value is an integer.

Required:no
readOnly : bool

Declares the property as "read only".

Relevant only for Schema "properties" definitions.

This means that it may be sent as part of a response but should not be sent as part of the request.
If the property is marked as readOnly being true and is in the required list, the required will take effect on
the response only. A property must not be marked as both readOnly and writeOnly being true. Default value is
false.

Required:no
writeOnly : bool

Declares the property as "write only".

Relevant only for Schema "properties" definitions.
Therefore, it may be sent as part of a request but should not be sent as part of the response.
If the property is marked as writeOnly being true and is in the required list, the required will take effect on
the request only. A property must not be marked as both readOnly and writeOnly being true. Default value is
false.

Required:no
example : mixed

A free-form property to include an example of an instance for this schema.

To represent examples that cannot naturally be represented in JSON or YAML, a string value can be used to
contain the example with escaping where necessary.

Required:no
nullable : bool

Allows sending a null value for the defined schema.
Default value is false.

This must not be used when using OpenApi version 3.1,
instead make the "type" property an array and add "null" as a possible type.

Required:no
deprecated : bool

Specifies that a schema is deprecated and should be transitioned out of usage.
Default value is false.

Required:no
allOf : array<Schema|\OpenApi\Attributes\Schema>

An instance validates successfully against this property if it validates successfully against all schemas
defined by this property's value.

Required:no
anyOf : array<Schema|\OpenApi\Attributes\Schema>

An instance validates successfully against this property if it validates successfully against at least one
schema defined by this property's value.

Required:no
oneOf : array<Schema|\OpenApi\Attributes\Schema>

An instance validates successfully against this property if it validates successfully against exactly one schema
defined by this property's value.

Required:no
contentEncoding : string

https://spec.openapis.org/oas/v3.1.0.html#considerations-for-file-uploads
https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-validation-00#rfc.section.8.3.

Required:no
contentMediaType : string

https://spec.openapis.org/oas/v3.1.0.html#considerations-for-file-uploads
https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-validation-00#rfc.section.8.4.

Required:no

Reference โ€‹


SecurityScheme โ€‹

Allowed in โ€‹


Components

Nested elements โ€‹


Flow, Attachable

Properties โ€‹


ref : string|class-string|object

The relative or absolute path to a security scheme.

Required:no
See:Reference Object
securityScheme : string

The key into OpenApi->security array.

Required:yes
type : string|non-empty-array<string>

The type of the security scheme.

Required:yes
description : string

A short description for security scheme.

Required:no
name : string

The name of the header or query parameter to be used.

Required:no
in : string

Required The location of the API key.

Required:no
bearerFormat : string

A hint to the client to identify how the bearer token is formatted.

Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes.

Required:no
scheme : string

The name of the HTTP Authorization scheme.

Required:no
See:RFC7235
openIdConnectUrl : string

OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the form of a URL.

Required:no

Reference โ€‹


Server โ€‹

An object representing a server.

Allowed in โ€‹


OpenApi, PathItem, Operation, Get, Post, Put, Delete, Patch, Head, Options, Trace, Link

Nested elements โ€‹


ServerVariable, Attachable

Properties โ€‹


url : string

An URL to the target host.

This URL supports Server Variables and may be relative,
to indicate that the host location is relative to the location where the OpenAPI document is being served.
Variable substitutions will be made when a variable is named in {brackets}.

Required:yes
description : string

An optional string describing the host designated by the URL.

CommonMark syntax may be used for rich text representation.

Required:no

Reference โ€‹


ServerVariable โ€‹

An object representing a server variable for server URL template substitution.

Allowed in โ€‹


Server

Nested elements โ€‹


Attachable

Properties โ€‹


serverVariable : string

The key into Server->variables array.

Required:no
enum : list<string|int|float|bool|\UnitEnum>|class-string

An enumeration of values to be used if the substitution options are from a limited set.

Required:no
default : string

The default value to use for substitution, and to send, if an alternate value is not supplied.

Unlike the Schema Object's default, this value must be provided by the consumer.

Required:yes
variables : array

A map between a variable name and its value.

The value is used for substitution in the server's URL template.

Required:no
description : string

An optional description for the server variable.

CommonMark syntax MAY be used for rich text representation.

Required:no

Reference โ€‹


Tag โ€‹

Allowed in โ€‹


OpenApi

Nested elements โ€‹


ExternalDocumentation, Attachable

Properties โ€‹


name : string

The name of the tag.

Required:yes
description : string

A short description for the tag. GFM syntax can be used for rich text representation.

Required:no
summary : string

A short summary for display purposes.

@since OpenAPI 3.2.0

Required:no
parent : string

Name of the parent tag.

@since OpenAPI 3.2.0

Required:no
kind : string

Machine-readable category.

@since OpenAPI 3.2.0

Required:no

Reference โ€‹


Trace โ€‹

Allowed in โ€‹


PathItem

Nested elements โ€‹


Parameter, PathParameter, Response, ExternalDocumentation, Server, RequestBody, Attachable

Properties โ€‹


method : string

No details available.

Required:no

Webhook โ€‹

Acts like a PathItem with the main difference being that it requires webhook instead of path.

@since OpenAPI 3.1.0

Allowed in โ€‹


OpenApi

Nested elements โ€‹


Get, Post, Put, Delete, Patch, Trace, Head, Options, Query, Parameter, PathParameter, Server, Attachable

Properties โ€‹


webhook : string

Key for the webhooks map.

Required:yes

Xml โ€‹

Allowed in โ€‹


AdditionalProperties, Schema, Property, Schema, Items, XmlContent

Nested elements โ€‹


Attachable

Properties โ€‹


name : string

Replaces the name of the element/attribute used for the described schema property.

When defined within the Items Object (items), it will affect the name of the individual XML elements within the list.
When defined alongside type being array (outside the items), it will affect the wrapping element
and only if wrapped is true.

If wrapped is false, it will be ignored.

Required:no
namespace : string

The URL of the namespace definition. Value SHOULD be in the form of a URL.

Required:no
prefix : string

The prefix to be used for the name.

Required:no
attribute : bool

Declares whether the property definition translates to an attribute instead of an element.

Default value is false.

Required:no
wrapped : bool

MAY be used only for an array definition.

Signifies whether the array is wrapped (for example <books><book/><book/></books>)
or unwrapped (<book/><book/>).

Default value is false. The definition takes effect only when defined alongside type being array (outside the items).

Required:no

Reference โ€‹


XmlContent โ€‹

Shorthand for a xml response.

Use as @OA\Schema inside a Response and MediaType->'application/xml' will be generated.

Nested elements โ€‹


Discriminator, Items, Property, ExternalDocumentation, Xml, AdditionalProperties, Encoding, Examples, Attachable