This repo contains jsonschema definitions for events generated by console.redhat.com apps.
schemas/events/v1/events.json
defines the overall schema for all console.redhat.com CloudEvents. All apps SHOULD produce events matching this schema, with thedata
property being app-specific. Thedataschema
field MUST be used to specify the schema ofdata
.schemas/apps
contains versioned subdirectories for each app's eventdata
schemas.- e.g.
schemas/apps/advisor/v1
contains advisor eventdata
schema
- e.g.
schemas/core
contains versioned event data schemas for common subjects (e.g. systems). An app may use a core schema during development, but will usually need its own schema to contain additional app-specific data.
If the subject is a common object across console.redhat.com, then it should be defined in the core
directory.
Any app-specific data should be defined in an app-specific schema in the apps
directory.
New schemas MUST be added to schemas/events/v1/events.json
-> data
-> oneOf
section.
Schemas SHOULD make liberal use of "additionalProperties": false
to enforce deliberate changes to
properties.
Updates SHOULD be backwards compatible. If a backwards incompatible change is needed, you must coordinate with consumers, and you SHOULD bump the version number for clarity.
See https://redhatinsights.github.io/event-schemas/ for generated documentation.
Documentation can be generated locally via scripts/update-docs.sh
.
scripts/update-docs.sh
generates thedocs/index.html
and related files. If you do not runnpm install
first, it will fallback to the asyncapi generator container image, which is slower than direct node usage, but functionally equivalent.scripts/validate.py
validates both the overall JSON, and that thedata
property validates against the specifieddataschema
. It requires the pythonjsonschema
package (dnf install python3-jsonschema
orpip install --user jsonschema
).
cat examples/advisor.json | python scripts/validate.py