api-morph / EncodingObject
Interface: EncodingObject
Defined in: src/types/openapi.ts:692
A single encoding definition applied to a single schema property.
See
https://spec.openapis.org/oas/v3.1.1#encoding-object
Indexable
[key
: `x-${string}`
]: any
This object MAY be extended with Specification Extensions.
Properties
allowReserved?
optional
allowReserved:boolean
Defined in: src/types/openapi.ts:738
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. The default value is false
. This field SHALL be ignored if the request body media type is not application/x-www-form-urlencoded
or multipart/form-data
. If a value is explicitly defined, then the value of contentType
(implicit or explicit) SHALL be ignored.
contentType?
optional
contentType:string
Defined in: src/types/openapi.ts:698
The Content-Type
for encoding a specific property. The value is a comma-separated list, each element of which is either a specific media type (e.g. image/png
) or a wildcard media type (e.g. image/*
). Default value depends on the property type as shown in the table below.
explode?
optional
explode:boolean
Defined in: src/types/openapi.ts:726
When this is true, property 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 properties 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. This field SHALL be ignored if the request body media type is not application/x-www-form-urlencoded
or multipart/form-data
. If a value is explicitly defined, then the value of contentType
(implicit or explicit) SHALL be ignored.
headers?
optional
headers:Record
<string
,ReferenceObject
|HeaderObject
>
Defined in: src/types/openapi.ts:704
A map allowing additional information to be provided as headers. Content-Type
is described separately and SHALL be ignored in this section. This field SHALL be ignored if the request body media type is not a multipart
.
style?
optional
style:"form"
|"spaceDelimited"
|"pipeDelimited"
|"deepObject"
Defined in: src/types/openapi.ts:715
Describes how a specific property value will be serialized depending on its type. See Parameter Object for details on the style
field. The behavior follows the same values as query
parameters, including default values. Note that the initial ?
used in query strings is not used in application/x-www-form-urlencoded
message bodies, and MUST be removed (if using an RFC6570 implementation) or simply not added (if constructing the string manually). This field SHALL be ignored if the request body media type is not application/x-www-form-urlencoded
or multipart/form-data
. If a value is explicitly defined, then the value of contentType
(implicit or explicit) SHALL be ignored.