For unions declared in a typeref, gets the typeref schema.
Reads a record template from a JSON string.
Reads a record template from a JSON string.
org.coursera.courier.templates.DataValidationException
if validation fails.
Reads a union template from a JSON string.
Reads a union template from a JSON string.
org.coursera.courier.templates.DataValidationException
if validation fails.
Provides methods for serializing and deserializing the Pegasus data types used by Courier to JSON.
This uses org.coursera.pegasus.TypedDefinitionCodec, the default codec for use with Courier at Coursera.
For example, given a generated Courier data binding class named
Profile
, to serialize the Courier data binding class (a.k.a. data template) to JSON:val profile = Profile(...) val jsonString = CourierSerializer.write(profile)
And to Deserialize JSON to the Courier data binding:
val profile = CourierSerializer.read[Profile](jsonString)