grim/resticide

Lots of tweaks to the schema
develop
2015-11-05, Gary Kramlich
eac0cf79de6d
Parents 6ca22ce9fc92
Children 940c4cf5c4fb
Lots of tweaks to the schema
--- a/assets/schema.json Wed Nov 04 22:12:45 2015 -0600
+++ b/assets/schema.json Thu Nov 05 20:53:51 2015 -0600
@@ -1,40 +1,65 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"definitions": {
+ "headers": {
+ "type": "object",
+ "additionalProperties": {"type": "string"}
+ },
+ "body": {
+ "type": "string"
+ },
+ "json-schema": {
+ "type": "object",
+ "additionalProperties": true
+ },
"response": {
"type": "object",
"properties": {
- "statuscode": {"type": "number"}
+ "statuscode": {"type": "integer"},
+ "headers": {"$ref": "#/definitions/headers"},
+ "body": {"$ref": "#/definitions/body"},
+ "json-schema": {"$ref": "#/definitions/json-schema"}
},
- "required": ["statuscode"],
+ "anyOf": [{
+ "required": ["statuscode", "body"]
+ }, {
+ "required": ["status_code", "json-schema"]
+ }, {
+ "required": ["statuscode"]
+ }],
"additionalProperties": false
},
- "request": {
- "type": "object",
+ "request": {
+ "type": "object",
"properties": {
"path": {"type": "string"},
- "method": {"type": "string"},
- "response": {"$ref": "#/response"},
- "headers": {
- "type": "object"
- }
+ "query": {"type": "object"},
+ "headers": {"$ref": "#/definitions/headers"},
+ "method": {
+ "type": "string"
+ },
+ "body": {"$ref": "#/definitions/body"},
+ "response": {"$ref": "#/definitions/response"}
},
- "required": ["path", "method", "response"],
+ "required": ["path", "response"],
"additionalProperties": false
},
"requests": {
"type": "array",
- "items": {"$ref": "#/request"}
+ "items": {"$ref": "#/definitions/request"}
}
},
"type": "object",
+ "additionalProperties": false,
"properties": {
"name": {"type": "string"},
- "$ref": {"type": "string"}
+ "request": {"$ref": "#/definitions/request"},
+ "requests": {"$ref": "#/definitions/requests"}
},
"oneOf": [{
- "required": ["request", "name"]
+ "required": ["name", "request"]
}, {
- "required": ["requests", "name"]
+ "required": ["name", "requests"]
}]
}
+