import type { EncodingObject } from './encoding.js' import type { ExampleObject } from './example.js' import type { ReferenceObject } from './reference.js' import type { SchemaObject } from './schema.js' /** * Media Type object * * Each Media Type Object describes content structured in accordance with the media type identified by its key. Multiple Media Type Objects can be used to describe content that can appear in any of several different media types. When `example` or `examples` are provided, the example SHOULD match the specified schema and be in the correct format as specified by the media type and its encoding. The `example` and `examples` fields are mutually exclusive. See [Working With Examples](#working-with-examples) for further guidance regarding the different ways of specifying examples, including non-JSON/YAML values. * * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.2.0.md#media-type-object} */ export type MediaTypeObject = { /** Example of the media type; see [Working With Examples](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.2.0.md#working-with-examples). */ example?: unknown /** Examples of the media type; see [Working With Examples](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.2.0.md#working-with-examples). */ examples?: Record description?: string /** A schema describing the complete content of the request, response, parameter, or header. */ schema?: SchemaObject | ReferenceObject /** A schema describing each item within a [sequential media type](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.2.0.md#sequential-media-types). */ itemSchema?: SchemaObject | ReferenceObject /** A map between a property name and its encoding information, as defined under [Encoding By Name](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.2.0.md#encoding-by-name). The `encoding` field SHALL only apply when the media type is `multipart` or `application/x-www-form-urlencoded`. If no Encoding Object is provided for a property, the behavior is determined by the default values documented for the Encoding Object. This field MUST NOT be present if `prefixEncoding` or `itemEncoding` are present. */ encoding?: Record /** An array of positional encoding information, as defined under [Encoding By Position](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.2.0.md#encoding-by-position). The `prefixEncoding` field SHALL only apply when the media type is `multipart`. If no Encoding Object is provided for a property, the behavior is determined by the default values documented for the Encoding Object. This field MUST NOT be present if `encoding` is present. */ prefixEncoding?: EncodingObject[] /** A single Encoding Object that provides encoding information for multiple array items, as defined under [Encoding By Position](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.2.0.md#encoding-by-position). The `itemEncoding` field SHALL only apply when the media type is `multipart`. If no Encoding Object is provided for a property, the behavior is determined by the default values documented for the Encoding Object. This field MUST NOT be present if `encoding` is present. */ itemEncoding?: EncodingObject }