Skip to content

Commit

Permalink
[schema] Refine our schema definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
GochoMugo committed Nov 17, 2016
1 parent 1645ba4 commit 9cbc3b4
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions schema/definitions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

{
"$schema": "http://json-schema.org/schema#",
"$ref": "#/network",

"network": {
"type": "object",
Expand All @@ -23,22 +24,26 @@
"$ref": "#/ussd-code"
}
}
}
},
"required": ["name", "meta", "transactions", "ussd_codes"]
},

"metadata": {
"type": "object",
"properties": {
"spec": {
"type": "string"
"type": "string",
"pattern": "^[0-9].[0-9]$"
},
"date_updated": {
"$ref": "#/date"
},
"url": {
"type": "string"
"type": "string",
"format": "uri"
}
}
},
"required": ["spec", "date_updated", "url"]
},

"transaction": {
Expand All @@ -56,7 +61,8 @@
"amount_input": {
"type": "boolean"
}
}
},
"required": ["name", "classes"]
},

"class": {
Expand All @@ -77,7 +83,8 @@
"message": {
"type": "string"
}
}
},
"required": ["name"]
},

"range": {
Expand All @@ -92,11 +99,14 @@
"amount": {
"$ref": "#/cost"
}
}
},
"required": ["low", "high", "amount"]
},

"cost": {
"type": ["number", "string"]
"type": ["number", "string"],
"minimum": -2,
"pattern": "^[+-]Infinity$"
},

"ussd-code": {
Expand All @@ -108,15 +118,17 @@
"description": {
"type": "string"
}
}
},
"required": ["code", "description"]
},

"name": {
"type": "string"
},

"date": {
"type": "string"
"type": "string",
"format": "date"
},

"error": {
Expand Down

0 comments on commit 9cbc3b4

Please sign in to comment.