RecordOps
Implicit methods for values of type Record
Value members
Concrete methods
Give a name to the schema
Give a name to the schema
- Encoder and decoder interpreters ignore the name,
- Documentation interpreters use that name to refer to this schema.
- Note:
Names are used by documentation interpreters to construct references and the JSON schema specification requires these to be valid URI's. Consider using
withTitle
if you just want to override the heading displayed in documentation.
Tag a schema for type A
with the given tag name
Tag a schema for type A
with the given tag name
This operation is usually used in conjunction with the orElse
operation
on the resulting Tagged
value, to define a schema that accepts several
alternatives, discriminated by a type tag.
- Encoder interpreters include a discriminator field to the JSON object
they produce. The name of the discriminator field is “type”, by default,
but can be customized by calling the
withDiscriminator
operation or by overriding thedefaultDiscriminatorName
operation of the traitJsonSchemas
, - Decoder interpreters validate that the discriminator field is present before validating the remaining fields of the object,
- Documentation interpreters produce a
oneOf
schema listing all the alternative schemas.
- Value parameters:
- tag
Tag name (e.g., "Rectangle", "Circle")
Merge the fields of recordA
with the fields of recordB
Merge the fields of recordA
with the fields of recordB
- Encoder interpreters produce a JSON object with the fields of both
recordA
andrecordB
, - Decoder interpreters validate the fields of
recordA
andrecordB
, - Documentation interpreters produce the schema of a JSON object
containing the properties of both
recordA
andrecordB
.