GitXplorerGitXplorer
o

openapi-utils-param-to-schema

public
0 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
4e84bc9a2ee662c304dcdd616907e89f4f48e993

0.0.9

oorangewise committed 8 years ago
Unverified
dab53e0eb70661f988747313cb5a838e93becb8e

0.0.8

oorangewise committed 8 years ago
Unverified
ea140c438d9760c26745f5f11dbc79aa6be16384

using standard style

oorangewise committed 8 years ago
Unverified
dca83b9c6b09484be02f9be397e57f95584d24e1

0.0.7

oorangewise committed 8 years ago
Unverified
9f21181536076bbfa2dfe2cbe3f3f5a3c658732a

return param schema if it is there

oorangewise committed 8 years ago
Unverified
402b318cb9cc0fad57ab08506c613230dc5bf8d5

0.0.6

oorangewise committed 8 years ago

README

The README file for this repository.

openapi-utils-param-to-schema

npm version Build Status JavaScript Style Guide

Convert a param into a schema.

Installation

npm install --save openapi-utils-param-to-schema

Usage

var openApiUtils = require('openapi-utils-param-to-schema')

var postalCodeParam = {
  "name": "postalCode",
  "in": "query",
  "required": true,
  "type": "string",
  "pattern": "^[1-9][0-9]{3} ?(?!sa|sd|ss)[A-Z]{2}$"
}

var schema1 = openApiUtils.paramToSchema(postalCodeParam)
console.log(schema1)
/*
{
  "required": ["postalCode"],
  "properties": {
    "postalCode": {
      "type": "string",
      "pattern": "^[1-9][0-9]{3} ?(?!sa|sd|ss)[A-Z]{2}$"
    }
  }
}
*/