Creating an event schema in Amazon EventBridge
You create schemas by using JSON files with either the OpenAPI SpecificationCreateSchema
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
andformat
. -
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
After you have a new schema, you can download code bindings to help create applications for events with that schema.