Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

json-schema-deref-sync

Package Overview
Dependencies
Maintainers
4
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-schema-deref-sync

Simple Node.js JSON Schema dereferencer

  • 0.14.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
681K
decreased by-5.64%
Maintainers
4
Weekly downloads
 
Created

What is json-schema-deref-sync?

The json-schema-deref-sync npm package is used to dereference JSON schemas. It resolves all $ref pointers in a JSON schema synchronously, making it easier to work with complex schemas that have multiple references.

What are json-schema-deref-sync's main functionalities?

Dereferencing JSON Schema

This feature allows you to dereference a JSON schema, resolving all $ref pointers. The code sample demonstrates how to use the json-schema-deref-sync package to dereference a schema with internal references.

const deref = require('json-schema-deref-sync');
const schema = {
  "$id": "http://example.com/root.json",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "definitions": {
    "address": {
      "type": "object",
      "properties": {
        "street_address": { "type": "string" },
        "city": { "type": "string" },
        "state": { "type": "string" }
      },
      "required": ["street_address", "city", "state"]
    }
  },
  "type": "object",
  "properties": {
    "billing_address": { "$ref": "#/definitions/address" },
    "shipping_address": { "$ref": "#/definitions/address" }
  }
};
const dereferencedSchema = deref(schema);
console.log(JSON.stringify(dereferencedSchema, null, 2));

Other packages similar to json-schema-deref-sync

Keywords

FAQs

Package last updated on 29 Oct 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