Package io.muserver.openapi
Class MediaTypeObjectBuilder
- java.lang.Object
-
- io.muserver.openapi.MediaTypeObjectBuilder
-
public class MediaTypeObjectBuilder extends java.lang.ObjectEach Media Type Object provides schema and examples for the media type identified by its key.
-
-
Constructor Summary
Constructors Constructor Description MediaTypeObjectBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MediaTypeObjectbuild()static MediaTypeObjectBuildermediaTypeObject()Creates a builder for aMediaTypeObjectMediaTypeObjectBuilderwithEncoding(java.util.Map<java.lang.String,EncodingObject> encoding)MediaTypeObjectBuilderwithExample(java.lang.Object example)MediaTypeObjectBuilderwithExamples(java.util.Map<java.lang.String,ExampleObject> examples)MediaTypeObjectBuilderwithSchema(SchemaObject schema)
-
-
-
Method Detail
-
withSchema
public MediaTypeObjectBuilder withSchema(SchemaObject schema)
- Parameters:
schema- The schema defining the type used for the request body.- Returns:
- The current builder
-
withExample
public MediaTypeObjectBuilder withExample(java.lang.Object example)
- Parameters:
example- Example of the media type. The example object SHOULD be in the correct format as specified by the media type. Theexamplefield is mutually exclusive of theexamplesfield.- Returns:
- The current builder
-
withExamples
public MediaTypeObjectBuilder withExamples(java.util.Map<java.lang.String,ExampleObject> examples)
- Parameters:
examples- Examples of the media type. Each example object SHOULD match the media type and specified schema if present. Theexamplesfield is mutually exclusive of theexamplefield.- Returns:
- The current builder
-
withEncoding
public MediaTypeObjectBuilder withEncoding(java.util.Map<java.lang.String,EncodingObject> encoding)
- Parameters:
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 torequestBodyobjects when the media type ismultipartorapplication/x-www-form-urlencoded.- Returns:
- The current builder
-
build
public MediaTypeObject build()
- Returns:
- A new object
-
mediaTypeObject
public static MediaTypeObjectBuilder mediaTypeObject()
Creates a builder for aMediaTypeObject- Returns:
- A new builder
-
-