├── CREDITS ├── README.md ├── avro └── avro-schema.json ├── geojson ├── bbox.json ├── crs.json ├── geojson.json └── geometry.json ├── json-home └── json-home.json ├── json-patch └── json-patch.json ├── json-stat └── json-stat.json ├── jsonrpc2.0 ├── jsonrpc-request-2.0.json └── jsonrpc-response-2.0.json ├── smd ├── smd-service.json └── smd.json └── swagger ├── apiDeclaration.json ├── authorizationObject.json ├── dataType.json ├── dataTypeBase.json ├── infoObject.json ├── modelsObject.json ├── oauth2GrantType.json ├── operationObject.json ├── parameterObject.json ├── resourceListing.json └── resourceObject.json /CREDITS: -------------------------------------------------------------------------------- 1 | Matthew Morley (https://github.com/mpcm): 2 | - Fixes to the JSON RPC 2.0 schemas. 3 | 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

What this repository is

2 | 3 |

This repository contains sample JSON Schemas for various JSON-based formats found around the 4 | web.

5 | 6 |

There are many such formats, and this repository contains schemas for whatever formats I happened 7 | to stumble upon.

8 | 9 |

Existing schemas in this repository

10 | 11 |

This repository contains schemas for the following:

12 | 13 | 30 | 31 |

Note: these schemas are probably not perfect. See below.

32 | 33 |

How these schemas are written and tested

34 | 35 |

I use my toy site to check both the 36 | validity of the schema syntax, and the validation of data against these schemas.

37 | 38 |

This site uses my library, which I am 39 | fully confident about. But I am not that confident about the schemas themselves.

40 | 41 |

I have read the relevant specifications, but I certainly have missed some points in them, 42 | and as a result these schemas may not be accurate. Not to mention that some constraints expressed 43 | by these specifications are not enforceable by JSON Schema.

44 | 45 |

Requests and contributions

46 | 47 |

Both are welcome:

48 | 49 | 59 | 60 |

Licensing conditions

61 | 62 |

The licensing conditions are the same as they are for JSON Schema itself: content in this 63 | repository may be licensed under either of the AFL or BSD license.

64 | 65 | -------------------------------------------------------------------------------- /avro/avro-schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "avro-schema", 4 | "description": "JSON Schema for an Apache Avro schema, version 1.7.3", 5 | "oneOf": [ 6 | { "type": "string" }, 7 | { 8 | "type": "object", 9 | "required": [ "type" ], 10 | "properties": { 11 | "type": { "$ref": "#/definitions/primitiveTypes" } 12 | } 13 | }, 14 | { "$ref": "#/definitions/record" }, 15 | { "$ref": "#/definitions/enum" }, 16 | { "$ref": "#/definitions/array" }, 17 | { "$ref": "#/definitions/map" }, 18 | { "$ref": "#/definitions/union" }, 19 | { "$ref": "#/definitions/fixed" } 20 | ], 21 | "definitions": { 22 | "primitiveTypes": { 23 | "description": "One primitive type", 24 | "enum": [ "null", "boolean", "int", "long", "float", "double", "bytes", "string" ] 25 | }, 26 | "record": { 27 | "description": "A record", 28 | "type": "object", 29 | "required": [ "type", "name", "fields" ], 30 | "properties": { 31 | "type": { "enum": [ "record" ] }, 32 | "name": { "$ref": "#/definitions/nameOrNamespace" }, 33 | "nameOrNamespace": { "$ref": "#/definitions/namespace" }, 34 | "doc": { "type": "string" }, 35 | "aliases": { "$ref": "#/definitions/aliases" }, 36 | "fields": { 37 | "type": "array", 38 | "items": { "$ref": "#/definitions/field" } 39 | } 40 | } 41 | }, 42 | "enum": { 43 | "description": "an enum as defined by the Avro specification", 44 | "type": "object", 45 | "required": [ "type", "name", "symbols" ], 46 | "properties": { 47 | "type": { "enum": [ "enum" ] }, 48 | "name": { "$ref": "#/definitions/nameOrNamespace" }, 49 | "nameOrNamespace": { "$ref": "#/definitions/namespace" }, 50 | "aliases": { "$ref": "#/definitions/aliases" }, 51 | "doc": { "type": "string" }, 52 | "symbols": { 53 | "type": "array", 54 | "minItems": 1, 55 | "items": { 56 | "type": "string", 57 | "minLength": 1, 58 | "pattern": "^(?![_\\d])\\w+$" 59 | }, 60 | "uniqueItems": true 61 | } 62 | } 63 | }, 64 | "array": { 65 | "description": "An array as defined by the Avro specification", 66 | "notes": [ "spec doesn't say whether \"items\" is required!" ], 67 | "type": "object", 68 | "required": [ "type" ], 69 | "properties": { 70 | "type": { "enum": [ "array" ] }, 71 | "items": { "$ref": "#" } 72 | } 73 | }, 74 | "map": { 75 | "description": "A map as defined by the Avro specification", 76 | "notes": [ "spec doesn't say whether \"values\" is required!" ], 77 | "type": "object", 78 | "required": [ "type" ], 79 | "properties": { 80 | "type": { "enum": [ "map" ] }, 81 | "values": { "$ref": "#" } 82 | } 83 | }, 84 | "union": { 85 | "description": "A union of schemas", 86 | "type": "array", 87 | "uniqueItems": true, 88 | "items": { 89 | "allOf": [ 90 | { "$ref": "#" }, 91 | { "not": { "$ref": "#/definitions/union" } } 92 | ] 93 | } 94 | }, 95 | "fixed": { 96 | "description": "A fixed type, as defined by the Avro specification", 97 | "type": "object", 98 | "required": [ "type", "name", "size" ], 99 | "properties": { 100 | "type": { "enum": [ "fixed" ] }, 101 | "name": { "$ref": "#/definitions/nameOrNamespace" }, 102 | "nameOrNamespace": { "$ref": "#/definitions/namespace" }, 103 | "size": { 104 | "type": "integer", 105 | "minimum": 0, 106 | "exclusiveMinimum": true 107 | }, 108 | "aliases": { "$ref": "#/definitions/aliases" } 109 | } 110 | }, 111 | "nameOrNamespace": { 112 | "description": "what a nameOrNamespace can be", 113 | "type": "string", 114 | "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" 115 | }, 116 | "aliases": { 117 | "type": "array", 118 | "minItems": 1, 119 | "uniqueItems": true, 120 | "items": {"$ref": "#/definitions/nameOrNamespace" } 121 | }, 122 | "field": { 123 | "description": "One field in a record", 124 | "type": "object", 125 | "required": [ "name", "type" ], 126 | "properties": { 127 | "name": { "$ref": "#/definitions/nameOrNamespace" }, 128 | "doc": { "type": "string" }, 129 | "type": { "$ref": "#" }, 130 | "default": { 131 | "description": "default value, depending on the type" 132 | }, 133 | "order": { 134 | "enum": [ "ascending", "descending", "ignore" ] 135 | }, 136 | "aliases": { "$ref": "#/definitions/aliases" } 137 | } 138 | } 139 | } 140 | } 141 | -------------------------------------------------------------------------------- /geojson/bbox.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "id": "http://json-schema.org/geojson/bbox.json#", 4 | "description": "A bounding box as defined by GeoJSON", 5 | "FIXME": "unenforceable constraint: even number of elements in array", 6 | "type": "array", 7 | "items": { "type": "number" } 8 | } -------------------------------------------------------------------------------- /geojson/crs.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "crs", 4 | "description": "a Coordinate Reference System object", 5 | "type": [ "object", "null" ], 6 | "required": [ "type", "properties" ], 7 | "properties": { 8 | "type": { "type": "string" }, 9 | "properties": { "type": "object" } 10 | }, 11 | "additionalProperties": false, 12 | "oneOf": [ 13 | { "$ref": "#/definitions/namedCrs" }, 14 | { "$ref": "#/definitions/linkedCrs" } 15 | ], 16 | "definitions": { 17 | "namedCrs": { 18 | "properties": { 19 | "type": { "enum": [ "name" ] }, 20 | "properties": { 21 | "required": [ "name" ], 22 | "additionalProperties": false, 23 | "properties": { 24 | "name": { 25 | "type": "string", 26 | "FIXME": "semantic validation necessary" 27 | } 28 | } 29 | } 30 | } 31 | }, 32 | "linkedObject": { 33 | "type": "object", 34 | "required": [ "href" ], 35 | "properties": { 36 | "href": { 37 | "type": "string", 38 | "format": "uri", 39 | "FIXME": "spec says \"dereferenceable\", cannot enforce that" 40 | }, 41 | "type": { 42 | "type": "string", 43 | "description": "Suggested values: proj4, ogjwkt, esriwkt" 44 | } 45 | } 46 | }, 47 | "linkedCrs": { 48 | "properties": { 49 | "type": { "enum": [ "link" ] }, 50 | "properties": { "$ref": "#/definitions/linkedObject" } 51 | } 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /geojson/geojson.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "id": "http://json-schema.org/geojson/geojson.json#", 4 | "title": "Geo JSON object", 5 | "description": "Schema for a Geo JSON object", 6 | "type": "object", 7 | "required": [ "type" ], 8 | "properties": { 9 | "crs": { "$ref": "http://json-schema.org/geojson/crs.json#" }, 10 | "bbox": { "$ref": "http://json-schema.org/geojson/bbox.json#" } 11 | }, 12 | "oneOf": [ 13 | { "$ref": "http://json-schema.org/geojson/geometry.json#" }, 14 | { "$ref": "#/definitions/geometryCollection" }, 15 | { "$ref": "#/definitions/feature" }, 16 | { "$ref": "#/definitions/featureCollection" } 17 | ], 18 | "definitions": { 19 | "geometryCollection": { 20 | "title": "GeometryCollection", 21 | "description": "A collection of geometry objects", 22 | "required": [ "geometries" ], 23 | "properties": { 24 | "type": { "enum": [ "GeometryCollection" ] }, 25 | "geometries": { 26 | "type": "array", 27 | "items": { "$ref": "http://json-schema.org/geojson/geometry.json#" } 28 | } 29 | } 30 | }, 31 | "feature": { 32 | "title": "Feature", 33 | "description": "A Geo JSON feature object", 34 | "required": [ "geometry", "properties" ], 35 | "properties": { 36 | "type": { "enum": [ "Feature" ] }, 37 | "geometry": { 38 | "oneOf": [ 39 | { "type": "null" }, 40 | { "$ref": "http://json-schema.org/geojson/geometry.json#" } 41 | ] 42 | }, 43 | "properties": { "type": [ "object", "null" ] }, 44 | "id": { "FIXME": "may be there, type not known (string? number?)" } 45 | } 46 | }, 47 | "featureCollection": { 48 | "title": "FeatureCollection", 49 | "description": "A Geo JSON feature collection", 50 | "required": [ "features" ], 51 | "properties": { 52 | "type": { "enum": [ "FeatureCollection" ] }, 53 | "features": { 54 | "type": "array", 55 | "items": { "$ref": "#/definitions/feature" } 56 | } 57 | } 58 | } 59 | } 60 | } 61 | 62 | -------------------------------------------------------------------------------- /geojson/geometry.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "id": "http://json-schema.org/geojson/geometry.json#", 4 | "title": "geometry", 5 | "description": "One geometry as defined by GeoJSON", 6 | "type": "object", 7 | "required": [ "type", "coordinates" ], 8 | "oneOf": [ 9 | { 10 | "title": "Point", 11 | "properties": { 12 | "type": { "enum": [ "Point" ] }, 13 | "coordinates": { "$ref": "#/definitions/position" } 14 | } 15 | }, 16 | { 17 | "title": "MultiPoint", 18 | "properties": { 19 | "type": { "enum": [ "MultiPoint" ] }, 20 | "coordinates": { "$ref": "#/definitions/positionArray" } 21 | } 22 | }, 23 | { 24 | "title": "LineString", 25 | "properties": { 26 | "type": { "enum": [ "LineString" ] }, 27 | "coordinates": { "$ref": "#/definitions/lineString" } 28 | } 29 | }, 30 | { 31 | "title": "MultiLineString", 32 | "properties": { 33 | "type": { "enum": [ "MultiLineString" ] }, 34 | "coordinates": { 35 | "type": "array", 36 | "items": { "$ref": "#/definitions/lineString" } 37 | } 38 | } 39 | }, 40 | { 41 | "title": "Polygon", 42 | "properties": { 43 | "type": { "enum": [ "Polygon" ] }, 44 | "coordinates": { "$ref": "#/definitions/polygon" } 45 | } 46 | }, 47 | { 48 | "title": "MultiPolygon", 49 | "properties": { 50 | "type": { "enum": [ "MultiPolygon" ] }, 51 | "coordinates": { 52 | "type": "array", 53 | "items": { "$ref": "#/definitions/polygon" } 54 | } 55 | } 56 | } 57 | ], 58 | "definitions": { 59 | "position": { 60 | "description": "A single position", 61 | "type": "array", 62 | "minItems": 2, 63 | "items": [ { "type": "number" }, { "type": "number" } ], 64 | "additionalItems": false 65 | }, 66 | "positionArray": { 67 | "description": "An array of positions", 68 | "type": "array", 69 | "items": { "$ref": "#/definitions/position" } 70 | }, 71 | "lineString": { 72 | "description": "An array of two or more positions", 73 | "allOf": [ 74 | { "$ref": "#/definitions/positionArray" }, 75 | { "minItems": 2 } 76 | ] 77 | }, 78 | "linearRing": { 79 | "description": "An array of four positions where the first equals the last", 80 | "allOf": [ 81 | { "$ref": "#/definitions/positionArray" }, 82 | { "minItems": 4 } 83 | ] 84 | }, 85 | "polygon": { 86 | "description": "An array of linear rings", 87 | "type": "array", 88 | "items": { "$ref": "#/definitions/linearRing" } 89 | } 90 | } 91 | } -------------------------------------------------------------------------------- /json-home/json-home.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "description": "JSON Home", 4 | "type": "object", 5 | "required": [ "resources" ], 6 | "properties": { 7 | "resource": { 8 | "type": "object", 9 | "notes": [ 10 | "member names must be URIs, but this is unenforceable", 11 | "member values must be unique, but this is unenforceable" 12 | ], 13 | "additionalItems": { 14 | "type": "object", 15 | "oneOf": [ 16 | { "$ref": "#/definitions/href" }, 17 | { "$ref": "#/definitions/hrefTemplate" } 18 | ] 19 | } 20 | } 21 | }, 22 | "definitions": { 23 | "href": { 24 | "description": "a href resource", 25 | "notes": [ 26 | "are additional properties allowed? Not said, here they are not" 27 | ], 28 | "required": [ "href" ], 29 | "properties": { 30 | "href": { 31 | "type": "string", 32 | "format": "uri" 33 | }, 34 | "hints": { "$ref": "#/definitions/hints" } 35 | }, 36 | "additionalProperties": false 37 | }, 38 | "hrefTemplate": { 39 | "description": "a href template resource", 40 | "notes": [ 41 | "are additional properties allowed? Not said, here they are not" 42 | ], 43 | "required": [ "href-template", "href-vars" ], 44 | "properties": { 45 | "href-template": { 46 | "type": "string", 47 | "note": [ "must be a URI template, format below is not defined" ], 48 | "format": "uri-template" 49 | }, 50 | "href-vars": { 51 | "type": "object", 52 | "additionalProperties": { 53 | "note": [ "supposedly what RFC 6570 allows" ], 54 | "type": [ "string", "array", "object" ], 55 | "items": { "type": "string" }, 56 | "additionalProperties": { "type": "string" } 57 | } 58 | }, 59 | "hints": { "$ref": "#/definitions/hints" } 60 | }, 61 | "additionalProperties": false 62 | }, 63 | "hints": { 64 | "description": "A resource hint", 65 | "type": "object", 66 | "properties": { 67 | "allow": { 68 | "description": "a list of HTTP methods", 69 | "notes": [ 70 | "Not said whether elements should be unique, assuming they must", 71 | "Not said whether there should be at least one element, assuming there must be" 72 | ], 73 | "type": "array", 74 | "minItems": 1, 75 | "items": { "type": "string" }, 76 | "uniqueItems": true 77 | }, 78 | "representations": { "$ref": "#/definitions/mediaTypeArray" }, 79 | "accept-patch": { 80 | "notes": [ "spec says PATCH should be present in \"allow\", cannot enforce" ], 81 | "$ref": "#/definitions/mediaTypeArray" 82 | }, 83 | "accept-post": { 84 | "notes": [ "spec says POST should be present in \"allow\", cannot enforce" ], 85 | "$ref": "#/definitions/mediaTypeArray" 86 | }, 87 | "accept-put": { 88 | "notes": [ "spec says PUT should be present in \"allow\", cannot enforce" ], 89 | "$ref": "#/definitions/mediaTypeArray" 90 | }, 91 | "accept-ranges": { 92 | "note": [ "TODO, see http://tools.ietf.org/html/draft-ietf-httpbis-p5-range-22" ], 93 | "type": "array", 94 | "minItems": 1, 95 | "uniqueItems": true, 96 | "items": { "type": "string" } 97 | }, 98 | "prefer": { 99 | "note": [ "TODO, see http://tools.ietf.org/html/draft-snell-http-prefer-18" ], 100 | "type": "array", 101 | "minItems": 1, 102 | "uniqueItems": true, 103 | "items": { "type": "string" } 104 | }, 105 | "docs": { 106 | "note": [ "spec says URI must be absolute, cannot enforce that" ], 107 | "type": "string", 108 | "format": "uri" 109 | }, 110 | "precondition-req": { 111 | "note": [ "see http://tools.ietf.org/html/draft-ietf-httpbis-p4-conditional-22" ], 112 | "type": "array", 113 | "minItems": 1, 114 | "uniqueItems": true, 115 | "items": { "enum": [ "etag", "last-modified" ] } 116 | }, 117 | "auth-req": { 118 | "note": [ 119 | "see http://tools.ietf.org/html/draft-ietf-httpbis-p7-auth-22", 120 | "Not said whether elements should be unique, assuming they must", 121 | "Not said whether there should be at least one element, assuming there must be" 122 | ], 123 | "type": "array", 124 | "minItems": 1, 125 | "uniqueItems": true, 126 | "items": { "$ref": "#/definitions/authReq" } 127 | }, 128 | "status": { 129 | "enum": [ "deprecated", "gone" ] 130 | } 131 | } 132 | }, 133 | "mediaTypeArray": { 134 | "description": "an array of media types", 135 | "notes": [ 136 | "media-type format attribute does not exist", 137 | "Not said whether elements should be unique, assuming they must", 138 | "Not said whether there should be at least one element, assuming there must be" 139 | ], 140 | "type": "array", 141 | "minItems": 1, 142 | "items": { 143 | "type": "string", 144 | "format": "media-type" 145 | }, 146 | "uniqueItems": true 147 | }, 148 | "authReq": { 149 | "type": "object", 150 | "required": [ "scheme" ], 151 | "properties": { 152 | "scheme": { "type": "string" }, 153 | "realms": { 154 | "type": "array", 155 | "items": { "type": "string" } 156 | } 157 | } 158 | } 159 | } 160 | } 161 | -------------------------------------------------------------------------------- /json-patch/json-patch.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "JSON Patch", 3 | "description": "A JSON Schema describing a JSON Patch", 4 | "$schema": "http://json-schema.org/draft-04/schema#", 5 | "notes": [ 6 | "Only required members are accounted for, other members are ignored" 7 | ], 8 | "type": "array", 9 | "items": { 10 | "description": "one JSON Patch operation", 11 | "allOf": [ 12 | { 13 | "description": "Members common to all operations", 14 | "type": "object", 15 | "required": [ "op", "path" ], 16 | "properties": { 17 | "path": { "$ref": "#/definitions/jsonPointer" } 18 | } 19 | }, 20 | { "$ref": "#/definitions/oneOperation" } 21 | ] 22 | }, 23 | "definitions": { 24 | "jsonPointer": { 25 | "type": "string", 26 | "pattern": "^(/[^/~]*(~[01][^/~]*)*)*$" 27 | }, 28 | "add": { 29 | "description": "add operation. Value can be any JSON value.", 30 | "properties": { "op": { "enum": [ "add" ] } }, 31 | "required": [ "value" ] 32 | }, 33 | "remove": { 34 | "description": "remove operation. Only a path is specified.", 35 | "properties": { "op": { "enum": [ "remove" ] } } 36 | }, 37 | "replace": { 38 | "description": "replace operation. Value can be any JSON value.", 39 | "properties": { "op": { "enum": [ "replace" ] } }, 40 | "required": [ "value" ] 41 | }, 42 | "move": { 43 | "description": "move operation. \"from\" is a JSON Pointer.", 44 | "properties": { 45 | "op": { "enum": [ "move" ] }, 46 | "from": { "$ref": "#/definitions/jsonPointer" } 47 | }, 48 | "required": [ "from" ] 49 | }, 50 | "copy": { 51 | "description": "copy operation. \"from\" is a JSON Pointer.", 52 | "properties": { 53 | "op": { "enum": [ "copy" ] }, 54 | "from": { "$ref": "#/definitions/jsonPointer" } 55 | }, 56 | "required": [ "from" ] 57 | }, 58 | "test": { 59 | "description": "test operation. Value can be any JSON value.", 60 | "properties": { "op": { "enum": [ "test" ] } }, 61 | "required": [ "value" ] 62 | }, 63 | "oneOperation": { 64 | "oneOf": [ 65 | { "$ref": "#/definitions/add" }, 66 | { "$ref": "#/definitions/remove" }, 67 | { "$ref": "#/definitions/replace" }, 68 | { "$ref": "#/definitions/move" }, 69 | { "$ref": "#/definitions/copy" }, 70 | { "$ref": "#/definitions/test" } 71 | ] 72 | } 73 | } 74 | } -------------------------------------------------------------------------------- /json-stat/json-stat.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "description": "Specification for JSON Stat (URL: http://json-stat.org/format/", 4 | "type": "object", 5 | "minProperties": 1, 6 | "additionalProperties": { "$ref": "#/definitions/dataset" }, 7 | "definitions": { 8 | "dataset": { 9 | "type": "object", 10 | "required": [ "value", "dimension" ], 11 | "properties": { 12 | "label": { "type": "string" }, 13 | "value": { "$ref": "#/definitions/value" }, 14 | "status": { "$ref": "#/definitions/status" }, 15 | "dimension": { "$ref": "#/definitions/dimension" }, 16 | "updated": { 17 | "type": "string", 18 | "format": "date-time" 19 | }, 20 | "source": { "type": "string" } 21 | } 22 | }, 23 | "value": { 24 | "note": [ "Are 0-length values possible?" ], 25 | "oneOf": [ 26 | { 27 | "type": "array", 28 | "items": { "$ref": "#/definitions/valueElement" } 29 | }, 30 | { 31 | "type": "object", 32 | "additionalProperties": { "$ref": "#/definitions/valueElement" } 33 | } 34 | ] 35 | 36 | }, 37 | "valueElement": { 38 | "type": [ "number", "null" ], 39 | "note": [ "unsure whether other types are allowed" ] 40 | }, 41 | "status": { 42 | "note": [ 43 | "unsure whether a status element may be something else than a string", 44 | "minItems is a guess (so is minProperties)", 45 | "empty strings are allowed currently" 46 | ], 47 | "type": [ "array", "string", "object" ], 48 | "minItems": 1, 49 | "items": { "type": "string" }, 50 | "minProperties": 1, 51 | "additionalProperties": { "type": "string" } 52 | }, 53 | "dimension": { 54 | "type": "object", 55 | "required": [ "id", "size" ], 56 | "properties": { 57 | "id": { 58 | "type": "array", 59 | "items": { "type": "string" }, 60 | "note": [ 61 | "unsure whether 0-length is allowed (it currently is)", 62 | "unsure whether empty strings are allowed (they currently are)" 63 | ] 64 | }, 65 | "size": { 66 | "type": "array", 67 | "items": { 68 | "type": "integer", 69 | "minimum": 1, 70 | "note": [ "minimum is a guess (a negative size doesn't seem to make sense anyway) " ] 71 | }, 72 | "note": [ 73 | "unsure whether 0-length is allowed (it currently is)" 74 | ] 75 | }, 76 | "role": { "$ref": "#/definitions/role" } 77 | }, 78 | "additionalProperties": { "$ref": "#/definitions/dimensionID" } 79 | }, 80 | "role": { 81 | "type": "object", 82 | "properties": { 83 | "time": { "$ref": "#/definitions/stringArray" }, 84 | "geo": { "$ref": "#/definitions/stringArray" }, 85 | "metric": { "$ref": "#/definitions/stringArray" } 86 | }, 87 | "additionalProperties": false 88 | }, 89 | "stringArray": { 90 | "type": "array", 91 | "items": { "type": "string" }, 92 | "note": [ 93 | "unsure whether 0-length is allowed (it currently is)" 94 | ] 95 | }, 96 | "dimensionID": { 97 | "type": "object", 98 | "note": [ 99 | "spec says \"name of this object must be one of the strings in the id array\", unenforceable with JSON Schema" 100 | ], 101 | "required": [ "category" ], 102 | "properties": { 103 | "label": { "type": "string" }, 104 | "category": { 105 | "type": "object", 106 | "properties": { 107 | "label": { 108 | "type": "object", 109 | "additionalProperties": { "type": "string" } 110 | }, 111 | "index": { 112 | "oneOf": [ 113 | { "$ref": "#/definitions/stringArray" }, 114 | { 115 | "type": "object", 116 | "additionalProperties": { 117 | "type": "integer", 118 | "minimum": 0 119 | } 120 | } 121 | ] 122 | }, 123 | "child": { "$ref": "#/definitions/stringArray" }, 124 | "coordinates": { 125 | "type": "object", 126 | "additionalProperties": { 127 | "type": "array", 128 | "note": [ "two-element array with longitude/latitude" ], 129 | "items": [ 130 | { 131 | "type": "number", 132 | "minimum": -180, 133 | "maximum": 180 134 | }, 135 | { 136 | "type": "number", 137 | "minimum": -90, 138 | "maximum": 90 139 | } 140 | ] 141 | } 142 | }, 143 | "unit": { 144 | "type": "object", 145 | "additionalProperties": { "type": "object" } 146 | } 147 | } 148 | } 149 | } 150 | } 151 | } 152 | } 153 | 154 | -------------------------------------------------------------------------------- /jsonrpc2.0/jsonrpc-request-2.0.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "description": "A JSON RPC 2.0 request", 4 | "oneOf": [ 5 | { 6 | "description": "An individual request", 7 | "$ref": "#/definitions/request" 8 | }, 9 | { 10 | "description": "An array of requests", 11 | "type": "array", 12 | "items": { "$ref": "#/definitions/request" } 13 | } 14 | ], 15 | "definitions": { 16 | "request": { 17 | "type": "object", 18 | "required": [ "jsonrpc", "method" ], 19 | "properties": { 20 | "jsonrpc": { "enum": [ "2.0" ] }, 21 | "method": { 22 | "type": "string" 23 | }, 24 | "id": { 25 | "type": [ "string", "number", "null" ], 26 | "note": [ 27 | "While allowed, null should be avoided: http://www.jsonrpc.org/specification#id1", 28 | "While allowed, a number with a fractional part should be avoided: http://www.jsonrpc.org/specification#id2" 29 | ] 30 | }, 31 | "params": { 32 | "type": [ "array", "object" ] 33 | } 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /jsonrpc2.0/jsonrpc-response-2.0.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "description": "A JSON RPC 2.0 response", 4 | "oneOf": [ 5 | { "$ref": "#/definitions/success" }, 6 | { "$ref": "#/definitions/error" }, 7 | { 8 | "type": "array", 9 | "items": { 10 | "oneOf": [ 11 | { "$ref": "#/definitions/success" }, 12 | { "$ref": "#/definitions/error" } 13 | ] 14 | } 15 | } 16 | ], 17 | "definitions": { 18 | "common": { 19 | "required": [ "id", "jsonrpc" ], 20 | "not": { 21 | "description": "cannot have result and error at the same time", 22 | "required": [ "result", "error" ] 23 | }, 24 | "type": "object", 25 | "properties": { 26 | "id": { 27 | "type": [ "string", "integer", "null" ], 28 | "note": [ 29 | "spec says a number which should not contain a fractional part", 30 | "We choose integer here, but this is unenforceable with some languages" 31 | ] 32 | }, 33 | "jsonrpc": { "enum": [ "2.0" ] } 34 | } 35 | }, 36 | "success": { 37 | "description": "A success. The result member is then required and can be anything.", 38 | "allOf": [ 39 | { "$ref": "#/definitions/common" }, 40 | { "required": [ "result" ] } 41 | ] 42 | }, 43 | "error": { 44 | "allOf" : [ 45 | { "$ref": "#/definitions/common" }, 46 | { 47 | "required": [ "error" ], 48 | "properties": { 49 | "error": { 50 | "type": "object", 51 | "required": [ "code", "message" ], 52 | "properties": { 53 | "code": { 54 | "type": "integer", 55 | "note": [ "unenforceable in some languages" ] 56 | }, 57 | "message": { "type": "string" }, 58 | "data": { 59 | "description": "optional, can be anything" 60 | } 61 | } 62 | } 63 | } 64 | } 65 | ] 66 | } 67 | } 68 | } -------------------------------------------------------------------------------- /smd/smd-service.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "id": "http://json-schema.org/schemas/smd-service.json#", 4 | "description": "One service as described by the SMD spec", 5 | "type": "object", 6 | "properties": { 7 | "transport": { 8 | "description": "The transport used by this service", 9 | "enum": [ "POST", "GET", "REST", "JSONP", "TCP/IP" ], 10 | "default": "POST" 11 | }, 12 | "envelope": { 13 | "description": "The envelope used by this service", 14 | "enum": [ "URL", "PATH", "JSON", "JSON-RPC-1.0", "JSON-RPC-1.1", "JSON-RPC-2.0" ], 15 | "default": "URL" 16 | }, 17 | "contentType": { 18 | "description": "Any MIME type", 19 | "note": "defines a mediaType format", 20 | "type": "string", 21 | "format": "mediaType", 22 | "default": "application/json" 23 | }, 24 | "jsonpCallbackParameter": { 25 | "FIXME": "didn't understand much except that it is a parameter", 26 | "$ref": "#/definitions/serviceParameter" 27 | }, 28 | "target": { 29 | "description": "URL used for method call request, resolved within the SMD context", 30 | "type": "string", 31 | "format": "uri" 32 | }, 33 | "additionalParameters": { 34 | "description": "additional parameters in addition to the defined ones; false means none allowed", 35 | "oneOf": [ 36 | { 37 | "type": "boolean" 38 | }, 39 | { 40 | "$ref": "http://json-schema.org/draft-04/schema#" 41 | } 42 | ] 43 | }, 44 | "parameters": { 45 | "type": "array", 46 | "items": { "$ref": "#/definitions/serviceParameter" } 47 | }, 48 | "returns": { 49 | "oneOf": [ 50 | { 51 | "$ref": "http://json-schema.org/draft-04/schema#" 52 | }, 53 | { 54 | "type": "object", 55 | "required": [ "type", "services" ], 56 | "properties": { 57 | "type": { "$ref": "http://json-schema.org/draft-04/schema#" }, 58 | "services": { "$ref": "#" } 59 | } 60 | } 61 | ] 62 | }, 63 | "name": { "type": "string" } 64 | }, 65 | "definitions": { 66 | "serviceParameter": { 67 | "description": "A JSON Schema with a required \"name\" member", 68 | "allOf": [ 69 | { "$ref": "http://json-schema.org/draft-04/schema#" }, 70 | { 71 | "note": "spec specifies \"default\" which is equivalent to JSON Schema's, not reproduced here", 72 | "properties": { 73 | "name": { "type": "string" }, 74 | "optional": { "type": "boolean" } 75 | }, 76 | "required": [ "name" ] 77 | } 78 | ] 79 | } 80 | } 81 | } -------------------------------------------------------------------------------- /smd/smd.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "id": "http://json-schema.org/schemas/smd.json#", 4 | "title": "Service Mapping Description", 5 | "description": "JSON Schema for a Service Mapping Description", 6 | "oneOf": [ 7 | { 8 | "description": "services with additional, required, properties at the root level", 9 | "allOf": [ 10 | { 11 | "type": "object", 12 | "required": [ "services", "id", "description", "SMDVersion" ], 13 | "properties": { 14 | "services": { 15 | "type": "object", 16 | "additionalProperties": { 17 | "$ref": "http://json-schema.org/schemas/smd-service.json#" 18 | } 19 | }, 20 | "id": { 21 | "type": "string", 22 | "format": "uri" 23 | }, 24 | "description": { "type": "string" }, 25 | "SMDVersion": { 26 | "type": "string", 27 | "default": "2.0" 28 | } 29 | } 30 | }, 31 | { 32 | "$ref": "http://json-schema.org/schemas/smd-service.json#" 33 | } 34 | ] 35 | 36 | }, 37 | { 38 | "$ref": "http://json-schema.org/schemas/smd-service.json#" 39 | } 40 | ] 41 | } -------------------------------------------------------------------------------- /swagger/apiDeclaration.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "http://wordnik.github.io/schemas/apiDeclaration.json#", 3 | "$schema": "http://json-schema.org/draft-04/schema#", 4 | "type": "object", 5 | "required": [ "swaggerVersion", "basePath", "apis" ], 6 | "properties": { 7 | "swaggerVersion": { "enum": [ "1.2" ] }, 8 | "apiVersion": { "type": "string" }, 9 | "basePath": { 10 | "type": "string", 11 | "format": "uri", 12 | "pattern": "^http://" 13 | }, 14 | "resourcePath": { 15 | "type": "string", 16 | "format": "uri", 17 | "pattern": "^/" 18 | }, 19 | "apis": { 20 | "type": "array", 21 | "items": { "$ref": "#/definitions/apiObject" } 22 | }, 23 | "models": { 24 | "type": "object", 25 | "additionalProperties": { 26 | "$ref": "modelsObject.json#" 27 | } 28 | }, 29 | "produces": { "$ref": "#/definitions/mimeTypeArray" }, 30 | "consumes": { "$ref": "#/definitions/mimeTypeArray" }, 31 | "authorizations": { "$ref": "authorizationObject.json#" } 32 | }, 33 | "additionalProperties": false, 34 | "definitions": { 35 | "apiObject": { 36 | "type": "object", 37 | "required": [ "path", "operations" ], 38 | "properties": { 39 | "path": { "type": "string", "format": "uri-template" }, 40 | "description": { "type": "string" }, 41 | "operations": { 42 | "type": "array", 43 | "items": { "$ref": "operationObject.json#" } 44 | } 45 | }, 46 | "additionalProperties": false 47 | }, 48 | "mimeTypeArray": { 49 | "type": "array", 50 | "items": { 51 | "type": "string", 52 | "format": "mime-type" 53 | } 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /swagger/authorizationObject.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "http://wordnik.github.io/schemas/authorizationObject.json#", 3 | "$schema": "http://json-schema.org/draft-04/schema#", 4 | "type": "object", 5 | "additionalProperties": { 6 | "oneOf": [ 7 | { 8 | "$ref": "#/definitions/basicAuth" 9 | }, 10 | { 11 | "$ref": "#/definitions/apiKey" 12 | }, 13 | { 14 | "$ref": "#/definitions/oauth2" 15 | } 16 | ] 17 | }, 18 | "definitions": { 19 | "basicAuth": { 20 | "required": [ "type" ], 21 | "properties": { 22 | "type": { "enum": [ "basicAuth" ] } 23 | }, 24 | "additionalProperties": false 25 | }, 26 | "apiKey": { 27 | "required": [ "type", "passAs", "keyname" ], 28 | "properties": { 29 | "type": { "enum": [ "apiKey" ] }, 30 | "passAs": { "enum": [ "header", "query" ] }, 31 | "keyname": { "type": "string" } 32 | }, 33 | "additionalProperties": false 34 | }, 35 | "oauth2": { 36 | "type": "object", 37 | "required": [ "type", "grantTypes" ], 38 | "properties": { 39 | "type": { "enum": [ "oauth2" ] }, 40 | "scopes": { 41 | "type": "array", 42 | "items": { "$ref": "#/definitions/oauth2Scope" } 43 | }, 44 | "grantTypes": { "$ref": "oauth2GrantType.json#" } 45 | }, 46 | "additionalProperties": false 47 | }, 48 | "oauth2Scope": { 49 | "type": "object", 50 | "required": [ "scope" ], 51 | "properties": { 52 | "scope": { "type": "string" }, 53 | "description": { "type": "string" } 54 | }, 55 | "additionalProperties": false 56 | } 57 | } 58 | } 59 | 60 | -------------------------------------------------------------------------------- /swagger/dataType.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "http://wordnik.github.io/schemas/dataType.json#", 3 | "$schema": "http://json-schema.org/draft-04/schema#", 4 | "description": "Data type as described by the specification (version 1.2)", 5 | "type": "object", 6 | "oneOf": [ 7 | { "$ref": "#/definitions/refType" }, 8 | { "$ref": "#/definitions/voidType" }, 9 | { "$ref": "#/definitions/primitiveType" }, 10 | { "$ref": "#/definitions/modelType" }, 11 | { "$ref": "#/definitions/arrayType" } 12 | ], 13 | "definitions": { 14 | "refType": { 15 | "required": [ "$ref" ], 16 | "properties": { 17 | "$ref": { "type": "string" } 18 | }, 19 | "additionalProperties": false 20 | }, 21 | "voidType": { 22 | "enum": [ { "type": "void" } ] 23 | }, 24 | "modelType": { 25 | "required": [ "type" ], 26 | "properties": { 27 | "type": { 28 | "type": "string", 29 | "not": { 30 | "enum": [ "boolean", "integer", "number", "string", "array" ] 31 | } 32 | } 33 | }, 34 | "additionalProperties": false 35 | }, 36 | "primitiveType": { 37 | "required": [ "type" ], 38 | "properties": { 39 | "type": { 40 | "enum": [ "boolean", "integer", "number", "string" ] 41 | }, 42 | "format": { "type": "string" }, 43 | "defaultValue": { 44 | "not": { "type": [ "array", "object", "null" ] } 45 | }, 46 | "enum": { 47 | "type": "array", 48 | "items": { "type": "string" }, 49 | "minItems": 1, 50 | "uniqueItems": true 51 | }, 52 | "minimum": { "type": "string" }, 53 | "maximum": { "type": "string" } 54 | }, 55 | "additionalProperties": false, 56 | "dependencies": { 57 | "format": { 58 | "oneOf": [ 59 | { 60 | "properties": { 61 | "type": { "enum": [ "integer" ] }, 62 | "format": { "enum": [ "int32", "int64" ] } 63 | } 64 | }, 65 | { 66 | "properties": { 67 | "type": { "enum": [ "number" ] }, 68 | "format": { "enum": [ "float", "double" ] } 69 | } 70 | }, 71 | { 72 | "properties": { 73 | "type": { "enum": [ "string" ] }, 74 | "format": { 75 | "enum": [ "byte", "date", "date-time" ] 76 | } 77 | } 78 | } 79 | ] 80 | }, 81 | "enum": { 82 | "properties": { 83 | "type": { "enum": [ "string" ] } 84 | } 85 | }, 86 | "minimum": { 87 | "properties": { 88 | "type": { "enum": [ "integer", "number" ] } 89 | } 90 | }, 91 | "maximum": { 92 | "properties": { 93 | "type": { "enum": [ "integer", "number" ] } 94 | } 95 | } 96 | } 97 | }, 98 | "arrayType": { 99 | "required": [ "type", "items" ], 100 | "properties": { 101 | "type": { "enum": [ "array" ] }, 102 | "items": { 103 | "type": "array", 104 | "items": { "$ref": "#/definitions/itemsObject" } 105 | }, 106 | "uniqueItems": { "type": "boolean" } 107 | }, 108 | "additionalProperties": false 109 | }, 110 | "itemsObject": { 111 | "oneOf": [ 112 | { 113 | "$ref": "#/definitions/refType" 114 | }, 115 | { 116 | "allOf": [ 117 | { 118 | "$ref": "#/definitions/primitiveType" 119 | }, 120 | { 121 | "properties": { 122 | "type": {}, 123 | "format": {} 124 | }, 125 | "additionalProperties": false 126 | } 127 | ] 128 | } 129 | ] 130 | } 131 | } 132 | } -------------------------------------------------------------------------------- /swagger/dataTypeBase.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "http://wordnik.github.io/schemas/dataTypeBase.json#", 3 | "$schema": "http://json-schema.org/draft-04/schema#", 4 | "description": "Data type fields (section 4.3.3)", 5 | "type": "object", 6 | "oneOf": [ 7 | { "required": [ "type" ] }, 8 | { "required": [ "$ref" ] } 9 | ], 10 | "properties": { 11 | "type": { "type": "string" }, 12 | "$ref": { "type": "string" }, 13 | "format": { "type": "string" }, 14 | "defaultValue": { 15 | "not": { "type": [ "array", "object", "null" ] } 16 | }, 17 | "enum": { 18 | "type": "array", 19 | "items": { "type": "string" }, 20 | "uniqueItems": true, 21 | "minItems": 1 22 | }, 23 | "minimum": { "type": "string" }, 24 | "maximum": { "type": "string" }, 25 | "items": { "$ref": "#/definitions/itemsObject" }, 26 | "uniqueItems": { "type": "boolean" } 27 | }, 28 | "dependencies": { 29 | "format": { 30 | "oneOf": [ 31 | { 32 | "properties": { 33 | "type": { "enum": [ "integer" ] }, 34 | "format": { "enum": [ "int32", "int64" ] } 35 | } 36 | }, 37 | { 38 | "properties": { 39 | "type": { "enum": [ "number" ] }, 40 | "format": { "enum": [ "float", "double" ] } 41 | } 42 | }, 43 | { 44 | "properties": { 45 | "type": { "enum": [ "string" ] }, 46 | "format": { 47 | "enum": [ "byte", "date", "date-time" ] 48 | } 49 | } 50 | } 51 | ] 52 | } 53 | }, 54 | "definitions": { 55 | "itemsObject": { 56 | "oneOf": [ 57 | { 58 | "type": "object", 59 | "required": [ "$ref" ], 60 | "properties": { 61 | "$ref": { "type": "string" } 62 | }, 63 | "additionalProperties": false 64 | }, 65 | { 66 | "allOf": [ 67 | { "$ref": "#" }, 68 | { 69 | "required": [ "type" ], 70 | "properties": { 71 | "type": {}, 72 | "format": {} 73 | }, 74 | "additionalProperties": false 75 | } 76 | ] 77 | } 78 | ] 79 | } 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /swagger/infoObject.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "http://wordnik.github.io/schemas/infoObject.json#", 3 | "$schema": "http://json-schema.org/draft-04/schema#", 4 | "description": "info object (section 5.1.3)", 5 | "type": "object", 6 | "required": [ "title", "description" ], 7 | "properties": { 8 | "title": { "type": "string" }, 9 | "description": { "type": "string" }, 10 | "termsOfServiceUrl": { "type": "string", "format": "uri" }, 11 | "contact": { "type": "string", "format": "email" }, 12 | "license": { "type": "string" }, 13 | "licenseUrl": { "type": "string", "format": "uri" } 14 | }, 15 | "additionalProperties": false 16 | } -------------------------------------------------------------------------------- /swagger/modelsObject.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "http://wordnik.github.io/schemas/modelsObject.json#", 3 | "$schema": "http://json-schema.org/draft-04/schema#", 4 | "type": "object", 5 | "required": [ "id", "properties" ], 6 | "properties": { 7 | "id": { "type": "string" }, 8 | "description": { "type": "string" }, 9 | "properties": { 10 | "type": "object", 11 | "additionalProperties": { "$ref": "#/definitions/propertyObject" } 12 | }, 13 | "subTypes": { 14 | "type": "array", 15 | "items": { "type": "string" }, 16 | "uniqueItems": true 17 | }, 18 | "discriminator": { "type": "string" } 19 | }, 20 | "dependencies": { 21 | "subTypes": [ "discriminator" ] 22 | }, 23 | "definitions": { 24 | "propertyObject": { 25 | "allOf": [ 26 | { 27 | "not": { "$ref": "#" } 28 | }, 29 | { 30 | "$ref": "dataTypeBase.json#" 31 | } 32 | ] 33 | } 34 | } 35 | } 36 | 37 | -------------------------------------------------------------------------------- /swagger/oauth2GrantType.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "http://wordnik.github.io/schemas/oauth2GrantType.json#", 3 | "$schema": "http://json-schema.org/draft-04/schema#", 4 | "type": "object", 5 | "minProperties": 1, 6 | "properties": { 7 | "implicit": { "$ref": "#/definitions/implicit" }, 8 | "authorization_code": { "$ref": "#/definitions/authorizationCode" } 9 | }, 10 | "definitions": { 11 | "implicit": { 12 | "type": "object", 13 | "required": [ "loginEndpoint" ], 14 | "properties": { 15 | "loginEndpoint": { "$ref": "#/definitions/loginEndpoint" }, 16 | "tokenName": { "type": "string" } 17 | }, 18 | "additionalProperties": false 19 | }, 20 | "authorizationCode": { 21 | "type": "object", 22 | "required": [ "tokenEndpoint", "tokenRequestEndpoint" ], 23 | "properties": { 24 | "tokenEndpoint": { "$ref": "#/definitions/tokenEndpoint" }, 25 | "tokenRequestEndpoint": { "$ref": "#/definitions/tokenRequestEndpoint" } 26 | }, 27 | "additionalProperties": false 28 | }, 29 | "loginEndpoint": { 30 | "type": "object", 31 | "required": [ "url" ], 32 | "properties": { 33 | "url": { "type": "string", "format": "uri" } 34 | }, 35 | "additionalProperties": false 36 | }, 37 | "tokenEndpoint": { 38 | "type": "object", 39 | "required": [ "url" ], 40 | "properties": { 41 | "url": { "type": "string", "format": "uri" }, 42 | "tokenName": { "type": "string" } 43 | }, 44 | "additionalProperties": false 45 | }, 46 | "tokenRequestEndpoint": { 47 | "type": "object", 48 | "required": [ "url" ], 49 | "properties": { 50 | "url": { "type": "string", "format": "uri" }, 51 | "clientIdName": { "type": "string" }, 52 | "clientSecretName": { "type": "string" } 53 | }, 54 | "additionalProperties": false 55 | } 56 | } 57 | } -------------------------------------------------------------------------------- /swagger/operationObject.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "http://wordnik.github.io/schemas/operationObject.json#", 3 | "$schema": "http://json-schema.org/draft-04/schema#", 4 | "type": "object", 5 | "allOf": [ 6 | { "$ref": "dataTypeBase.json#" }, 7 | { 8 | "required": [ "method", "nickname", "parameters" ], 9 | "properties": { 10 | "method": { "enum": [ "GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS" ] }, 11 | "summary": { "type": "string", "maxLength": 120 }, 12 | "notes": { "type": "string" }, 13 | "nickname": { 14 | "type": "string", 15 | "pattern": "^[a-zA-Z0-9_]+$" 16 | }, 17 | "authorizations": { 18 | "type": "object", 19 | "additionalProperties": { 20 | "type": "array", 21 | "items": { 22 | "$ref": "authorizationObject.json#/definitions/oauth2Scope" 23 | } 24 | } 25 | }, 26 | "parameters": { 27 | "type": "array", 28 | "items": { "$ref": "parameterObject.json#" } 29 | }, 30 | "responseMessages": { 31 | "type": "array", 32 | "items": { "$ref": "#/definitions/responseMessageObject"} 33 | }, 34 | "produces": { "$ref": "#/definitions/mimeTypeArray" }, 35 | "consumes": { "$ref": "#/definitions/mimeTypeArray" }, 36 | "deprecated": { "enum": [ "true", "false" ] } 37 | } 38 | } 39 | ], 40 | "definitions": { 41 | "responseMessageObject": { 42 | "type": "object", 43 | "required": [ "code", "message" ], 44 | "properties": { 45 | "code": { "$ref": "#/definitions/rfc2616section10" }, 46 | "message": { "type": "string" }, 47 | "responseModel": { "type": "string" } 48 | } 49 | }, 50 | "rfc2616section10": { 51 | "type": "integer", 52 | "minimum": 100, 53 | "maximum": 600, 54 | "exclusiveMaximum": true 55 | }, 56 | "mimeTypeArray": { 57 | "type": "array", 58 | "items": { 59 | "type": "string", 60 | "format": "mime-type" 61 | } 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /swagger/parameterObject.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "http://wordnik.github.io/schemas/parameterObject.json#", 3 | "$schema": "http://json-schema.org/draft-04/schema#", 4 | "type": "object", 5 | "allOf": [ 6 | { "$ref": "dataTypeBase.json#" }, 7 | { 8 | "required": [ "paramType", "name" ], 9 | "properties": { 10 | "paramType": { 11 | "enum": [ "path", "query", "body", "header", "form" ] 12 | }, 13 | "name": { "type": "string" }, 14 | "description": { "type": "string" }, 15 | "required": { "type": "boolean" }, 16 | "allowMultiple": { "type": "boolean" } 17 | } 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /swagger/resourceListing.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "http://wordnik.github.io/schemas/resourceListing.json#", 3 | "$schema": "http://json-schema.org/draft-04/schema#", 4 | "type": "object", 5 | "required": [ "swaggerVersion", "apis" ], 6 | "properties": { 7 | "swaggerVersion": { "enum": [ "1.2" ] }, 8 | "apis": { 9 | "type": "array", 10 | "items": { "$ref": "resourceObject.json#" } 11 | }, 12 | "apiVersion": { "type": "string" }, 13 | "info": { "$ref": "infoObject.json#" }, 14 | "authorizations": { "$ref": "authorizationObject.json#" } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /swagger/resourceObject.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "http://wordnik.github.io/schemas/resourceObject.json#", 3 | "$schema": "http://json-schema.org/draft-04/schema#", 4 | "type": "object", 5 | "required": [ "path" ], 6 | "properties": { 7 | "path": { "type": "string", "format": "uri" }, 8 | "description": { "type": "string" } 9 | }, 10 | "additionalProperties": false 11 | } --------------------------------------------------------------------------------