Skip to main content

Part Marshallers

Juneau comes with three basic marshaller types for serializing and parsing Header, Query, Form, and Path parts:

HttpPartSerializerSimplePartSerializer - Serializes directly to strings.UonSerializer - Serializes to UON notation.OpenApiSerializer - Serializes using OpenAPI schema rules.HttpPartParserSimplePartParser - Parses directly from strings.UonParser - Parses from UON notation.OpenApiParser - Parses using OpenAPI schema rules.

By default, the REST API uses the OpenAPI serializer and parser which allows for schema-based marshalling.

You also have the option to use UON marshalling which is schema-less but allows for JSON-equivalent data structures (object/array/primitives/...) using URL-encoding notation. This can be done by overriding the part marshallers through the following APIs:

RestpartSerializerpartParserRestContext.BuilderpartSerializer(HttpPartSerializer)partParser(HttpPartParser)

The OpenAPI marshallers themselves also have the ability to support UON notation for individual parts via the schema itself:

@Query(..., schema=@Schema(format="uon")) Map myMap