openapi-utils-schema-from-api

0.0.5 • Public • Published

openapi-utils-schema-from-api

JavaScript Style Guide

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' } } }
*/

Package Sidebar

Install

npm i openapi-utils-schema-from-api

Weekly Downloads

27

Version

0.0.5

License

ISC

Last publish

Collaborators

  • robodo