https://github.com/postmanlabs/schemas
Repository of all schemas for JSON structures compatible with Postman (such as the Postman Collection Format)
https://github.com/postmanlabs/schemas
Last synced: 9 months ago
JSON representation
Repository of all schemas for JSON structures compatible with Postman (such as the Postman Collection Format)
- Host: GitHub
- URL: https://github.com/postmanlabs/schemas
- Owner: postmanlabs
- License: apache-2.0
- Created: 2015-07-02T18:53:04.000Z (over 10 years ago)
- Default Branch: develop
- Last Pushed: 2025-02-11T12:28:42.000Z (11 months ago)
- Last Synced: 2025-04-10T00:16:55.950Z (9 months ago)
- Language: JavaScript
- Homepage: https://schema.getpostman.com/
- Size: 1.3 MB
- Stars: 43
- Watchers: 15
- Forks: 32
- Open Issues: 35
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.yaml
- License: LICENSE.md
Awesome Lists containing this project
README
# Postman Schemas
Repository of all schemas for JSON structures compatible with Postman (such as the Postman Collection Format). The schemas are also hosted online, at [schema.getpostman.com](https://schema.getpostman.com).
## Usage
All the schemas in this repository are valid JSON Schemas, compliant with the [JSON-Schema, Draft 4](http://json-schema.org/documentation.html). As such, they can be used with a number of tools to validate arbitrary JSON blobs, as show below:
### Examples: JavaScript
#### [is-my-json-valid](https://github.com/mafintosh/is-my-json-valid)
```
var https = require('https'),
validate = require('is-my-json-valid');
var input = {
/* JSON of a collection V1 */
};
// we fetch the schema from server and when it is received,
// validate our input JSON against it.
https.get('https://schema.getpostman.com/json/collection/v1/', function (response) {
var body = '';
response.on('data', function (d) {
body += d;
});
response.on('end', function () {
var validate = validator(JSON.parse(body));
console.log(validate(input) ? 'It is a valid collection!' : 'It is not a valid collection!');
});
});
```
#### [tv4](https://github.com/geraintluff/tv4)
```
var https = require('https'),
tv4 = require('tv4');
var input = {
/* JSON of a collection V1 */
};
// we fetch the schema from server and when it is received,
// validate our input JSON against it.
https.get('https://schema.getpostman.com/json/collection/v1/', function (response) {
var body = '';
response.on('data', function (d) {
body += d;
});
response.on('end', function () {
var result = tv4.validate(input, JSON.parse(body));
console.log((result) ? 'It is a valid collection!' : 'It is not a valid collection!');
});
});
```
### Example: Python
#### [jsonschema](https://github.com/Julian/jsonschema)
```
import requests # make sure this is installed
from jsonschema import validate
from jsonschema.exceptions import ValidationError
schema = requests.get('https://schema.getpostman.com/json/collection/v1/').json()
test_input = {} # Whatever needs to be validated.
try:
validate(test_input, schema)
except ValidationError:
print 'It is not a valid collection!'
else:
print 'It is a valid collection!'
```
