@anyhowstep/json-api-schema
TypeScript icon, indicating that this package has built-in type declarations

2.1.0 • Public • Published

Install

npm install --save @anyhowstep/json-api-schema

Usage

import * as sd from "schema-decorator";
import * as jsonApi from "json-api-schema";

const doc = jsonApi.document(sd.naturalNumber());
doc("test", {
    data : 34,
}); //OK
doc("test", {
    data : 34.5,
}); //Error, data must be a natural number
doc("test", {
}); //Error, must have one of the following, data, errors, meta

Readme

Keywords

none

Package Sidebar

Install

npm i @anyhowstep/json-api-schema

Weekly Downloads

1

Version

2.1.0

License

ISC

Unpacked Size

39.5 kB

Total Files

11

Last publish

Collaborators

  • anyhowstep