Schema Validation and Registry

Since version 0.2.0, FactCast can be configured to validate facts before publishing them. In order to do that, FactCast needs to have a Schema for the Namespace/Type/Version of a fact, that is expected to live in a schema registry. The schema registry is a static website, that is referenced by the property factcast.store.schema-registry-url. If no URL is provided, validation is skipped and FactCast behaves just like before.

Given, there is a SchemaRegistry configured, FactCast will (on startup, and regularly) fetch an index and crawl updated information.

The CLI and Maven plugin also build registry.zip beside index.json in static/registry. With factcast.store.schema-registry-zip-enabled=true, an HTTP(S) registry downloads this ZIP on startup and reads its schemas and transformations locally. Scheduled refreshes still use the individual files.

For that to work, the schema registry must follow a certain structure and naming convention. To make validating and building this static website easier and convenient, there is a tool factcast-schema-cli you can use. It turns raw data files (Json-Schema, markdown, example json payloads) into a nice, browsable website as well as generating the files needed for FactCast to discover new schema on the fly.

An example can be found here which is generated from the module 'factcast-examples/factcast-example-schema-registry/'.

See the Properties-Section on how to configure this.