# openapi-utils-param-to-schema

> Create a schema from a openapi param

Latest version **0.0.9** (published 2016-12-11) · ISC license · 0 weekly downloads

## Install

```sh
npm install openapi-utils-param-to-schema
pnpm add openapi-utils-param-to-schema
yarn add openapi-utils-param-to-schema
bun add openapi-utils-param-to-schema
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.9 |
| Published | 2016-12-11 |
| First published | 2016-11-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Ronald Luitwieler |
| Maintainers | robodo |
| Keywords | openapi, param, schema |

## Links

- npm: https://www.npmjs.com/package/openapi-utils-param-to-schema
- Repository: https://github.com/orangewise/openapi-utils-param-to-schema
- Homepage: https://github.com/orangewise/openapi-utils-param-to-schema#readme
- Issues: https://github.com/orangewise/openapi-utils-param-to-schema/issues
- npm.io page: https://npm.io/package/openapi-utils-param-to-schema

## Alternatives

- [@regle/core](https://npm.io/package/@regle/core.md) — 47.0K weekly downloads
- [typeof-arguments](https://npm.io/package/typeof-arguments.md) — 12.5K weekly downloads
- [@lokalise/projects-engine-contracts](https://npm.io/package/@lokalise/projects-engine-contracts.md) — 978 weekly downloads
- [@osjwnpm/nam-laboriosam-quibusdam](https://npm.io/package/@osjwnpm/nam-laboriosam-quibusdam.md) — 70 weekly downloads
- [@oridune/validator](https://npm.io/package/@oridune/validator.md) — 16 weekly downloads

## Recent versions

- 0.0.9 (latest) — 2016-12-11
- 0.0.8 — 2016-11-25
- 0.0.7 — 2016-11-21
- 0.0.6 — 2016-11-12
- 0.0.5 — 2016-11-08
- 0.0.4 — 2016-11-07

## README

# openapi-utils-param-to-schema

[![npm version][npm-badge]][npm-url]
[![Build Status][travis-badge]][travis-url]
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)

Convert a param into a schema.

# Installation

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

# Usage

```javascript
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}$"
    }
  }
}
*/
```

[npm-badge]: https://badge.fury.io/js/openapi-utils-param-to-schema.svg
[npm-url]: https://badge.fury.io/js/openapi-utils-param-to-schema
[travis-badge]: https://travis-ci.org/orangewise/openapi-utils-param-to-schema.svg?branch=master
[travis-url]: https://travis-ci.org/orangewise/openapi-utils-param-to-schema

---
_Source: https://npm.io/package/openapi-utils-param-to-schema · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
