openapi-utils-schema-from-api
v0.0.5
Published
Extract schema from openapi definition
Downloads
132
Maintainers
Readme
openapi-utils-schema-from-api
Extract schema from openapi definition.
Installation
npm install --save openapi-utils-schema-from-api
Usage
var openApiUtils = require('openapi-utils-schema-from-api')
var api = {
"definitions": {
"Cat": {
"type": "object",
"properties": {
"id": {
"type": "string"
}
}
}
}
}
var schema = openApiUtils.schemaFromApi(api, { 'schema': { '$ref': '#/definitions/Cat' } } )
console.log(schema)
/*
{ type: 'object', properties: { id: { type: 'string' } } }
*/