Skip to main content

Data validation

To protect data integrity, JSON input is validated before a module processes it. The validator relies on JSON Schema, which defines strict rules on the structure and content of the data exchanged.

How it works​

  1. A module receives JSON data and submits it to the validator, with the name of the schema to apply.
  2. The validator looks up the schema by that name and checks the data against its constraints.
  3. If the data does not comply, the validator returns an error and the module does not process it.

Where schemas live​

Schemas are stored under the /jsonschema directory, with one subdirectory per module. Each module therefore owns and maintains its own validation rules. The name of a schema is the key the validator uses to find it.

Bean Validation​

New code written for Quarkus can also validate input with Bean Validation, through quarkus-hibernate-validator. It is being adopted progressively alongside JSON Schema.