From 6e42c928761fbde330a3a5f6040cd4e5d3d4f62f Mon Sep 17 00:00:00 2001 From: Malek Mneri Date: Fri, 14 Apr 2023 09:37:10 +0100 Subject: [PATCH 1/4] improved documentation for annotations/attributes --- docs/reference/annotations.md | 48 +++--- docs/reference/attributes.md | 251 +++++++++++++++++------------ src/Annotations/Examples.php | 1 + src/Annotations/Header.php | 1 + src/Annotations/JsonContent.php | 2 + src/Annotations/Parameter.php | 1 + src/Annotations/RequestBody.php | 1 + src/Annotations/Response.php | 1 + src/Annotations/Schema.php | 26 ++- src/Annotations/SecurityScheme.php | 1 + 10 files changed, 201 insertions(+), 132 deletions(-) diff --git a/docs/reference/annotations.md b/docs/reference/annotations.md index 45195e28c..2aeab2517 100644 --- a/docs/reference/annotations.md +++ b/docs/reference/annotations.md @@ -165,7 +165,7 @@ On top of this subset, there are extensions provided by this specification to al ---
ref : string|class-string|object
-

No details available.

See: Using refs

+

The relative or absolute path to an example.

See: Using refs

example : string

The key into `#/components/examples`.

summary : string
@@ -313,7 +313,7 @@ A map between the scope name and a short description for it.

---
ref : string|class-string|object
-

No details available.

See: Using refs

+

The relative or absolute path to the endpoint.

See: Using refs

header : string

No details available.

description : string
@@ -609,7 +609,7 @@ A unique parameter is defined by a combination of a name and location. ---
ref : string|class-string|object
-

No details available.

See: Using refs

+

The relative or absolute path to the endpoint.

See: Using refs

parameter : string

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

name : string
@@ -865,7 +865,7 @@ Describes a single request body. ---
ref : string|class-string|object
-

No details available.

See: Using refs

+

The relative or absolute path to a request body.

See: Using refs

request : string

Request body model name.

description : string
@@ -902,7 +902,7 @@ static links to operations based on the response. ---
ref : string|class-string|object
-

No details available.

See: Using refs

+

The relative or absolute path to a response.

See: Using refs

response : string|int

The key into Operations->responses array.

@@ -938,7 +938,7 @@ On top of this subset, there are extensions provided by this specification to al ---

ref : string|class-string|object
-

No details available.

See: Using refs

+

The relative or absolute path to the endpoint.

See: Using refs

schema : string

The key into Components->schemas array.

title : string
@@ -948,11 +948,11 @@ Preferably short; use description for more details.

description : string

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

maxProperties : int
-

An object instance is valid against "maxProperties" if its number of properties is less than, or equal to, the
-value of this property.

+

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.

minProperties : int
-

An object instance is valid against "minProperties" if its number of properties is greater than, or equal to,
-the value of this property.

+

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 : string[]

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

@@ -974,27 +974,33 @@ Default value is csv.

default : mixed

Sets a default value to the parameter. The type of the value depends on the defined type.

See: JSON schema validation

maximum : int|float
-

No details available.

See: JSON schema validation

+

The maximum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMaximum : bool
-

No details available.

See: JSON schema validation

+

A boolean value indicating whether the maximum value specified in the maximum attribute is excluded from the set of valid values.
+If this attribute is set to true, then the maximum value is not included in the set of valid values.

See: JSON schema validation

minimum : int|float
-

No details available.

See: JSON schema validation

+

The minimum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMinimum : bool
-

No details available.

See: JSON schema validation

+

A boolean value indicating whether the minimum value specified in the minimum attribute is excluded from the set of valid values.
+If this attribute is set to true, then the minimum value is not included in the set of valid values.

See: JSON schema validation

maxLength : int
-

No details available.

See: JSON schema validation

+

The maximum length of a string property. A string instance is valid against this property if its length is less than, or equal to, the value of this attribute.

See: JSON schema validation

minLength : int
-

No details available.

See: JSON schema validation

+

The minimum length of a string property. A string instance is valid against this property if its length is greater than, or equal to, the value of this attribute.

See: JSON schema validation

pattern : string

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

maxItems : int
-

No details available.

See: JSON schema validation

+

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

See: JSON schema validation

minItems : int
-

No details available.

See: JSON schema validation

+

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

See: JSON schema validation

uniqueItems : bool
-

No details available.

See: JSON schema validation

+

A boolean value indicating whether all items in an array property must be unique.
+If this attribute is set to true, then all items in the array must be unique.

See: JSON schema validation

enum : string[]|int[]|float[]|\UnitEnum[]|class-string
-

No details available.

See: JSON schema validation

+

A collection of allowable values for a property.
+A property instance is valid against this attribute if its value is one of the values specified in this collection.

See: JSON schema validation

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.

@@ -1072,7 +1078,7 @@ defined by this property's value.

---
ref : string|class-string|object
-

No details available.

See: Using refs

+

The relative or absolute path to a security scheme.

See: Using refs

securityScheme : string

The key into OpenApi->security array.

