Skip to content

api-morph / ParameterObject

Interface: ParameterObject

Defined in: src/types/openapi.ts:526

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

See

https://spec.openapis.org/oas/v3.1.1#parameter-object

Indexable

[key: `x-${string}`]: any

This object MAY be extended with Specification Extensions.

Properties

allowEmptyValue?

optional allowEmptyValue: boolean

Defined in: src/types/openapi.ts:569

If true, clients MAY pass a zero-length string value in place of parameters that would otherwise be omitted entirely, which the server SHOULD interpret as the parameter being unused. Default value is false. If style is used, and if behavior is n/a (cannot be serialized), the value of allowEmptyValue SHALL be ignored. Interactions between this field and the parameter's [Schema Object] (https://spec.openapis.org/oas/v3.1.1#schema-object) are implementation-defined. This field is valid only for query parameters. Use of this field is NOT RECOMMENDED, and it is likely to be removed in a later revision.


allowReserved?

optional allowReserved: boolean

Defined in: src/types/openapi.ts:596

When this is true, parameter values are serialized using reserved expansion, as defined by RFC6570, which allows RFC3986's reserved character set, as well as percent-encoded triples, to pass through unchanged, while still percent-encoding all other disallowed characters (including % outside of percent-encoded triples). Applications are still responsible for percent-encoding reserved characters that are not allowed in the query string ([, ], #), or have a special meaning in application/x-www-form-urlencoded (-, &, +); see Appendices C and E for details. This field only applies to parameters with an in value of query. The default value is false.


content?

optional content: Record<string, MediaTypeObject>

Defined in: src/types/openapi.ts:617

A map containing the representations for the parameter. The key is the media type and the value describes it. The map MUST only contain one entry.


deprecated?

optional deprecated: boolean

Defined in: src/types/openapi.ts:559

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


description?

optional description: string

Defined in: src/types/openapi.ts:547

A brief description of the parameter. This could contain examples of use. CommonMark syntax MAY be used for rich text representation.


example?

optional example: any

Defined in: src/types/openapi.ts:606

Example of the parameter's potential value; see Working With Examples.


examples?

optional examples: Record<string, ReferenceObject | ExampleObject>

Defined in: src/types/openapi.ts:611

Examples of the parameter's potential value; see Working With Examples.


explode?

optional explode: boolean

Defined in: src/types/openapi.ts:585

When this is true, parameter values of type array or object generate separate parameters for each value of the array or key-value pair of the map. For other types of parameters this field has no effect. When style is "form", the default value is true. For all other styles, the default value is false. Note that despite false being the default for deepObject, the combination of false with deepObject is undefined.


in

in: ParameterIn

Defined in: src/types/openapi.ts:541

REQUIRED. The location of the parameter. Possible values are "query", "header", "path" or "cookie".


name

name: string

Defined in: src/types/openapi.ts:536

REQUIRED. The name of the parameter. Parameter names are case sensitive.

  • If in is "path", the name field MUST correspond to a template expression occurring within the path field in the Paths Object. See Path Templating for further information.
  • If in is "header" and the name field is "Accept", "Content-Type" or "Authorization", the parameter definition SHALL be ignored.
  • For all other cases, the name corresponds to the parameter name used by the in field.

required?

optional required: boolean

Defined in: src/types/openapi.ts:554

Determines whether this parameter is mandatory. If the parameter location is "path", this field is REQUIRED and its value MUST be true. Otherwise, the field MAY be included and its default value is false.


schema?

optional schema: boolean | SchemaObject

Defined in: src/types/openapi.ts:601

The schema defining the type used for the parameter.


style?

optional style: ParameterStyle

Defined in: src/types/openapi.ts:576

Describes how the parameter value will be serialized depending on the type of the parameter value. Default values (based on value of in): for "query" - "form"; for "path" - "simple"; for "header" - "simple"; for "cookie" - "form".

基于 MIT 许可证发布