Skip to content

omermecitoglu/json-schema-types

Repository files navigation

JSON Schema (Draft 2020-12) Types

npm version npm downloads codecov License: MIT GitHub last commit GitHub issues GitHub stars

TypeScript types for the JSON Schema Specification.

Installation

You can install this package via npm:

npm install -D @omer-x/json-schema-types

or via yarn:

yarn add -D @omer-x/json-schema-types

Usage

Import the types you need in your TypeScript project:

import { SchemaObject } from '@omer-x/json-schema-types';

// Example usage
const jsonSchema: SchemaObject = {
  type: "string"
};

You can also import specific types directly:

import type { ObjectSchema } from "./@omer-x/json-schema-types/object";
import type { ArraySchema } from "./@omer-x/json-schema-types/array";
import type { BooleanSchema } from "./@omer-x/json-schema-types/boolean";
import type { StringSchema } from "./@omer-x/json-schema-types/string";
import type { NumberSchema } from "./@omer-x/json-schema-types/number";
import type { IntegerSchema } from "./@omer-x/json-schema-types/integer";
import type { NullSchema } from "./@omer-x/json-schema-types/null";
import type { UnknownSchema } from "./@omer-x/json-schema-types/unknown";

License

This project is licensed under the MIT License. See the LICENSE file for details.