RedHatInsights / event-schemas

WIP consoledot CloudEvents schemas
Apache License 2.0
4 stars 10 forks source link
hacktoberfest

console.redhat.com CloudEvents

This repo contains jsonschema definitions for events generated by console.redhat.com apps.

Layout

Adding a new schema

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.

Updating an existing schema

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.

Docs

See https://redhatinsights.github.io/event-schemas/ for generated documentation. Documentation can be generated locally via scripts/update-docs.sh.

Libraries

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

cat examples/advisor.json | npm run validate
# or
npm run validate