Created
May 26, 2016 17:23
-
-
Save larribas/9d1d448bdc3b0e7beaa9021198426aaf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "http://json-schema.org/draft-04/schema#", | |
"title": "Event", | |
"description": "Shared schema for domain events", | |
"properties": { | |
"data": { | |
"description": "Arbitrary data detailing the event", | |
"type": "object" | |
}, | |
"id": { | |
"description": "The event's UUID", | |
"type": "string" | |
}, | |
"time": { | |
"description": "An explanation about the purpose of this instance.", | |
"title": "Time schema.", | |
"type": "string", | |
"format": "date-time" | |
}, | |
"type": { | |
"description": "The event's type", | |
"type": "string" | |
}, | |
"version": { | |
"description": "The version of the domain unit described by this event", | |
"type": "integer" | |
} | |
}, | |
"required": [ | |
"id", | |
"type", | |
"time", | |
"version", | |
"data" | |
], | |
"type": "object" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "http://json-schema.org/draft-04/schema#", | |
"title": "Event: user_changed_name", | |
"description": "Event that occurs when a user changes his/her name", | |
"properties": { | |
"meta": { | |
"$ref": "event.json", | |
"type": { | |
"type": "string", | |
"pattern": "^user_changed_name$" | |
} | |
}, | |
"data": { | |
"properties": { | |
"id": { | |
"description": "The UUID given to the user", | |
"type": "string" | |
}, | |
"name": { | |
"description": "The user's complete name", | |
"type": "string" | |
} | |
}, | |
"required": [ | |
"id", | |
"name" | |
], | |
"type": "object" | |
} | |
}, | |
"type": "object" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment