Package io.muserver.openapi
Class EncodingObjectBuilder
- java.lang.Object
-
- io.muserver.openapi.EncodingObjectBuilder
-
public class EncodingObjectBuilder extends java.lang.Object
A single encoding definition applied to a single schema property.
-
-
Constructor Summary
Constructors Constructor Description EncodingObjectBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description EncodingObject
build()
static EncodingObjectBuilder
encodingObject()
Creates a builder for anEncodingObject
EncodingObjectBuilder
withAllowReserved(java.lang.Boolean allowReserved)
EncodingObjectBuilder
withContentType(java.lang.String contentType)
EncodingObjectBuilder
withExplode(java.lang.Boolean explode)
EncodingObjectBuilder
withHeaders(java.util.Map<java.lang.String,HeaderObject> headers)
EncodingObjectBuilder
withStyle(java.lang.String style)
-
-
-
Method Detail
-
withContentType
public EncodingObjectBuilder withContentType(java.lang.String contentType)
- Parameters:
contentType
- The Content-Type for encoding a specific property. Default value depends on the property type: forstring
withformat
beingbinary
–application/octet-stream
; for other primitive types –text/plain
; forobject
-application/json
; forarray
– the default is defined based on the inner type. The value can be a specific media type (e.g.application/json
), a wildcard media type (e.g.image/*
), or a comma-separated list of the two types.- Returns:
- The current builder
-
withHeaders
public EncodingObjectBuilder withHeaders(java.util.Map<java.lang.String,HeaderObject> headers)
- Parameters:
headers
- A map allowing additional information to be provided as headers, for exampleContent-Disposition
.Content-Type
is described separately and SHALL be ignored in this section. This property SHALL be ignored if the request body media type is not amultipart
.- Returns:
- The current builder
-
withStyle
public EncodingObjectBuilder withStyle(java.lang.String style)
- Parameters:
style
- Describes how a specific property value will be serialized depending on its type. SeeParameterObjectBuilder.withStyle(String)
for details on thestyle
property. The behavior follows the same values asquery
parameters, including default values. This property SHALL be ignored if the request body media type is notapplication/x-www-form-urlencoded
.- Returns:
- The current builder
-
withExplode
public EncodingObjectBuilder withExplode(java.lang.Boolean explode)
- Parameters:
explode
- When this is true, property values of typearray
orobject
generate separate parameters for each value of the array, or key-value-pair of the map. For other types of properties this property has no effect. Whenstyle
isform
, the default value istrue
. For all other styles, the default value isfalse
. This property SHALL be ignored if the request body media type is notapplication/x-www-form-urlencoded
.- Returns:
- The current builder
-
withAllowReserved
public EncodingObjectBuilder withAllowReserved(java.lang.Boolean allowReserved)
- Parameters:
allowReserved
- Determines whether the parameter value SHOULD allow reserved characters, as defined by RFC3986:/?#[]@!$&'()*+,;=
to be included without percent-encoding. The default value isfalse
. This property SHALL be ignored if the request body media type is notapplication/x-www-form-urlencoded
.- Returns:
- The current builder
-
build
public EncodingObject build()
- Returns:
- A new object
-
encodingObject
public static EncodingObjectBuilder encodingObject()
Creates a builder for anEncodingObject
- Returns:
- A new builder
-
-