RecordOps
Implicit methods for values of type Record
Attributes
- Graph
-
- Supertypes
Members list
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.
Attributes
- 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")
Attributes
Include a description of what this schema represents
Include a description of what this schema represents
- Encoder and decoder interpreters ignore this description,
- Documentation interpreters can show this description.
Value parameters
- description
-
information about the values described by the schema
Attributes
Include an example of value in this schema
Include an example of value in this schema
- Encoder and decoder interpreters ignore this value,
- Documentation interpreters can show this example value.
Value parameters
- example
-
Example value to attach to the schema
Attributes
Include a title for the schema
Include a title for the schema
- Encoder and decoder interpreters ignore the title,
- Documentation interpreters can show this title.
Value parameters
- title
-
short title to attach to the schema
Attributes
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
.