Skip to content

Instantly share code, notes, and snippets.

@mastahnish
Last active November 26, 2018 16:45
Show Gist options
  • Save mastahnish/a08590478be57662fa1448047832545a to your computer and use it in GitHub Desktop.
Save mastahnish/a08590478be57662fa1448047832545a to your computer and use it in GitHub Desktop.
{
"definitions": {},
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://example.com/root.json",
"type": "object",
"title": "The Root Schema",
"required": [
"isOpen",
"order_time_start",
"order_time_finish",
"order_value_min",
"payment_options",
"zones"
],
"properties": {
"isOpen": {
"$id": "#/properties/isOpen",
"type": "boolean",
"description": "Declaring if restaurant is open or closed.",
"default": false,
"examples": [
false
]
},
"order_time_start": {
"$id": "#/properties/order_time_start",
"type": "string",
"description": "godzina od której można zamawiać",
"default": "",
"examples": [
"09:00"
],
"pattern": "^(.*)$"
},
"order_time_finish": {
"$id": "#/properties/order_time_finish",
"type": "string",
"description": "godzina do której można zamawiać",
"default": "",
"examples": [
"23:00"
],
"pattern": "^(.*)$"
},
"order_value_min": {
"$id": "#/properties/order_value_min",
"type": "string",
"title": "The Order_value_min Schema",
"default": "",
"examples": [
"12.99"
],
"pattern": "^(.*)$"
},
"payment_options": {
"$id": "#/properties/payment_options",
"type": "integer",
"description": "dozwolone sposoby zapłaty: //1(001)-gotówka, 2(010)-karta, 3(011)- gotówka i karta, 4(100)-internet, 7(111)-gotówka i karta i internet ",
"default": 0,
"examples": [
3
]
},
"zones": {
"$id": "#/properties/zones",
"type": "array",
"title": "The Zones Schema",
"description": "List of zones",
"default": null,
"items": {
"$id": "#/properties/zones/items",
"type": "object",
"title": "The Items Schema",
"required": [
"zone_id",
"zone_range",
"delivery_cost",
"order_value_max",
"delivery_cost_bonus"
],
"properties": {
"zone_id": {
"$id": "#/properties/zones/items/properties/zone_id",
"type": "integer",
"description": "Id of the zone",
"default": 0,
"examples": [
1
]
},
"zone_range": {
"$id": "#/properties/zones/items/properties/zone_range",
"type": "string",
"description": "Wide description with names of streets",
"default": "",
"examples": [
"Stary Konin, Osiedla II, III, IV, V, Zatorze, Nies\\u0142usz, Chorze\\u0144, Morzys\\u0142aw, Wilk\\u00f"
],
"pattern": "^(.*)$"
},
"delivery_cost": {
"$id": "#/properties/zones/items/properties/delivery_cost",
"type": "string",
"description": "Delivery cost for a particular zone",
"default": "",
"examples": [
"12.99"
],
"pattern": "^(.*)$"
},
"order_value_max": {
"$id": "#/properties/zones/items/properties/order_value_max",
"type": "string",
"title": "",
"description": "Wartość po przekroczeniu której koszt dostawy = \"delivery_cost_bonus\"",
"default": "",
"examples": [
"150.00"
],
"pattern": "^(.*)$"
},
"delivery_cost_bonus": {
"$id": "#/properties/zones/items/properties/delivery_cost_bonus",
"type": "string",
"description": "Koszt dostawy po przekroczeniu \"order_value_max\"",
"default": "",
"examples": [
"2.00"
],
"pattern": "^(.*)$"
}
}
}
}
}
}
{
"isOpen": false,
"order_time_start": "09:00",
"order_time_finish": "23:00",
"order_value_min": "12.99",
"payment_options": 3,
"zones": [
{
"zone_id": 1,
"zone_range": "dozwolone sposoby zapłaty: //1(001)-gotówka, 2(010)-karta, 3(011)- gotówka i karta, 4(100)-internet, 7(111)-gotówka i karta i internet ",
"delivery_cost": "12.99",
"order_value_max": "150.00",
"delivery_cost_bonus": "0.00"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment