Creating an Amazon EventBridge schema - Amazon EventBridge
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Creating an Amazon EventBridge schema

You create schemas by using JSON files with either the OpenAPI Specification or the JSONSchema Draft4 specification. You can create or upload your own schemas in EventBridge by using a template or generating a schema based on the JSON of an event. You can also infer the schema from events on an event bus. To create a schema by using the EventBridge Schema Registry API, use the CreateSchema API action.

When you choose between OpenAPI 3 and JSONSchema Draft4 formats, consider the following differences:

  • JSONSchema format supports additional keywords that aren't supported in OpenAPI, such as $schema, additionalItems.

  • There are minor differences in how keywords are handled, such as type and format.

  • OpenAPI doesn't support JSONSchema Hyper-Schema hyperlinks in JSON documents.

  • Tools for OpenAPI tend to focus on build-time, whereas tools for JSONSchema tend to focus on run-time operations, such as client tools for schema validation.

We recommend using JSONSchema format to implement client-side validation so that events sent to EventBridge conform to the schema. You can use JSONSchema to define a contract for valid JSON documents, and then use a JSON schema validator before sending the associated events.

After you have a new schema, you can download code bindings to help create applications for events with that schema.