Name: schemas
Owner: Postman
Description: Repository of all schemas for JSON structures compatible with Postman (such as the Postman Collection Format)
Created: 2015-07-02 18:53:04.0
Updated: 2018-03-07 01:05:29.0
Pushed: 2018-01-24 15:30:15.0
Homepage: https://schema.getpostman.com/
Size: 222
Language: null
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
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.
All the schemas in this repository are valid JSON Schemas, compliant with the JSON-Schema, Draft 4. As such, they can be used with a number of tools to validate arbitrary JSON blobs, as show below:
https = require('https'),
validate = require('is-my-json-valid');
input = {
/* JSON of a collection V1 */
e fetch the schema from server and when it is received,
alidate our input JSON against it.
s.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!');
});
https = require('https'),
tv4 = require('tv4');
input = {
/* JSON of a collection V1 */
e fetch the schema from server and when it is received,
alidate our input JSON against it.
s.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!');
});
rt requests # make sure this is installed
jsonschema import validate
jsonschema.exceptions import ValidationError
ma = requests.get('https://schema.getpostman.com/json/collection/v1/').json()
_input = {} # Whatever needs to be validated.
validate(test_input, schema)
pt ValidationError:
print 'It is not a valid collection!'
:
print 'It is a valid collection!'