type : string
diff --git a/docs/reference/attributes.md b/docs/reference/attributes.md index c3ea6e537..4a7e7395e 100644 --- a/docs/reference/attributes.md +++ b/docs/reference/attributes.md @@ -22,7 +22,7 @@ In addition to this page, there are also a number of [examples](https://github.c ---
ref : string|class-string|object|null
-

No details available.

See: Using refs

+

The relative or absolute path to the endpoint.

See: Using refs

schema : string|null

The key into Components->schemas array.

title : string|null
@@ -32,16 +32,16 @@ Preferably short; use description for more details.

description : string|null

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

maxProperties : int|null
-

An object instance is valid against "maxProperties" if its number of properties is less than, or equal to, the
-value of this property.

+

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.

minProperties : int|null
-

An object instance is valid against "minProperties" if its number of properties is greater than, or equal to,
-the value of this property.

+

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 : string[]

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

properties : Property[]
-

No details available.

+

A collection of properties to define for an object. Each property is represented as an instance of the Property class.

type : string|null

The type of the schema/property. The value MUST be one of "string", "number", "integer", "boolean", "array" or
"object".

@@ -62,27 +62,33 @@ Default value is csv.

default : mixed|null

Sets a default value to the parameter. The type of the value depends on the defined type.

See: JSON schema validation

maximum : int|float
-

No details available.

See: JSON schema validation

+

The maximum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMaximum : bool|null
-

No details available.

See: JSON schema validation

+

A boolean value indicating whether the maximum value specified in the maximum attribute is excluded from the set of valid values.
+If this attribute is set to true, then the maximum value is not included in the set of valid values.

See: JSON schema validation

minimum : int|float
-

No details available.

See: JSON schema validation

+

The minimum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMinimum : bool|null
-

No details available.

See: JSON schema validation

+

A boolean value indicating whether the minimum value specified in the minimum attribute is excluded from the set of valid values.
+If this attribute is set to true, then the minimum value is not included in the set of valid values.

See: JSON schema validation

maxLength : int|null
-

No details available.

See: JSON schema validation

+

The maximum length of a string property. A string instance is valid against this property if its length is less than, or equal to, the value of this attribute.

See: JSON schema validation

minLength : int|null
-

No details available.

See: JSON schema validation

+

The minimum length of a string property. A string instance is valid against this property if its length is greater than, or equal to, the value of this attribute.

See: JSON schema validation

maxItems : int|null
-

No details available.

See: JSON schema validation

+

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

See: JSON schema validation

minItems : int|null
-

No details available.

See: JSON schema validation

+

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

See: JSON schema validation

uniqueItems : bool|null
-

No details available.

See: JSON schema validation

+

A boolean value indicating whether all items in an array property must be unique.
+If this attribute is set to true, then all items in the array must be unique.

See: JSON schema validation

pattern : string|null

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

enum : string[]|int[]|float[]|\UnitEnum[]|class-string
-

No details available.

See: JSON schema validation

+

A collection of allowable values for a property.
+A property instance is valid against this attribute if its value is one of the values specified in this collection.

See: JSON schema validation

discriminator : OpenApi\Attributes\Discriminator|null

Adds support for polymorphism.

@@ -276,7 +282,7 @@ Default value is false.

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

ref : string|class-string|object|null
-

No details available.

See: Using refs

+

The relative or absolute path to the endpoint.

See: Using refs

schema : OpenApi\Attributes\Schema|null

The schema defining the type used for the parameter.

example : mixed|null
@@ -490,7 +496,7 @@ in JSON or YAML documents.

The value field and externalValue field are mutually exclusive.

ref : string|class-string|object|null
-

No details available.

See: Using refs

+

The relative or absolute path to an example.

See: Using refs

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
@@ -768,7 +774,7 @@ These will be ignored but can be used for custom processing.

---
ref : string|class-string|object|null
-

No details available.

See: Using refs

+

The relative or absolute path to the endpoint.

See: Using refs

header : string|null

No details available.

description : string|null
@@ -847,7 +853,7 @@ Default value is false.

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

ref : string|class-string|object|null
-

No details available.

See: Using refs

+

The relative or absolute path to the endpoint.

See: Using refs

schema : OpenApi\Attributes\Schema|null

The schema defining the type used for the parameter.

example : mixed|null
@@ -958,7 +964,7 @@ These will be ignored but can be used for custom processing.

---
ref : string|class-string|object|null
-

No details available.

See: Using refs

+

The relative or absolute path to the endpoint.

See: Using refs

schema : string|null

The key into Components->schemas array.

title : string|null
@@ -968,16 +974,16 @@ Preferably short; use description for more details.

description : string|null

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

maxProperties : int|null
-

An object instance is valid against "maxProperties" if its number of properties is less than, or equal to, the
-value of this property.

+

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.

minProperties : int|null
-

An object instance is valid against "minProperties" if its number of properties is greater than, or equal to,
-the value of this property.

+

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 : string[]

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

properties : Property[]
-

No details available.

+

A collection of properties to define for an object. Each property is represented as an instance of the Property class.

type : string|null

The type of the schema/property. The value MUST be one of "string", "number", "integer", "boolean", "array" or
"object".

@@ -998,27 +1004,33 @@ Default value is csv.

default : mixed|null

Sets a default value to the parameter. The type of the value depends on the defined type.

See: JSON schema validation

maximum : int|float
-

No details available.

See: JSON schema validation

+

The maximum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMaximum : bool|null
-

No details available.

See: JSON schema validation

+

A boolean value indicating whether the maximum value specified in the maximum attribute is excluded from the set of valid values.
+If this attribute is set to true, then the maximum value is not included in the set of valid values.

See: JSON schema validation

minimum : int|float
-

No details available.

See: JSON schema validation

+

The minimum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMinimum : bool|null
-

No details available.

See: JSON schema validation

+

A boolean value indicating whether the minimum value specified in the minimum attribute is excluded from the set of valid values.
+If this attribute is set to true, then the minimum value is not included in the set of valid values.

See: JSON schema validation

maxLength : int|null
-

No details available.

See: JSON schema validation

+

The maximum length of a string property. A string instance is valid against this property if its length is less than, or equal to, the value of this attribute.

See: JSON schema validation

minLength : int|null
-

No details available.

See: JSON schema validation

+

The minimum length of a string property. A string instance is valid against this property if its length is greater than, or equal to, the value of this attribute.

See: JSON schema validation

maxItems : int|null
-

No details available.

See: JSON schema validation

+

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

See: JSON schema validation

minItems : int|null
-

No details available.

See: JSON schema validation

+

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

See: JSON schema validation

uniqueItems : bool|null
-

No details available.

See: JSON schema validation

+

A boolean value indicating whether all items in an array property must be unique.
+If this attribute is set to true, then all items in the array must be unique.

See: JSON schema validation

pattern : string|null

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

enum : string[]|int[]|float[]|\UnitEnum[]|class-string
-

No details available.

See: JSON schema validation

+

A collection of allowable values for a property.
+A property instance is valid against this attribute if its value is one of the values specified in this collection.

See: JSON schema validation

discriminator : OpenApi\Attributes\Discriminator|null

Adds support for polymorphism.

@@ -1091,9 +1103,10 @@ These will be ignored but can be used for custom processing.

---
examples : array<string,Examples>
-

No details available.

+

An associative array of Examples attributes. The keys represent the name of the example and the values are instances of the Examples attribute.
+Each example is used to show how the content of the request or response should look like.

ref : string|class-string|object|null
-

No details available.

See: Using refs

+

The relative or absolute path to the endpoint.

See: Using refs

schema : string|null

The key into Components->schemas array.

title : string|null
@@ -1103,16 +1116,16 @@ Preferably short; use description for more details.

description : string|null

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

maxProperties : int|null
-

An object instance is valid against "maxProperties" if its number of properties is less than, or equal to, the
-value of this property.

+

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.

minProperties : int|null
-

An object instance is valid against "minProperties" if its number of properties is greater than, or equal to,
-the value of this property.

+

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 : string[]

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

properties : Property[]
-

No details available.

+

A collection of properties to define for an object. Each property is represented as an instance of the Property class.

type : string|null

The type of the schema/property. The value MUST be one of "string", "number", "integer", "boolean", "array" or
"object".

@@ -1133,27 +1146,33 @@ Default value is csv.

default : mixed|null

Sets a default value to the parameter. The type of the value depends on the defined type.

See: JSON schema validation

maximum : int|float
-

No details available.

See: JSON schema validation

+

The maximum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMaximum : bool|null
-

No details available.

See: JSON schema validation

+

A boolean value indicating whether the maximum value specified in the maximum attribute is excluded from the set of valid values.
+If this attribute is set to true, then the maximum value is not included in the set of valid values.

See: JSON schema validation

minimum : int|float
-

No details available.

See: JSON schema validation

+

The minimum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMinimum : bool|null
-

No details available.

See: JSON schema validation

+

A boolean value indicating whether the minimum value specified in the minimum attribute is excluded from the set of valid values.
+If this attribute is set to true, then the minimum value is not included in the set of valid values.

See: JSON schema validation

maxLength : int|null
-

No details available.

See: JSON schema validation

+

The maximum length of a string property. A string instance is valid against this property if its length is less than, or equal to, the value of this attribute.

See: JSON schema validation

minLength : int|null
-

No details available.

See: JSON schema validation

+

The minimum length of a string property. A string instance is valid against this property if its length is greater than, or equal to, the value of this attribute.

See: JSON schema validation

maxItems : int|null
-

No details available.

See: JSON schema validation

+

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

See: JSON schema validation

minItems : int|null
-

No details available.

See: JSON schema validation

+

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

See: JSON schema validation

uniqueItems : bool|null
-

No details available.

See: JSON schema validation

+

A boolean value indicating whether all items in an array property must be unique.
+If this attribute is set to true, then all items in the array must be unique.

See: JSON schema validation

pattern : string|null

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

enum : string[]|int[]|float[]|\UnitEnum[]|class-string
-

No details available.

See: JSON schema validation

+

A collection of allowable values for a property.
+A property instance is valid against this attribute if its value is one of the values specified in this collection.

See: JSON schema validation

discriminator : OpenApi\Attributes\Discriminator|null

Adds support for polymorphism.

@@ -1545,7 +1564,7 @@ Default value is false.

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

ref : string|class-string|object|null
-

No details available.

See: Using refs

+

The relative or absolute path to the endpoint.

See: Using refs

schema : OpenApi\Attributes\Schema|null

The schema defining the type used for the parameter.

example : mixed|null
@@ -1774,7 +1793,7 @@ Default value is false.

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

ref : string|class-string|object|null
-

No details available.

See: Using refs

+

The relative or absolute path to the endpoint.

See: Using refs

schema : OpenApi\Attributes\Schema|null

The schema defining the type used for the parameter.

example : mixed|null
@@ -1937,7 +1956,7 @@ These will be ignored but can be used for custom processing.

property : string|null

The key into Schema->properties array.

ref : string|class-string|object|null
-

No details available.

See: Using refs

+

The relative or absolute path to the endpoint.

See: Using refs

schema : string|null

The key into Components->schemas array.

title : string|null
@@ -1947,16 +1966,16 @@ Preferably short; use description for more details.

description : string|null

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

maxProperties : int|null
-

An object instance is valid against "maxProperties" if its number of properties is less than, or equal to, the
-value of this property.

+

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.

minProperties : int|null
-

An object instance is valid against "minProperties" if its number of properties is greater than, or equal to,
-the value of this property.

+

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 : string[]

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

properties : Property[]
-

No details available.

+

A collection of properties to define for an object. Each property is represented as an instance of the Property class.

type : string|null

The type of the schema/property. The value MUST be one of "string", "number", "integer", "boolean", "array" or
"object".

@@ -1977,27 +1996,33 @@ Default value is csv.

default : mixed|null

Sets a default value to the parameter. The type of the value depends on the defined type.

See: JSON schema validation

maximum : int|float
-

No details available.

See: JSON schema validation

+

The maximum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMaximum : bool|null
-

No details available.

See: JSON schema validation

+

A boolean value indicating whether the maximum value specified in the maximum attribute is excluded from the set of valid values.
+If this attribute is set to true, then the maximum value is not included in the set of valid values.

See: JSON schema validation

minimum : int|float
-

No details available.

See: JSON schema validation

+

The minimum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMinimum : bool|null
-

No details available.

See: JSON schema validation

+

A boolean value indicating whether the minimum value specified in the minimum attribute is excluded from the set of valid values.
+If this attribute is set to true, then the minimum value is not included in the set of valid values.

See: JSON schema validation

maxLength : int|null
-

No details available.

See: JSON schema validation

+

The maximum length of a string property. A string instance is valid against this property if its length is less than, or equal to, the value of this attribute.

See: JSON schema validation

minLength : int|null
-

No details available.

See: JSON schema validation

+

The minimum length of a string property. A string instance is valid against this property if its length is greater than, or equal to, the value of this attribute.

See: JSON schema validation

maxItems : int|null
-

No details available.

See: JSON schema validation

+

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

See: JSON schema validation

minItems : int|null
-

No details available.

See: JSON schema validation

+

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

See: JSON schema validation

uniqueItems : bool|null
-

No details available.

See: JSON schema validation

+

A boolean value indicating whether all items in an array property must be unique.
+If this attribute is set to true, then all items in the array must be unique.

See: JSON schema validation

pattern : string|null

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

enum : string[]|int[]|float[]|\UnitEnum[]|class-string
-

No details available.

See: JSON schema validation

+

A collection of allowable values for a property.
+A property instance is valid against this attribute if its value is one of the values specified in this collection.

See: JSON schema validation

discriminator : OpenApi\Attributes\Discriminator|null

Adds support for polymorphism.

@@ -2196,7 +2221,7 @@ Default value is false.

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

ref : string|class-string|object|null
-

No details available.

See: Using refs

+

The relative or absolute path to the endpoint.

See: Using refs

schema : OpenApi\Attributes\Schema|null

The schema defining the type used for the parameter.

example : mixed|null
@@ -2267,7 +2292,7 @@ These will be ignored but can be used for custom processing.

---
ref : string|class-string|object|null
-

No details available.

See: Using refs

+

The relative or absolute path to a request body.

See: Using refs

request : string|null

Request body model name.

description : string|null
@@ -2311,7 +2336,7 @@ These will be ignored but can be used for custom processing.

---
ref : string|class-string|object|null
-

No details available.

See: Using refs

+

The relative or absolute path to a response.

See: Using refs

response : string|int|null

The key into Operations->responses array.

@@ -2363,7 +2388,7 @@ These will be ignored but can be used for custom processing.

---
ref : string|class-string|object|null
-

No details available.

See: Using refs

+

The relative or absolute path to the endpoint.

See: Using refs

schema : string|null

The key into Components->schemas array.

title : string|null
@@ -2373,16 +2398,16 @@ Preferably short; use description for more details.

description : string|null

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

maxProperties : int|null
-

An object instance is valid against "maxProperties" if its number of properties is less than, or equal to, the
-value of this property.

+

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.

minProperties : int|null
-

An object instance is valid against "minProperties" if its number of properties is greater than, or equal to,
-the value of this property.

+

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 : string[]

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

properties : Property[]
-

No details available.

+

A collection of properties to define for an object. Each property is represented as an instance of the Property class.

type : string|null

The type of the schema/property. The value MUST be one of "string", "number", "integer", "boolean", "array" or
"object".

@@ -2403,27 +2428,33 @@ Default value is csv.

default : mixed|null

Sets a default value to the parameter. The type of the value depends on the defined type.

See: JSON schema validation

maximum : int|float
-

No details available.

See: JSON schema validation

+

The maximum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMaximum : bool|null
-

No details available.

See: JSON schema validation

+

A boolean value indicating whether the maximum value specified in the maximum attribute is excluded from the set of valid values.
+If this attribute is set to true, then the maximum value is not included in the set of valid values.

See: JSON schema validation

minimum : int|float
-

No details available.

See: JSON schema validation

+

The minimum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMinimum : bool|null
-

No details available.

See: JSON schema validation

+

A boolean value indicating whether the minimum value specified in the minimum attribute is excluded from the set of valid values.
+If this attribute is set to true, then the minimum value is not included in the set of valid values.

See: JSON schema validation

maxLength : int|null
-

No details available.

See: JSON schema validation

+

The maximum length of a string property. A string instance is valid against this property if its length is less than, or equal to, the value of this attribute.

See: JSON schema validation

minLength : int|null
-

No details available.

See: JSON schema validation

+

The minimum length of a string property. A string instance is valid against this property if its length is greater than, or equal to, the value of this attribute.

See: JSON schema validation

maxItems : int|null
-

No details available.

See: JSON schema validation

+

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

See: JSON schema validation

minItems : int|null
-

No details available.

See: JSON schema validation

+

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

See: JSON schema validation

uniqueItems : bool|null
-

No details available.

See: JSON schema validation

+

A boolean value indicating whether all items in an array property must be unique.
+If this attribute is set to true, then all items in the array must be unique.

See: JSON schema validation

pattern : string|null

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

enum : string[]|int[]|float[]|\UnitEnum[]|class-string
-

No details available.

See: JSON schema validation

+

A collection of allowable values for a property.
+A property instance is valid against this attribute if its value is one of the values specified in this collection.

See: JSON schema validation

discriminator : OpenApi\Attributes\Discriminator|null

Adds support for polymorphism.

@@ -2502,7 +2533,7 @@ These will be ignored but can be used for custom processing.

---
ref : string|class-string|object|null
-

No details available.

See: Using refs

+

The relative or absolute path to a security scheme.

See: Using refs

securityScheme : string|null

The key into OpenApi->security array.

type : string|null
@@ -2791,7 +2822,7 @@ These will be ignored but can be used for custom processing.

examples : array<string,Examples>

No details available.

ref : string|class-string|object|null
-

No details available.

See: Using refs

+

The relative or absolute path to the endpoint.

See: Using refs

schema : string|null

The key into Components->schemas array.

title : string|null
@@ -2801,16 +2832,16 @@ Preferably short; use description for more details.

description : string|null

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

maxProperties : int|null
-

An object instance is valid against "maxProperties" if its number of properties is less than, or equal to, the
-value of this property.

+

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.

minProperties : int|null
-

An object instance is valid against "minProperties" if its number of properties is greater than, or equal to,
-the value of this property.

+

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 : string[]

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

properties : Property[]
-

No details available.

+

A collection of properties to define for an object. Each property is represented as an instance of the Property class.

type : string|null

The type of the schema/property. The value MUST be one of "string", "number", "integer", "boolean", "array" or
"object".

@@ -2831,27 +2862,33 @@ Default value is csv.

default : mixed|null

Sets a default value to the parameter. The type of the value depends on the defined type.

See: JSON schema validation

maximum : int|float
-

No details available.

See: JSON schema validation

+

The maximum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMaximum : bool|null
-

No details available.

See: JSON schema validation

+

A boolean value indicating whether the maximum value specified in the maximum attribute is excluded from the set of valid values.
+If this attribute is set to true, then the maximum value is not included in the set of valid values.

See: JSON schema validation

minimum : int|float
-

No details available.

See: JSON schema validation

+

The minimum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMinimum : bool|null
-

No details available.

See: JSON schema validation

+

A boolean value indicating whether the minimum value specified in the minimum attribute is excluded from the set of valid values.
+If this attribute is set to true, then the minimum value is not included in the set of valid values.

See: JSON schema validation

maxLength : int|null
-

No details available.

See: JSON schema validation

+

The maximum length of a string property. A string instance is valid against this property if its length is less than, or equal to, the value of this attribute.

See: JSON schema validation

minLength : int|null
-

No details available.

See: JSON schema validation

+

The minimum length of a string property. A string instance is valid against this property if its length is greater than, or equal to, the value of this attribute.

See: JSON schema validation

maxItems : int|null
-

No details available.

See: JSON schema validation

+

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

See: JSON schema validation

minItems : int|null
-

No details available.

See: JSON schema validation

+

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

See: JSON schema validation

uniqueItems : bool|null
-

No details available.

See: JSON schema validation

+

A boolean value indicating whether all items in an array property must be unique.
+If this attribute is set to true, then all items in the array must be unique.

See: JSON schema validation

pattern : string|null

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

enum : string[]|int[]|float[]|\UnitEnum[]|class-string
-

No details available.

See: JSON schema validation

+

A collection of allowable values for a property.
+A property instance is valid against this attribute if its value is one of the values specified in this collection.

See: JSON schema validation

discriminator : OpenApi\Attributes\Discriminator|null

Adds support for polymorphism.

diff --git a/src/Annotations/Examples.php b/src/Annotations/Examples.php index fc26cc9f2..a1f3feb4f 100644 --- a/src/Annotations/Examples.php +++ b/src/Annotations/Examples.php @@ -14,6 +14,7 @@ class Examples extends AbstractAnnotation { /** + * The relative or absolute path to an example. * @see [Using refs](https://swagger.io/docs/specification/using-ref/) * * @var string|class-string|object diff --git a/src/Annotations/Header.php b/src/Annotations/Header.php index 385488b52..2f1e613df 100644 --- a/src/Annotations/Header.php +++ b/src/Annotations/Header.php @@ -15,6 +15,7 @@ class Header extends AbstractAnnotation { /** + * The relative or absolute path to the endpoint. * @see [Using refs](https://swagger.io/docs/specification/using-ref/) * * @var string|class-string|object diff --git a/src/Annotations/JsonContent.php b/src/Annotations/JsonContent.php index 348f8d625..d93d10a44 100644 --- a/src/Annotations/JsonContent.php +++ b/src/Annotations/JsonContent.php @@ -18,6 +18,8 @@ class JsonContent extends Schema { /** + * An associative array of Examples attributes. The keys represent the name of the example and the values are instances of the Examples attribute. + * Each example is used to show how the content of the request or response should look like. * @var array */ public $examples = Generator::UNDEFINED; diff --git a/src/Annotations/Parameter.php b/src/Annotations/Parameter.php index 9ace7f4f3..f0ee85af6 100644 --- a/src/Annotations/Parameter.php +++ b/src/Annotations/Parameter.php @@ -20,6 +20,7 @@ class Parameter extends AbstractAnnotation { /** + * The relative or absolute path to the endpoint. * @see [Using refs](https://swagger.io/docs/specification/using-ref/) * * @var string|class-string|object diff --git a/src/Annotations/RequestBody.php b/src/Annotations/RequestBody.php index e5e3c697a..dffb363a8 100644 --- a/src/Annotations/RequestBody.php +++ b/src/Annotations/RequestBody.php @@ -18,6 +18,7 @@ class RequestBody extends AbstractAnnotation { /** + * The relative or absolute path to a request body. * @see [Using refs](https://swagger.io/docs/specification/using-ref/) * * @var string|class-string|object diff --git a/src/Annotations/Response.php b/src/Annotations/Response.php index e0182e19c..aa4b66934 100644 --- a/src/Annotations/Response.php +++ b/src/Annotations/Response.php @@ -19,6 +19,7 @@ class Response extends AbstractAnnotation { /** + * The relative or absolute path to a response. * @see [Using refs](https://swagger.io/docs/specification/using-ref/) * * @var string|class-string|object diff --git a/src/Annotations/Schema.php b/src/Annotations/Schema.php index 8b51db386..f363a56a1 100644 --- a/src/Annotations/Schema.php +++ b/src/Annotations/Schema.php @@ -24,6 +24,7 @@ class Schema extends AbstractAnnotation { /** + * The relative or absolute path to the endpoint. * @see [Using refs](https://swagger.io/docs/specification/using-ref/) * * @var string|class-string|object @@ -54,16 +55,16 @@ class Schema extends AbstractAnnotation public $description = Generator::UNDEFINED; /** - * An object instance is valid against "maxProperties" if its number of properties is less than, or equal to, the - * value of this property. + * 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. * * @var int */ public $maxProperties = Generator::UNDEFINED; /** - * An object instance is valid against "minProperties" if its number of properties is greater than, or equal to, - * the value of this property. + * 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. * * @var int */ @@ -78,6 +79,7 @@ class Schema extends AbstractAnnotation public $required = Generator::UNDEFINED; /** + * A collection of properties to define for an object. Each property is represented as an instance of the Property class. * @var Property[] */ public $properties = Generator::UNDEFINED; @@ -129,6 +131,7 @@ class Schema extends AbstractAnnotation public $default = Generator::UNDEFINED; /** + * The maximum value allowed for a numeric property. This value must be a number. * @see [JSON schema validation](http://json-schema.org/latest/json-schema-validation.html#anchor17) * * @var int|float @@ -136,6 +139,8 @@ class Schema extends AbstractAnnotation public $maximum = Generator::UNDEFINED; /** + * A boolean value indicating whether the maximum value specified in the maximum attribute is excluded from the set of valid values. + * If this attribute is set to true, then the maximum value is not included in the set of valid values. * @see [JSON schema validation](http://json-schema.org/latest/json-schema-validation.html#anchor17) * * @var bool @@ -143,6 +148,7 @@ class Schema extends AbstractAnnotation public $exclusiveMaximum = Generator::UNDEFINED; /** + * The minimum value allowed for a numeric property. This value must be a number. * @see [JSON schema validation](http://json-schema.org/latest/json-schema-validation.html#anchor21) * * @var int|float @@ -150,6 +156,8 @@ class Schema extends AbstractAnnotation public $minimum = Generator::UNDEFINED; /** + * A boolean value indicating whether the minimum value specified in the minimum attribute is excluded from the set of valid values. + * If this attribute is set to true, then the minimum value is not included in the set of valid values. * @see [JSON schema validation](http://json-schema.org/latest/json-schema-validation.html#anchor21) * * @var bool @@ -157,6 +165,7 @@ class Schema extends AbstractAnnotation public $exclusiveMinimum = Generator::UNDEFINED; /** + * The maximum length of a string property. A string instance is valid against this property if its length is less than, or equal to, the value of this attribute. * @see [JSON schema validation](http://json-schema.org/latest/json-schema-validation.html#anchor26) * * @var int @@ -164,6 +173,7 @@ class Schema extends AbstractAnnotation public $maxLength = Generator::UNDEFINED; /** + * The minimum length of a string property. A string instance is valid against this property if its length is greater than, or equal to, the value of this attribute. * @see [JSON schema validation](http://json-schema.org/latest/json-schema-validation.html#anchor29) * * @var int @@ -178,6 +188,8 @@ class Schema extends AbstractAnnotation public $pattern = Generator::UNDEFINED; /** + * The maximum number of items allowed in an array property. + * An array instance is valid against this property if its number of items is less than, or equal to, the value of this attribute. * @see [JSON schema validation](http://json-schema.org/latest/json-schema-validation.html#anchor42) * * @var int @@ -185,6 +197,8 @@ class Schema extends AbstractAnnotation public $maxItems = Generator::UNDEFINED; /** + * The minimum number of items allowed in an array property. + * An array instance is valid against this property if its number of items is greater than, or equal to, the value of this attribute. * @see [JSON schema validation](http://json-schema.org/latest/json-schema-validation.html#anchor45) * * @var int @@ -192,6 +206,8 @@ class Schema extends AbstractAnnotation public $minItems = Generator::UNDEFINED; /** + * A boolean value indicating whether all items in an array property must be unique. + * If this attribute is set to true, then all items in the array must be unique. * @see [JSON schema validation](http://json-schema.org/latest/json-schema-validation.html#anchor49) * * @var bool @@ -199,6 +215,8 @@ class Schema extends AbstractAnnotation public $uniqueItems = Generator::UNDEFINED; /** + * A collection of allowable values for a property. + * A property instance is valid against this attribute if its value is one of the values specified in this collection. * @see [JSON schema validation](http://json-schema.org/latest/json-schema-validation.html#anchor76) * * @var string[]|int[]|float[]|\UnitEnum[]|class-string diff --git a/src/Annotations/SecurityScheme.php b/src/Annotations/SecurityScheme.php index 785024025..0ac464e6e 100644 --- a/src/Annotations/SecurityScheme.php +++ b/src/Annotations/SecurityScheme.php @@ -16,6 +16,7 @@ class SecurityScheme extends AbstractAnnotation { /** + * The relative or absolute path to a security scheme. * @see [Using refs](https://swagger.io/docs/specification/using-ref/) * * @var string|class-string|object From 9ae371958d1fcb4b4a9dd6607bfef033553db8e1 Mon Sep 17 00:00:00 2001 From: Malek Mneri Date: Fri, 14 Apr 2023 10:03:03 +0100 Subject: [PATCH 2/4] update the 'in' attribute description for children of the Parameter Class --- docs/reference/annotations.md | 8 ++++---- docs/reference/attributes.md | 8 ++++---- src/Annotations/CookieParameter.php | 1 + src/Annotations/HeaderParameter.php | 1 + src/Annotations/PathParameter.php | 1 + src/Annotations/QueryParameter.php | 1 + 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/docs/reference/annotations.md b/docs/reference/annotations.md index 2aeab2517..8b86e60a6 100644 --- a/docs/reference/annotations.md +++ b/docs/reference/annotations.md @@ -97,7 +97,7 @@ A `@OA\Request` cookie parameter. ---

in
-

No details available.

+

This takes 'cookie' as the default location.

## [Delete](https://github.com/zircote/swagger-php/tree/master/src/Annotations/Delete.php) @@ -355,7 +355,7 @@ A `@OA\Request` header parameter. ---
in
-

No details available.

+

This takes 'header' as the default location.

## [Info](https://github.com/zircote/swagger-php/tree/master/src/Annotations/Info.php) @@ -768,7 +768,7 @@ A `@OA\Request` path parameter. ---
in
-

No details available.

+

This takes 'path' as the default location.

required

No details available.

@@ -846,7 +846,7 @@ A `@OA\Request` query parameter. ---
in
-

No details available.

+

This takes 'query' as the default location.

## [RequestBody](https://github.com/zircote/swagger-php/tree/master/src/Annotations/RequestBody.php) diff --git a/docs/reference/attributes.md b/docs/reference/attributes.md index 4a7e7395e..b4a3c4f27 100644 --- a/docs/reference/attributes.md +++ b/docs/reference/attributes.md @@ -265,7 +265,7 @@ This could contain examples of use.

CommonMark syntax may be used for rich text representation.

in : string|null
-

No details available.

+

This takes 'cookie' as the default location.

required : bool|null

Determines whether this parameter is mandatory.

@@ -836,7 +836,7 @@ This could contain examples of use.

CommonMark syntax may be used for rich text representation.

in : string|null
-

No details available.

+

This takes 'header' as the default location.

required : bool|null

Determines whether this parameter is mandatory.

@@ -1779,7 +1779,7 @@ This could contain examples of use.

CommonMark syntax may be used for rich text representation.

in : string|null
-

No details available.

+

This takes 'path' as the default location.

required : bool|null

No details available.

deprecated : bool|null
@@ -2204,7 +2204,7 @@ This could contain examples of use.

CommonMark syntax may be used for rich text representation.

in : string|null
-

No details available.

+

This takes 'query' as the default location.

required : bool|null

Determines whether this parameter is mandatory.

diff --git a/src/Annotations/CookieParameter.php b/src/Annotations/CookieParameter.php index b02ae01d9..5c2f42205 100644 --- a/src/Annotations/CookieParameter.php +++ b/src/Annotations/CookieParameter.php @@ -15,6 +15,7 @@ class CookieParameter extends Parameter { /** * @inheritdoc + * This takes 'cookie' as the default location. */ public $in = 'cookie'; } diff --git a/src/Annotations/HeaderParameter.php b/src/Annotations/HeaderParameter.php index 27e3eec9d..439a2c018 100644 --- a/src/Annotations/HeaderParameter.php +++ b/src/Annotations/HeaderParameter.php @@ -15,6 +15,7 @@ class HeaderParameter extends Parameter { /** * @inheritdoc + * This takes 'header' as the default location. */ public $in = 'header'; } diff --git a/src/Annotations/PathParameter.php b/src/Annotations/PathParameter.php index 9e600b479..4e3d42c8b 100644 --- a/src/Annotations/PathParameter.php +++ b/src/Annotations/PathParameter.php @@ -15,6 +15,7 @@ class PathParameter extends Parameter { /** * @inheritdoc + * This takes 'path' as the default location. */ public $in = 'path'; diff --git a/src/Annotations/QueryParameter.php b/src/Annotations/QueryParameter.php index 0f5fe299c..6ee3e47f8 100644 --- a/src/Annotations/QueryParameter.php +++ b/src/Annotations/QueryParameter.php @@ -15,6 +15,7 @@ class QueryParameter extends Parameter { /** * @inheritdoc + * This takes 'query' as the default location. */ public $in = 'query'; } From abf3d318db7081fe7ac31b64351cb1f2b0605934 Mon Sep 17 00:00:00 2001 From: Malek Mneri Date: Fri, 14 Apr 2023 14:05:06 +0100 Subject: [PATCH 3/4] run `composer cs` --- src/Annotations/Examples.php | 1 + src/Annotations/Header.php | 1 + src/Annotations/JsonContent.php | 1 + src/Annotations/Parameter.php | 1 + src/Annotations/RequestBody.php | 1 + src/Annotations/Response.php | 1 + src/Annotations/Schema.php | 12 ++++++++++++ src/Annotations/SecurityScheme.php | 1 + 8 files changed, 19 insertions(+) diff --git a/src/Annotations/Examples.php b/src/Annotations/Examples.php index a1f3feb4f..086c3c9a8 100644 --- a/src/Annotations/Examples.php +++ b/src/Annotations/Examples.php @@ -15,6 +15,7 @@ class Examples extends AbstractAnnotation { /** * The relative or absolute path to an example. + * * @see [Using refs](https://swagger.io/docs/specification/using-ref/) * * @var string|class-string|object diff --git a/src/Annotations/Header.php b/src/Annotations/Header.php index 2f1e613df..8d6b64d10 100644 --- a/src/Annotations/Header.php +++ b/src/Annotations/Header.php @@ -16,6 +16,7 @@ class Header extends AbstractAnnotation { /** * The relative or absolute path to the endpoint. + * * @see [Using refs](https://swagger.io/docs/specification/using-ref/) * * @var string|class-string|object diff --git a/src/Annotations/JsonContent.php b/src/Annotations/JsonContent.php index d93d10a44..c28acad1e 100644 --- a/src/Annotations/JsonContent.php +++ b/src/Annotations/JsonContent.php @@ -20,6 +20,7 @@ class JsonContent extends Schema /** * An associative array of Examples attributes. The keys represent the name of the example and the values are instances of the Examples attribute. * Each example is used to show how the content of the request or response should look like. + * * @var array */ public $examples = Generator::UNDEFINED; diff --git a/src/Annotations/Parameter.php b/src/Annotations/Parameter.php index f0ee85af6..ccb3ab8e2 100644 --- a/src/Annotations/Parameter.php +++ b/src/Annotations/Parameter.php @@ -21,6 +21,7 @@ class Parameter extends AbstractAnnotation { /** * The relative or absolute path to the endpoint. + * * @see [Using refs](https://swagger.io/docs/specification/using-ref/) * * @var string|class-string|object diff --git a/src/Annotations/RequestBody.php b/src/Annotations/RequestBody.php index dffb363a8..20045d91e 100644 --- a/src/Annotations/RequestBody.php +++ b/src/Annotations/RequestBody.php @@ -19,6 +19,7 @@ class RequestBody extends AbstractAnnotation { /** * The relative or absolute path to a request body. + * * @see [Using refs](https://swagger.io/docs/specification/using-ref/) * * @var string|class-string|object diff --git a/src/Annotations/Response.php b/src/Annotations/Response.php index aa4b66934..db3abf14f 100644 --- a/src/Annotations/Response.php +++ b/src/Annotations/Response.php @@ -20,6 +20,7 @@ class Response extends AbstractAnnotation { /** * The relative or absolute path to a response. + * * @see [Using refs](https://swagger.io/docs/specification/using-ref/) * * @var string|class-string|object diff --git a/src/Annotations/Schema.php b/src/Annotations/Schema.php index f363a56a1..9d19e8c66 100644 --- a/src/Annotations/Schema.php +++ b/src/Annotations/Schema.php @@ -25,6 +25,7 @@ class Schema extends AbstractAnnotation { /** * The relative or absolute path to the endpoint. + * * @see [Using refs](https://swagger.io/docs/specification/using-ref/) * * @var string|class-string|object @@ -80,6 +81,7 @@ class Schema extends AbstractAnnotation /** * A collection of properties to define for an object. Each property is represented as an instance of the Property class. + * * @var Property[] */ public $properties = Generator::UNDEFINED; @@ -132,6 +134,7 @@ class Schema extends AbstractAnnotation /** * The maximum value allowed for a numeric property. This value must be a number. + * * @see [JSON schema validation](http://json-schema.org/latest/json-schema-validation.html#anchor17) * * @var int|float @@ -141,6 +144,7 @@ class Schema extends AbstractAnnotation /** * A boolean value indicating whether the maximum value specified in the maximum attribute is excluded from the set of valid values. * If this attribute is set to true, then the maximum value is not included in the set of valid values. + * * @see [JSON schema validation](http://json-schema.org/latest/json-schema-validation.html#anchor17) * * @var bool @@ -149,6 +153,7 @@ class Schema extends AbstractAnnotation /** * The minimum value allowed for a numeric property. This value must be a number. + * * @see [JSON schema validation](http://json-schema.org/latest/json-schema-validation.html#anchor21) * * @var int|float @@ -158,6 +163,7 @@ class Schema extends AbstractAnnotation /** * A boolean value indicating whether the minimum value specified in the minimum attribute is excluded from the set of valid values. * If this attribute is set to true, then the minimum value is not included in the set of valid values. + * * @see [JSON schema validation](http://json-schema.org/latest/json-schema-validation.html#anchor21) * * @var bool @@ -166,6 +172,7 @@ class Schema extends AbstractAnnotation /** * The maximum length of a string property. A string instance is valid against this property if its length is less than, or equal to, the value of this attribute. + * * @see [JSON schema validation](http://json-schema.org/latest/json-schema-validation.html#anchor26) * * @var int @@ -174,6 +181,7 @@ class Schema extends AbstractAnnotation /** * The minimum length of a string property. A string instance is valid against this property if its length is greater than, or equal to, the value of this attribute. + * * @see [JSON schema validation](http://json-schema.org/latest/json-schema-validation.html#anchor29) * * @var int @@ -190,6 +198,7 @@ class Schema extends AbstractAnnotation /** * The maximum number of items allowed in an array property. * An array instance is valid against this property if its number of items is less than, or equal to, the value of this attribute. + * * @see [JSON schema validation](http://json-schema.org/latest/json-schema-validation.html#anchor42) * * @var int @@ -199,6 +208,7 @@ class Schema extends AbstractAnnotation /** * The minimum number of items allowed in an array property. * An array instance is valid against this property if its number of items is greater than, or equal to, the value of this attribute. + * * @see [JSON schema validation](http://json-schema.org/latest/json-schema-validation.html#anchor45) * * @var int @@ -208,6 +218,7 @@ class Schema extends AbstractAnnotation /** * A boolean value indicating whether all items in an array property must be unique. * If this attribute is set to true, then all items in the array must be unique. + * * @see [JSON schema validation](http://json-schema.org/latest/json-schema-validation.html#anchor49) * * @var bool @@ -217,6 +228,7 @@ class Schema extends AbstractAnnotation /** * A collection of allowable values for a property. * A property instance is valid against this attribute if its value is one of the values specified in this collection. + * * @see [JSON schema validation](http://json-schema.org/latest/json-schema-validation.html#anchor76) * * @var string[]|int[]|float[]|\UnitEnum[]|class-string diff --git a/src/Annotations/SecurityScheme.php b/src/Annotations/SecurityScheme.php index 0ac464e6e..2d30e5bc6 100644 --- a/src/Annotations/SecurityScheme.php +++ b/src/Annotations/SecurityScheme.php @@ -17,6 +17,7 @@ class SecurityScheme extends AbstractAnnotation { /** * The relative or absolute path to a security scheme. + * * @see [Using refs](https://swagger.io/docs/specification/using-ref/) * * @var string|class-string|object From c959d19a17896ab9b572a9e1ade993b438c46ffb Mon Sep 17 00:00:00 2001 From: Malek Mneri Date: Mon, 17 Apr 2023 08:58:52 +0100 Subject: [PATCH 4/4] separated summary from description --- docs/reference/annotations.md | 28 +++-- docs/reference/attributes.md | 196 +++++++++++++++++++++++--------- src/Annotations/JsonContent.php | 4 +- src/Annotations/Schema.php | 32 ++++-- 4 files changed, 187 insertions(+), 73 deletions(-) diff --git a/docs/reference/annotations.md b/docs/reference/annotations.md index 8b86e60a6..2208ec7af 100644 --- a/docs/reference/annotations.md +++ b/docs/reference/annotations.md @@ -957,12 +957,14 @@ An object instance is valid against this property if its number of properties is

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

type : string
-

The type of the schema/property. The value MUST be one of "string", "number", "integer", "boolean", "array" or
-"object".

+

The type of the schema/property.
+
+The value MUST be one of "string", "number", "integer", "boolean", "array" or "object".

format : string

The extending format for the previously mentioned type. See Data Type Formats for further details.

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.
@@ -976,30 +978,40 @@ Default value is csv.

maximum : int|float

The maximum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMaximum : bool
-

A boolean value indicating whether the maximum value specified in the maximum attribute is excluded from the set of valid values.
-If this attribute is set to true, then the maximum value is not included in the set of valid values.

See: JSON schema validation

+

A boolean indicating whether the maximum value is excluded from the set of valid values.
+
+When set to true, the maximum value is excluded, and when false or not specified, it is included.

See: JSON schema validation

minimum : int|float

The minimum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMinimum : bool
-

A boolean value indicating whether the minimum value specified in the minimum attribute is excluded from the set of valid values.
-If this attribute is set to true, then the minimum value is not included in the set of valid values.

See: JSON schema validation

+

A boolean indicating whether the minimum value is excluded from the set of valid values.
+
+When set to true, the minimum value is excluded, and when false or not specified, it is included.

See: JSON schema validation

maxLength : int
-

The maximum length of a string property. A string instance is valid against this property if its length is less than, or equal to, the value of this attribute.

See: JSON schema validation

+

The maximum length of a string property.
+
+A string instance is valid against this property if its length is less than, or equal to, the value of this attribute.

See: JSON schema validation

minLength : int
-

The minimum length of a string property. A string instance is valid against this property if its length is greater than, or equal to, the value of this attribute.

See: JSON schema validation

+

The minimum length of a string property.
+
+A string instance is valid against this property if its length is greater than, or equal to, the value of this attribute.

See: JSON schema validation

pattern : string

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

maxItems : int

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

See: JSON schema validation

minItems : int

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

See: JSON schema validation

uniqueItems : bool

A boolean value indicating whether all items in an array property must be unique.
+
If this attribute is set to true, then all items in the array must be unique.

See: JSON schema validation

enum : string[]|int[]|float[]|\UnitEnum[]|class-string

A collection of allowable values for a property.
+
A property instance is valid against this attribute if its value is one of the values specified in this collection.

See: JSON schema validation

multipleOf : int|float

A numeric instance is valid against "multipleOf" if the result of the division of the instance by this
diff --git a/docs/reference/attributes.md b/docs/reference/attributes.md index b4a3c4f27..c4ebcf0c2 100644 --- a/docs/reference/attributes.md +++ b/docs/reference/attributes.md @@ -41,16 +41,20 @@ An object instance is valid against this property if its number of properties is

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

properties : Property[]
-

A collection of properties to define for an object. Each property is represented as an instance of the Property class.

+

A collection of properties to define for an object.
+
+Each property is represented as an instance of the Property class.

type : string|null
-

The type of the schema/property. The value MUST be one of "string", "number", "integer", "boolean", "array" or
-"object".

+

The type of the schema/property.
+
+The value MUST be one of "string", "number", "integer", "boolean", "array" or "object".

format : string|null

The extending format for the previously mentioned type. See Data Type Formats for further details.

items : OpenApi\Attributes\Items|null

Required if type is "array". Describes the type of items in the array.

collectionFormat : string|null

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.
@@ -64,30 +68,40 @@ Default value is csv.

maximum : int|float

The maximum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMaximum : bool|null
-

A boolean value indicating whether the maximum value specified in the maximum attribute is excluded from the set of valid values.
-If this attribute is set to true, then the maximum value is not included in the set of valid values.

See: JSON schema validation

+

A boolean indicating whether the maximum value is excluded from the set of valid values.
+
+When set to true, the maximum value is excluded, and when false or not specified, it is included.

See: JSON schema validation

minimum : int|float

The minimum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMinimum : bool|null
-

A boolean value indicating whether the minimum value specified in the minimum attribute is excluded from the set of valid values.
-If this attribute is set to true, then the minimum value is not included in the set of valid values.

See: JSON schema validation

+

A boolean indicating whether the minimum value is excluded from the set of valid values.
+
+When set to true, the minimum value is excluded, and when false or not specified, it is included.

See: JSON schema validation

maxLength : int|null
-

The maximum length of a string property. A string instance is valid against this property if its length is less than, or equal to, the value of this attribute.

See: JSON schema validation

+

The maximum length of a string property.
+
+A string instance is valid against this property if its length is less than, or equal to, the value of this attribute.

See: JSON schema validation

minLength : int|null
-

The minimum length of a string property. A string instance is valid against this property if its length is greater than, or equal to, the value of this attribute.

See: JSON schema validation

+

The minimum length of a string property.
+
+A string instance is valid against this property if its length is greater than, or equal to, the value of this attribute.

See: JSON schema validation

maxItems : int|null

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

See: JSON schema validation

minItems : int|null

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

See: JSON schema validation

uniqueItems : bool|null

A boolean value indicating whether all items in an array property must be unique.
+
If this attribute is set to true, then all items in the array must be unique.

See: JSON schema validation

pattern : string|null

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

enum : string[]|int[]|float[]|\UnitEnum[]|class-string

A collection of allowable values for a property.
+
A property instance is valid against this attribute if its value is one of the values specified in this collection.

See: JSON schema validation

discriminator : OpenApi\Attributes\Discriminator|null

Adds support for polymorphism.
@@ -983,16 +997,20 @@ An object instance is valid against this property if its number of properties is

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

properties : Property[]
-

A collection of properties to define for an object. Each property is represented as an instance of the Property class.

+

A collection of properties to define for an object.
+
+Each property is represented as an instance of the Property class.

type : string|null
-

The type of the schema/property. The value MUST be one of "string", "number", "integer", "boolean", "array" or
-"object".

+

The type of the schema/property.
+
+The value MUST be one of "string", "number", "integer", "boolean", "array" or "object".

format : string|null

The extending format for the previously mentioned type. See Data Type Formats for further details.

items : OpenApi\Attributes\Items|null

Required if type is "array". Describes the type of items in the array.

collectionFormat : string|null

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.
@@ -1006,30 +1024,40 @@ Default value is csv.

maximum : int|float

The maximum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMaximum : bool|null
-

A boolean value indicating whether the maximum value specified in the maximum attribute is excluded from the set of valid values.
-If this attribute is set to true, then the maximum value is not included in the set of valid values.

See: JSON schema validation

+

A boolean indicating whether the maximum value is excluded from the set of valid values.
+
+When set to true, the maximum value is excluded, and when false or not specified, it is included.

See: JSON schema validation

minimum : int|float

The minimum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMinimum : bool|null
-

A boolean value indicating whether the minimum value specified in the minimum attribute is excluded from the set of valid values.
-If this attribute is set to true, then the minimum value is not included in the set of valid values.

See: JSON schema validation

+

A boolean indicating whether the minimum value is excluded from the set of valid values.
+
+When set to true, the minimum value is excluded, and when false or not specified, it is included.

See: JSON schema validation

maxLength : int|null
-

The maximum length of a string property. A string instance is valid against this property if its length is less than, or equal to, the value of this attribute.

See: JSON schema validation

+

The maximum length of a string property.
+
+A string instance is valid against this property if its length is less than, or equal to, the value of this attribute.

See: JSON schema validation

minLength : int|null
-

The minimum length of a string property. A string instance is valid against this property if its length is greater than, or equal to, the value of this attribute.

See: JSON schema validation

+

The minimum length of a string property.
+
+A string instance is valid against this property if its length is greater than, or equal to, the value of this attribute.

See: JSON schema validation

maxItems : int|null

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

See: JSON schema validation

minItems : int|null

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

See: JSON schema validation

uniqueItems : bool|null

A boolean value indicating whether all items in an array property must be unique.
+
If this attribute is set to true, then all items in the array must be unique.

See: JSON schema validation

pattern : string|null

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

enum : string[]|int[]|float[]|\UnitEnum[]|class-string

A collection of allowable values for a property.
+
A property instance is valid against this attribute if its value is one of the values specified in this collection.

See: JSON schema validation

discriminator : OpenApi\Attributes\Discriminator|null

Adds support for polymorphism.
@@ -1103,7 +1131,9 @@ These will be ignored but can be used for custom processing.

---
examples : array<string,Examples>
-

An associative array of Examples attributes. The keys represent the name of the example and the values are instances of the Examples attribute.
+

An associative array of Examples attributes.
+
+The keys represent the name of the example and the values are instances of the Examples attribute.
Each example is used to show how the content of the request or response should look like.

ref : string|class-string|object|null

The relative or absolute path to the endpoint.

See: Using refs

@@ -1125,16 +1155,20 @@ An object instance is valid against this property if its number of properties is

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

properties : Property[]
-

A collection of properties to define for an object. Each property is represented as an instance of the Property class.

+

A collection of properties to define for an object.
+
+Each property is represented as an instance of the Property class.

type : string|null
-

The type of the schema/property. The value MUST be one of "string", "number", "integer", "boolean", "array" or
-"object".

+

The type of the schema/property.
+
+The value MUST be one of "string", "number", "integer", "boolean", "array" or "object".

format : string|null

The extending format for the previously mentioned type. See Data Type Formats for further details.

items : OpenApi\Attributes\Items|null

Required if type is "array". Describes the type of items in the array.

collectionFormat : string|null

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.
@@ -1148,30 +1182,40 @@ Default value is csv.

maximum : int|float

The maximum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMaximum : bool|null
-

A boolean value indicating whether the maximum value specified in the maximum attribute is excluded from the set of valid values.
-If this attribute is set to true, then the maximum value is not included in the set of valid values.

See: JSON schema validation

+

A boolean indicating whether the maximum value is excluded from the set of valid values.
+
+When set to true, the maximum value is excluded, and when false or not specified, it is included.

See: JSON schema validation

minimum : int|float

The minimum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMinimum : bool|null
-

A boolean value indicating whether the minimum value specified in the minimum attribute is excluded from the set of valid values.
-If this attribute is set to true, then the minimum value is not included in the set of valid values.

See: JSON schema validation

+

A boolean indicating whether the minimum value is excluded from the set of valid values.
+
+When set to true, the minimum value is excluded, and when false or not specified, it is included.

See: JSON schema validation

maxLength : int|null
-

The maximum length of a string property. A string instance is valid against this property if its length is less than, or equal to, the value of this attribute.

See: JSON schema validation

+

The maximum length of a string property.
+
+A string instance is valid against this property if its length is less than, or equal to, the value of this attribute.

See: JSON schema validation

minLength : int|null
-

The minimum length of a string property. A string instance is valid against this property if its length is greater than, or equal to, the value of this attribute.

See: JSON schema validation

+

The minimum length of a string property.
+
+A string instance is valid against this property if its length is greater than, or equal to, the value of this attribute.

See: JSON schema validation

maxItems : int|null

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

See: JSON schema validation

minItems : int|null

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

See: JSON schema validation

uniqueItems : bool|null

A boolean value indicating whether all items in an array property must be unique.
+
If this attribute is set to true, then all items in the array must be unique.

See: JSON schema validation

pattern : string|null

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

enum : string[]|int[]|float[]|\UnitEnum[]|class-string

A collection of allowable values for a property.
+
A property instance is valid against this attribute if its value is one of the values specified in this collection.

See: JSON schema validation

discriminator : OpenApi\Attributes\Discriminator|null

Adds support for polymorphism.
@@ -1975,16 +2019,20 @@ An object instance is valid against this property if its number of properties is

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

properties : Property[]
-

A collection of properties to define for an object. Each property is represented as an instance of the Property class.

+

A collection of properties to define for an object.
+
+Each property is represented as an instance of the Property class.

type : string|null
-

The type of the schema/property. The value MUST be one of "string", "number", "integer", "boolean", "array" or
-"object".

+

The type of the schema/property.
+
+The value MUST be one of "string", "number", "integer", "boolean", "array" or "object".

format : string|null

The extending format for the previously mentioned type. See Data Type Formats for further details.

items : OpenApi\Attributes\Items|null

Required if type is "array". Describes the type of items in the array.

collectionFormat : string|null

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.
@@ -1998,30 +2046,40 @@ Default value is csv.

maximum : int|float

The maximum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMaximum : bool|null
-

A boolean value indicating whether the maximum value specified in the maximum attribute is excluded from the set of valid values.
-If this attribute is set to true, then the maximum value is not included in the set of valid values.

See: JSON schema validation

+

A boolean indicating whether the maximum value is excluded from the set of valid values.
+
+When set to true, the maximum value is excluded, and when false or not specified, it is included.

See: JSON schema validation

minimum : int|float

The minimum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMinimum : bool|null
-

A boolean value indicating whether the minimum value specified in the minimum attribute is excluded from the set of valid values.
-If this attribute is set to true, then the minimum value is not included in the set of valid values.

See: JSON schema validation

+

A boolean indicating whether the minimum value is excluded from the set of valid values.
+
+When set to true, the minimum value is excluded, and when false or not specified, it is included.

See: JSON schema validation

maxLength : int|null
-

The maximum length of a string property. A string instance is valid against this property if its length is less than, or equal to, the value of this attribute.

See: JSON schema validation

+

The maximum length of a string property.
+
+A string instance is valid against this property if its length is less than, or equal to, the value of this attribute.

See: JSON schema validation

minLength : int|null
-

The minimum length of a string property. A string instance is valid against this property if its length is greater than, or equal to, the value of this attribute.

See: JSON schema validation

+

The minimum length of a string property.
+
+A string instance is valid against this property if its length is greater than, or equal to, the value of this attribute.

See: JSON schema validation

maxItems : int|null

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

See: JSON schema validation

minItems : int|null

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

See: JSON schema validation

uniqueItems : bool|null

A boolean value indicating whether all items in an array property must be unique.
+
If this attribute is set to true, then all items in the array must be unique.

See: JSON schema validation

pattern : string|null

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

enum : string[]|int[]|float[]|\UnitEnum[]|class-string

A collection of allowable values for a property.
+
A property instance is valid against this attribute if its value is one of the values specified in this collection.

See: JSON schema validation

discriminator : OpenApi\Attributes\Discriminator|null

Adds support for polymorphism.
@@ -2407,16 +2465,20 @@ An object instance is valid against this property if its number of properties is

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

properties : Property[]
-

A collection of properties to define for an object. Each property is represented as an instance of the Property class.

+

A collection of properties to define for an object.
+
+Each property is represented as an instance of the Property class.

type : string|null
-

The type of the schema/property. The value MUST be one of "string", "number", "integer", "boolean", "array" or
-"object".

+

The type of the schema/property.
+
+The value MUST be one of "string", "number", "integer", "boolean", "array" or "object".

format : string|null

The extending format for the previously mentioned type. See Data Type Formats for further details.

items : OpenApi\Attributes\Items|null

Required if type is "array". Describes the type of items in the array.

collectionFormat : string|null

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.
@@ -2430,30 +2492,40 @@ Default value is csv.

maximum : int|float

The maximum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMaximum : bool|null
-

A boolean value indicating whether the maximum value specified in the maximum attribute is excluded from the set of valid values.
-If this attribute is set to true, then the maximum value is not included in the set of valid values.

See: JSON schema validation

+

A boolean indicating whether the maximum value is excluded from the set of valid values.
+
+When set to true, the maximum value is excluded, and when false or not specified, it is included.

See: JSON schema validation

minimum : int|float

The minimum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMinimum : bool|null
-

A boolean value indicating whether the minimum value specified in the minimum attribute is excluded from the set of valid values.
-If this attribute is set to true, then the minimum value is not included in the set of valid values.

See: JSON schema validation

+

A boolean indicating whether the minimum value is excluded from the set of valid values.
+
+When set to true, the minimum value is excluded, and when false or not specified, it is included.

See: JSON schema validation

maxLength : int|null
-

The maximum length of a string property. A string instance is valid against this property if its length is less than, or equal to, the value of this attribute.

See: JSON schema validation

+

The maximum length of a string property.
+
+A string instance is valid against this property if its length is less than, or equal to, the value of this attribute.

See: JSON schema validation

minLength : int|null
-

The minimum length of a string property. A string instance is valid against this property if its length is greater than, or equal to, the value of this attribute.

See: JSON schema validation

+

The minimum length of a string property.
+
+A string instance is valid against this property if its length is greater than, or equal to, the value of this attribute.

See: JSON schema validation

maxItems : int|null

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

See: JSON schema validation

minItems : int|null

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

See: JSON schema validation

uniqueItems : bool|null

A boolean value indicating whether all items in an array property must be unique.
+
If this attribute is set to true, then all items in the array must be unique.

See: JSON schema validation

pattern : string|null

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

enum : string[]|int[]|float[]|\UnitEnum[]|class-string

A collection of allowable values for a property.
+
A property instance is valid against this attribute if its value is one of the values specified in this collection.

See: JSON schema validation

discriminator : OpenApi\Attributes\Discriminator|null

Adds support for polymorphism.
@@ -2841,16 +2913,20 @@ An object instance is valid against this property if its number of properties is

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

properties : Property[]
-

A collection of properties to define for an object. Each property is represented as an instance of the Property class.

+

A collection of properties to define for an object.
+
+Each property is represented as an instance of the Property class.

type : string|null
-

The type of the schema/property. The value MUST be one of "string", "number", "integer", "boolean", "array" or
-"object".

+

The type of the schema/property.
+
+The value MUST be one of "string", "number", "integer", "boolean", "array" or "object".

format : string|null

The extending format for the previously mentioned type. See Data Type Formats for further details.

items : OpenApi\Attributes\Items|null

Required if type is "array". Describes the type of items in the array.

collectionFormat : string|null

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.
@@ -2864,30 +2940,40 @@ Default value is csv.

maximum : int|float

The maximum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMaximum : bool|null
-

A boolean value indicating whether the maximum value specified in the maximum attribute is excluded from the set of valid values.
-If this attribute is set to true, then the maximum value is not included in the set of valid values.

See: JSON schema validation

+

A boolean indicating whether the maximum value is excluded from the set of valid values.
+
+When set to true, the maximum value is excluded, and when false or not specified, it is included.

See: JSON schema validation

minimum : int|float

The minimum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMinimum : bool|null
-

A boolean value indicating whether the minimum value specified in the minimum attribute is excluded from the set of valid values.
-If this attribute is set to true, then the minimum value is not included in the set of valid values.

See: JSON schema validation

+

A boolean indicating whether the minimum value is excluded from the set of valid values.
+
+When set to true, the minimum value is excluded, and when false or not specified, it is included.

See: JSON schema validation

maxLength : int|null
-

The maximum length of a string property. A string instance is valid against this property if its length is less than, or equal to, the value of this attribute.

See: JSON schema validation

+

The maximum length of a string property.
+
+A string instance is valid against this property if its length is less than, or equal to, the value of this attribute.

See: JSON schema validation

minLength : int|null
-

The minimum length of a string property. A string instance is valid against this property if its length is greater than, or equal to, the value of this attribute.

See: JSON schema validation

+

The minimum length of a string property.
+
+A string instance is valid against this property if its length is greater than, or equal to, the value of this attribute.

See: JSON schema validation

maxItems : int|null

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

See: JSON schema validation

minItems : int|null

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

See: JSON schema validation

uniqueItems : bool|null

A boolean value indicating whether all items in an array property must be unique.
+
If this attribute is set to true, then all items in the array must be unique.

See: JSON schema validation

pattern : string|null

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

enum : string[]|int[]|float[]|\UnitEnum[]|class-string

A collection of allowable values for a property.
+
A property instance is valid against this attribute if its value is one of the values specified in this collection.

See: JSON schema validation

discriminator : OpenApi\Attributes\Discriminator|null

Adds support for polymorphism.
diff --git a/src/Annotations/JsonContent.php b/src/Annotations/JsonContent.php index c28acad1e..357db5ce6 100644 --- a/src/Annotations/JsonContent.php +++ b/src/Annotations/JsonContent.php @@ -18,7 +18,9 @@ class JsonContent extends Schema { /** - * An associative array of Examples attributes. The keys represent the name of the example and the values are instances of the Examples attribute. + * An associative array of Examples attributes. + * + * The keys represent the name of the example and the values are instances of the Examples attribute. * Each example is used to show how the content of the request or response should look like. * * @var array diff --git a/src/Annotations/Schema.php b/src/Annotations/Schema.php index 9d19e8c66..a0ab624af 100644 --- a/src/Annotations/Schema.php +++ b/src/Annotations/Schema.php @@ -80,15 +80,18 @@ class Schema extends AbstractAnnotation public $required = Generator::UNDEFINED; /** - * A collection of properties to define for an object. Each property is represented as an instance of the Property class. + * A collection of properties to define for an object. + * + * Each property is represented as an instance of the Property class. * * @var Property[] */ public $properties = Generator::UNDEFINED; /** - * The type of the schema/property. The value MUST be one of "string", "number", "integer", "boolean", "array" or - * "object". + * The type of the schema/property. + * + * The value MUST be one of "string", "number", "integer", "boolean", "array" or "object". * * @var string */ @@ -110,6 +113,7 @@ class Schema extends AbstractAnnotation /** * 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. @@ -142,8 +146,9 @@ class Schema extends AbstractAnnotation public $maximum = Generator::UNDEFINED; /** - * A boolean value indicating whether the maximum value specified in the maximum attribute is excluded from the set of valid values. - * If this attribute is set to true, then the maximum value is not included in the set of valid values. + * A boolean indicating whether the maximum value is excluded from the set of valid values. + * + * When set to true, the maximum value is excluded, and when false or not specified, it is included. * * @see [JSON schema validation](http://json-schema.org/latest/json-schema-validation.html#anchor17) * @@ -161,8 +166,9 @@ class Schema extends AbstractAnnotation public $minimum = Generator::UNDEFINED; /** - * A boolean value indicating whether the minimum value specified in the minimum attribute is excluded from the set of valid values. - * If this attribute is set to true, then the minimum value is not included in the set of valid values. + * A boolean indicating whether the minimum value is excluded from the set of valid values. + * + * When set to true, the minimum value is excluded, and when false or not specified, it is included. * * @see [JSON schema validation](http://json-schema.org/latest/json-schema-validation.html#anchor21) * @@ -171,7 +177,9 @@ class Schema extends AbstractAnnotation public $exclusiveMinimum = Generator::UNDEFINED; /** - * The maximum length of a string property. A string instance is valid against this property if its length is less than, or equal to, the value of this attribute. + * The maximum length of a string property. + * + * A string instance is valid against this property if its length is less than, or equal to, the value of this attribute. * * @see [JSON schema validation](http://json-schema.org/latest/json-schema-validation.html#anchor26) * @@ -180,7 +188,9 @@ class Schema extends AbstractAnnotation public $maxLength = Generator::UNDEFINED; /** - * The minimum length of a string property. A string instance is valid against this property if its length is greater than, or equal to, the value of this attribute. + * The minimum length of a string property. + * + * A string instance is valid against this property if its length is greater than, or equal to, the value of this attribute. * * @see [JSON schema validation](http://json-schema.org/latest/json-schema-validation.html#anchor29) * @@ -197,6 +207,7 @@ class Schema extends AbstractAnnotation /** * The maximum number of items allowed in an array property. + * * An array instance is valid against this property if its number of items is less than, or equal to, the value of this attribute. * * @see [JSON schema validation](http://json-schema.org/latest/json-schema-validation.html#anchor42) @@ -207,6 +218,7 @@ class Schema extends AbstractAnnotation /** * The minimum number of items allowed in an array property. + * * An array instance is valid against this property if its number of items is greater than, or equal to, the value of this attribute. * * @see [JSON schema validation](http://json-schema.org/latest/json-schema-validation.html#anchor45) @@ -217,6 +229,7 @@ class Schema extends AbstractAnnotation /** * A boolean value indicating whether all items in an array property must be unique. + * * If this attribute is set to true, then all items in the array must be unique. * * @see [JSON schema validation](http://json-schema.org/latest/json-schema-validation.html#anchor49) @@ -227,6 +240,7 @@ class Schema extends AbstractAnnotation /** * A collection of allowable values for a property. + * * A property instance is valid against this attribute if its value is one of the values specified in this collection. * * @see [JSON schema validation](http://json-schema.org/latest/json-schema-validation.html#anchor76)