This repo contains jsonschema definitions for events generated by console.redhat.com apps.
schemas/events/v1/events.jsondefines the overall schema for all console.redhat.com CloudEvents. All apps SHOULD produce events matching this schema, with thedataproperty being app-specific. Thedataschemafield MUST be used to specify the schema ofdata.schemas/appscontains versioned subdirectories for each app's eventdataschemas.- e.g.
schemas/apps/advisor/v1contains advisor eventdataschema
- e.g.
schemas/corecontains 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 -> oneOf -> data / dataschema 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.
Libraries for multiple languages are generated using quicktype. Each one is keep on their own repository with it's own version.
All libraries should use dependabot to ensure we are using the latest version of this schema.
scripts/update-docs.shgenerates thedocs/index.htmland related files. If you do not runnpm installfirst, it will fallback to the asyncapi generator container image, which is slower than direct node usage, but functionally equivalent.npm run validatevalidates the whole schema. If any input is received, validates the overall JSON, else it runs the validation on all examples.
cat examples/advisor.json | npm run validate
# or
npm run validate