🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

json-schema-static-docs

Package Overview
Dependencies
Maintainers
0
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-schema-static-docs

Generates static documentation for humans based on the contents of JSON schema files (yml or json).

0.28.1
latest
Source
npm
Version published
Weekly downloads
857
13.06%
Maintainers
0
Weekly downloads
 
Created
Source

Json Schema Static Docs

npm version CircleCI

Description

Generates static documentation for humans based on the contents of JSON schema files (yml or json).

Support for JSON schema specification versions

Currently supports schema specified using the following specification versions: draft-06, draft-07, draft-2019-09, and draft 2020-12.

For complete documentation, including examples and supported keywords, see tomcollins.github.io/json-schema-static-docs.

Installation

npm install json-schema-static-docs

Usage

See the docs for more details.

const JsonSchemaStaticDocs = require("json-schema-static-docs");

(async () => {
  let jsonSchemaStaticDocs = new JsonSchemaStaticDocs({
    inputPath: "./schema",
    outputPath: "./docs",
    ajvOptions: {
      allowUnionTypes: true,
    },
  });
  await jsonSchemaStaticDocs.generate();
  console.log("Documents generated.");
})();

How to use draft-2020-12

To use schema based on draft-2020-12 set options.jsonSchemaVersion to https://json-schema.org/draft/2020-12/schema.

const JsonSchemaStaticDocs = require("json-schema-static-docs");

(async () => {
  let jsonSchemaStaticDocs = new JsonSchemaStaticDocs({
    inputPath: "./schema",
    outputPath: "./docs",
    jsonSchemaVersion: "https://json-schema.org/draft/2020-12/schema",
    ajvOptions: {
      allowUnionTypes: true,
    },
  });
  await jsonSchemaStaticDocs.generate();
  console.log("Documents generated.");
})();

All schema documents must use must use draft-2020-12, you can not combine this with earlier versions such as draft-07.

FAQs

Package last updated on 03 Jan 2025

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