Skip to content

Implement JSON schema field constraints #215

Closed as not planned
Closed as not planned
@rlouf

Description

@rlouf

We can specify constraints for the different fields in the JSON schema specification. Only maxLength for strings is currently implemented. Remaining:

Strings

  • minLength
  • pattern

and the default formats that can be specified via the format keyword:

  • date-time
  • time
  • date
  • duration
  • email
  • idn-email
  • hostname
  • idn-hostname
  • ipv4
  • ipv6
  • uuid
  • uri
  • uri-reference
  • iri
  • iri-reference
  • uri-template
  • regex

Numeric types

  • multipleOf
  • minimum
  • exclusiveMinimum
  • maximum
  • exclusiveMaximum

Arrays

  • minItems
  • maxItems
  • uniqueItems (may only be applicable dynamically)
  • Set length

Tuples

See https://json-schema.org/understanding-json-schema/reference/array#tupleValidation

Required fields

We should handle optional fields as well, i.e. those not specified in the required field of the schema.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions