# Uses of Interface
org.eclipse.microprofile.openapi.models.media.MediaType

Packages that use MediaType
Package
Description
org.eclipse.microprofile.openapi
A set of Java interfaces, annotations and programming models which allow Java developers to natively produce OpenAPI v3 documents from their JAX-RS applications.
org.eclipse.microprofile.openapi.models.media
A set of interfaces for programmable models to represent input and output data types and media types.

## Uses of MediaType in org.eclipse.microprofile.openapi

Methods in org.eclipse.microprofile.openapi that return MediaType
Modifier and Type
Method
Description
`static MediaType`
OASFactory.`createMediaType()`
This method creates a new `MediaType` instance.

## Uses of MediaType in org.eclipse.microprofile.openapi.models.media

Methods in org.eclipse.microprofile.openapi.models.media that return MediaType
Modifier and Type
Method
Description
`MediaType`
MediaType.`addEncoding(String key, Encoding encodingItem)`
Adds an Encoding item to the encoding property of a MediaType instance.
`MediaType`
MediaType.`addExample(String key, Example example)`
Adds an example item to the examples map of a MediaType instance.
`default MediaType`
MediaType.`encoding(Map<String,Encoding> encoding)`
Sets encoding property of a MediaType instance to the given map object.
`default MediaType`
MediaType.`example(Object example)`
Sets the example property of a MediaType instance to the given value.
`default MediaType`
MediaType.`examples(Map<String,Example> examples)`
Sets the examples field of a MediaType instance to the given map object.
`default MediaType`
Content.`getMediaType(String name)`
Returns a media type for a given name.
`default MediaType`
MediaType.`schema(Schema schema)`
Sets the schema field of a MediaType instance to the given schema object.
Methods in org.eclipse.microprofile.openapi.models.media that return types with arguments of type MediaType
Modifier and Type
Method
Description
`Map<String,MediaType>`
Content.`getMediaTypes()`
Returns a copy map (potentially immutable) of media types.
Methods in org.eclipse.microprofile.openapi.models.media with parameters of type MediaType
Modifier and Type
Method
Description
`Content`
Content.`addMediaType(String name, MediaType mediaType)`
Adds the MediaType for this Content, where the key is the name of the MediaType and the value is the object that describes the content passed into or returned from an operation.
Method parameters in org.eclipse.microprofile.openapi.models.media with type arguments of type MediaType
Modifier and Type
Method
Description
`void`
Content.`setMediaTypes(Map<String,MediaType> mediaTypes)`
Set the media types map to this Content