json-schema-resolve-allof
Resolves AllOf references in JSON schemas into composed models
Last updated 2 years ago by logvol .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install json-schema-resolve-allof 
SYNC missed versions from official npm registry.

JSON Schema Resolve Allof

Some simple code to resolve the allof references in JSON Schema

Usage

npm install json-schema-resolve-allof --save

Usage

var resolveAllOf = require('json-schema-resolve-allof');

resolveAllOf({
  "type": "string",
  "allOf": [{
      "properties": {
        "lastName": {
          "type": "string"
        }
      }
    },
    {
      "properties": {
        "lastName": {
          "type": "string"
        }
      }
    }
  ]
});

// Returns:
// {
//  "type": "string",
//  "properties": {
//    "lastName": {
//      "type": "string"
//    },
//    "lastName": {
//      "type": "string"
//    }
//  }
// }

Command Line Interface

json-schema-resolve-allof can also be used on the command line by piping stdin into it.

For example,

echo '{"allOf": [{"type": "object"}, {"additionalProperties": false}]}' | json-schema-resolve-allof

will return

{"type":"object","additionalProperties":false}

Current Tags

  • 1.5.0                                ...           latest (2 years ago)

8 Versions

  • 1.5.0                                ...           2 years ago
  • 1.3.0                                ...           2 years ago
  • 1.2.0                                ...           3 years ago
  • 1.1.4                                ...           3 years ago
  • 1.1.2                                ...           4 years ago
  • 1.1.1                                ...           4 years ago
  • 1.1.0                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 5
Dependencies (2)
Dev Dependencies (11)

Copyright 2014 - 2017 © taobao.org |