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

@swagger-api/apidom-ns-json-schema-draft-7

Package Overview
Dependencies
Maintainers
1
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@swagger-api/apidom-ns-json-schema-draft-7

JSON Schema Draft 7 namespace for ApiDOM.

  • 0.73.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
190K
decreased by-58.99%
Maintainers
1
Weekly downloads
 
Created

What is @swagger-api/apidom-ns-json-schema-draft-7?

@swagger-api/apidom-ns-json-schema-draft-7 is an npm package that provides tools for working with JSON Schema Draft-7. It is part of the ApiDOM ecosystem, which aims to provide a unified way to work with different API description formats.

What are @swagger-api/apidom-ns-json-schema-draft-7's main functionalities?

Schema Validation

This feature allows you to validate JSON data against a JSON Schema Draft-7 schema. The code sample demonstrates how to validate an object with a required 'name' property.

const { validate } = require('@swagger-api/apidom-ns-json-schema-draft-7');
const schema = { type: 'object', properties: { name: { type: 'string' } }, required: ['name'] };
const data = { name: 'John Doe' };
const result = validate(schema, data);
console.log(result);

Schema Compilation

This feature allows you to compile a JSON Schema Draft-7 schema into a validation function. The code sample demonstrates how to compile a schema and use the resulting function to validate data.

const { compile } = require('@swagger-api/apidom-ns-json-schema-draft-7');
const schema = { type: 'object', properties: { age: { type: 'integer' } }, required: ['age'] };
const validate = compile(schema);
const data = { age: 30 };
const result = validate(data);
console.log(result);

Schema Resolution

This feature allows you to resolve JSON Schema Draft-7 references. The code sample demonstrates how to resolve a schema reference to its actual schema.

const { resolve } = require('@swagger-api/apidom-ns-json-schema-draft-7');
const schema = { $ref: 'http://example.com/schema.json' };
resolve(schema).then(resolvedSchema => console.log(resolvedSchema));

Other packages similar to @swagger-api/apidom-ns-json-schema-draft-7

FAQs

Package last updated on 18 Jul 2023

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