Socket
Socket
Sign inDemoInstall

@apidevtools/json-schema-ref-parser

Package Overview
Dependencies
Maintainers
2
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@apidevtools/json-schema-ref-parser

Parse, Resolve, and Dereference JSON Schema $ref pointers


Version published
Maintainers
2
Created

What is @apidevtools/json-schema-ref-parser?

The @apidevtools/json-schema-ref-parser package is a powerful tool for working with JSON Schemas. It allows users to parse JSON Schemas, resolve all $ref pointers to their corresponding values, and can bundle multiple files into a single schema. This package is particularly useful for developers working with complex JSON Schemas that include multiple references to other schemas or definitions.

What are @apidevtools/json-schema-ref-parser's main functionalities?

Dereferencing JSON Schemas

This feature allows you to take a JSON Schema that contains $ref pointers and resolve all references, resulting in a fully dereferenced schema. This is useful for understanding and validating the full structure of a schema without having to manually follow references.

{"const parser = require('@apidevtools/json-schema-ref-parser');\n\nlet schema = {\n  $ref: 'http://example.com/my-schema.json'\n};\n\nparser.dereference(schema).then(function(schema) {\n  console.log('Schema:', schema);\n}).catch(function(err) {\n  console.error(err);\n});"}

Bundling JSON Schemas

This feature bundles a JSON Schema and all its references into a single schema file. This is particularly useful for distribution or for loading a schema into tools that do not support $ref pointers.

{"const parser = require('@apidevtools/json-schema-ref-parser');\n\nlet schema = {\n  $ref: 'http://example.com/my-schema.json'\n};\n\nparser.bundle(schema).then(function(schema) {\n  console.log('Bundled schema:', schema);\n}).catch(function(err) {\n  console.error(err);\n});"}

Other packages similar to @apidevtools/json-schema-ref-parser

Keywords

FAQs

Package last updated on 19 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc