Skip to content

Instantly share code, notes, and snippets.

@afranzi
Created December 4, 2018 22:49
Show Gist options
  • Save afranzi/80adb6abd08f0ca3c8dbc64388d84788 to your computer and use it in GitHub Desktop.
Save afranzi/80adb6abd08f0ca3c8dbc64388d84788 to your computer and use it in GitHub Desktop.
Order event Schema
{
"$id": "/schema/event/order",
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"user": { "$ref": "/schema/object/user" },
"products": {
"type": "array",
"items": { "$ref": "/schema/object/product" }
},
"billing_address": { "$ref": "/schema/object/address" },
"shipping_address": {
"allOf": [
{ "$ref": "/schema/object/address" },
{
"properties": {
"type": { "enum": [ "residential","business" ] }
},
"required": [ "type" ]
}
]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment