mig-schema-tools
v1.0.1
Published
## Installation
Downloads
71
Keywords
Readme
mig-schema-tools
Installation
npm install --save mig-schema-tools
Usage
Create a file called ./inc/schema.ts
;
import openapi from './openapi.json';
import init from 'mig-schema-tools';
export default init(openapi);
Now in another file
import { resolvedOpenApi, ajv, getEmptyObject} from './inc/schema';
// resolvedOpenApi is a version of openapi where all references are "flattened" into plain objects
// ajv is an AJV instance configured for the given openapi.json
// getEmptyObject can create empty Objects based on a given schema