OpenApiMediaType Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Media Type Object.
public class OpenApiMediaType : Microsoft.OpenApi.IOpenApiExtensible, Microsoft.OpenApi.IOpenApiMediaType, Microsoft.OpenApi.IShallowCopyable<Microsoft.OpenApi.IOpenApiMediaType>
type OpenApiMediaType = class
interface IOpenApiSerializable
interface IOpenApiElement
interface IOpenApiExtensible
interface IOpenApiMediaType
interface IOpenApiReadOnlyExtensible
interface IShallowCopyable<IOpenApiMediaType>
interface IOpenApiReferenceable
Public Class OpenApiMediaType
Implements IOpenApiExtensible, IOpenApiMediaType, IShallowCopyable(Of IOpenApiMediaType)
- Inheritance
-
OpenApiMediaType
- Implements
Constructors
| Name | Description |
|---|---|
| OpenApiMediaType() |
Parameterless constructor |
| OpenApiMediaType(OpenApiMediaType) |
Initializes a copy of an OpenApiMediaType object |
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 |
Serialize OpenApiExternalDocs to Open Api v3.0. |
| 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. |
| SerializeAsV2(IOpenApiWriter) |
Serialize OpenApiMediaType to Open Api v2.0. |
| SerializeAsV3(IOpenApiWriter) |
Serialize OpenApiMediaType to Open Api v3.0. |
| SerializeAsV31(IOpenApiWriter) |
Serialize OpenApiMediaType to Open Api v3.1. |
| SerializeAsV32(IOpenApiWriter) |
Serialize OpenApiMediaType to Open Api v3.2. |
Extension Methods
| Name | Description |
|---|---|
| Validate(IOpenApiElement, ValidationRuleSet) |
Validate element and all child elements |