Skip to content

Instantly share code, notes, and snippets.

@gerep
Created October 28, 2016 12:21
Show Gist options
  • Save gerep/771b344d34a626a055c3b05b0545e288 to your computer and use it in GitHub Desktop.
Save gerep/771b344d34a626a055c3b05b0545e288 to your computer and use it in GitHub Desktop.
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array",
"items": {
"minItems": 1,
"type": "object",
"properties": {
"id": { "type": "integer" },
"name": { "type": "string" },
"type": {
"type": "object",
"required": [ "description" ],
"properties": {
"description": { "type": "string" }
}
},
"removed": { "type": "boolean" },
"suppliers": {
"type": "array",
"items": { "$ref": "#/definitions/supplier" },
"minItems": 1,
"uniqueItems": true
}
},
"required": [ "id", "name", "type", "removed", "suppliers" ]
},
"definitions": {
"supplier": {
"type": "object",
"properties": {
"id": { "type": "integer" },
"name": { "type": "string" },
"tradingName": { "type": "string" },
"cnpj": { "type": "string" },
"entityType": { "type": "string" },
"type": {
"type": "object",
"required": [ "description" ],
"properties": {
"description": { "type": "string" }
}
},
"address": {
"type": "object",
"required": [ "city", "state" ],
"properties": {
"city": { "type": "string" },
"state": { "type": "string" }
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment