Share via


IOpenApiMediaType Interface

Definition

Defines the base properties for the media type object. This interface is provided for type assertions but should not be implemented by package consumers beyond automatic mocking.

public interface IOpenApiMediaType : Microsoft.OpenApi.IOpenApiReadOnlyExtensible, Microsoft.OpenApi.IOpenApiReferenceable, Microsoft.OpenApi.IShallowCopyable<Microsoft.OpenApi.IOpenApiMediaType>
type IOpenApiMediaType = interface
    interface IOpenApiReadOnlyExtensible
    interface IShallowCopyable<IOpenApiMediaType>
    interface IOpenApiReferenceable
    interface IOpenApiSerializable
    interface IOpenApiElement
Public Interface IOpenApiMediaType
Implements IOpenApiReadOnlyExtensible, IOpenApiReferenceable, IShallowCopyable(Of IOpenApiMediaType)
Derived
Implements

Properties

Name Description
Encoding

A map between a property name and its encoding information. The key, being the property name, MUST exist in the schema as a property. The encoding object SHALL only apply to requestBody objects when the media type is multipart or application/x-www-form-urlencoded.

Example

Example of the media type. The example object SHOULD be in the correct format as specified by the media type. You must use the IsJsonNullSentinel(JsonNode) method to check whether Default was assigned a null value in the document. Assign JsonNull to use get null as a serialized value.

Examples

Examples of the media type. Each example object SHOULD match the media type and specified schema if present.

Extensions

Specification extensions.

(Inherited from IOpenApiReadOnlyExtensible)
ItemEncoding

An encoding object for items in an array schema. Only applies when the schema is of type array.

ItemSchema

The schema defining the type used for the items in an array media type. This property is only applicable for OAS 3.2.0 and later.

PrefixEncoding

An array of encoding objects for prefixItems in an array schema. Each element corresponds to a prefixItem in the schema.

Schema

The schema defining the type used for the request body.

Methods

Name Description
CreateShallowCopy()

Create a shallow copy of the current instance.

(Inherited from IShallowCopyable<T>)
SerializeAsV2(IOpenApiWriter)

Serialize Open API element to v2.0.

(Inherited from IOpenApiSerializable)
SerializeAsV3(IOpenApiWriter)

Serialize Open API element to v3.0.

(Inherited from IOpenApiSerializable)
SerializeAsV31(IOpenApiWriter)

Serialize OpenAPI element into v3.1

(Inherited from IOpenApiSerializable)
SerializeAsV32(IOpenApiWriter)

Serialize OpenAPI element into v3.2

(Inherited from IOpenApiSerializable)

Extension Methods

Name Description
Validate(IOpenApiElement, ValidationRuleSet)

Validate element and all child elements

Applies to