Share via


OpenApiMediaType Class

Definition

Media Type Object.

public class OpenApiMediaType : Microsoft.OpenApi.Interfaces.IOpenApiExtensible, Microsoft.OpenApi.Interfaces.IOpenApiSerializable
type OpenApiMediaType = class
    interface IOpenApiSerializable
    interface IOpenApiElement
    interface IOpenApiExtensible
Public Class OpenApiMediaType
Implements IOpenApiExtensible, IOpenApiSerializable
Inheritance
OpenApiMediaType
Implements

Constructors

OpenApiMediaType()

Parameterless constructor

OpenApiMediaType(OpenApiMediaType)

Initializes a copy of an OpenApiMediaType object

Properties

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.

Examples

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

Extensions

Serialize OpenApiExternalDocs to Open Api v3.0.

Schema

The schema defining the type used for the request body.

Methods

SerializeAsV2(IOpenApiWriter)

Serialize OpenApiMediaType to Open Api v2.0.

SerializeAsV3(IOpenApiWriter)

Serialize OpenApiMediaType to Open Api v3.0.

Extension Methods

Validate(IOpenApiElement, ValidationRuleSet)

Validate element and all child elements

Applies to