Class Json5Serializer

All Implemented Interfaces:
Function<Object,String>, ThrowingFunction<Object,String>, JsonMetaProvider, ArrayRecordWritable, RecordWritable, TokenWritable
Direct Known Subclasses:
Json5Serializer.Readable

public class Json5Serializer extends JsonSerializer
Serializes POJO models to Simplified JSON.
Media types
Handles Accept types: application/json, text/json

Produces Content-Type types: application/json5

Description

This is a JSON serializer that uses simplified notation:

  • Lax quoting of JSON attribute names.
  • Single quotes.
Example output (Map of name/age):

{name:"Alice",age:30}

Complex (nested object + array):

{name:"Alice",age:30,address:{street:"123 Main St",city:"Boston",state:"MA"},tags:["a","b","c"]}

Notes:
  • This class is thread safe and reusable.
See Also: