Package io.muserver.openapi
Class MediaTypeObjectBuilder
- java.lang.Object
-
- io.muserver.openapi.MediaTypeObjectBuilder
-
public class MediaTypeObjectBuilder extends java.lang.Object
Each 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 MediaTypeObject
build()
static MediaTypeObjectBuilder
mediaTypeObject()
Creates a builder for aMediaTypeObject
MediaTypeObjectBuilder
withEncoding(java.util.Map<java.lang.String,EncodingObject> encoding)
MediaTypeObjectBuilder
withExample(java.lang.Object example)
MediaTypeObjectBuilder
withExamples(java.util.Map<java.lang.String,ExampleObject> examples)
MediaTypeObjectBuilder
withSchema(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. Theexample
field is mutually exclusive of theexamples
field.- 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. Theexamples
field is mutually exclusive of theexample
field.- 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 torequestBody
objects when the media type ismultipart
orapplication/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
-
-