# openapi-jsonschema-parameters

> Converts openapi parameters to a jsonschema format.

Latest version **12.1.3** (published 2023-05-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install openapi-jsonschema-parameters
pnpm add openapi-jsonschema-parameters
yarn add openapi-jsonschema-parameters
bun add openapi-jsonschema-parameters
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 12.1.3 |
| Published | 2023-05-24 |
| First published | 2016-01-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 17.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 921 |
| Author | Joseph Spencer |
| Maintainers | jsdevel, kogo |
| Keywords | openapi, parameters, jsonschema, convert, converter |

## Links

- npm: https://www.npmjs.com/package/openapi-jsonschema-parameters
- Repository: https://github.com/kogosoftwarellc/open-api/tree/master/packages/openapi-jsonschema-parameters
- Homepage: https://github.com/kogosoftwarellc/open-api/tree/master/packages/openapi-jsonschema-parameters#readme
- Issues: https://github.com/kogosoftwarellc/open-api/issues
- npm.io page: https://npm.io/package/openapi-jsonschema-parameters

## Dependencies (1)

- [openapi-types](https://npm.io/package/openapi-types.md) ^12.1.3

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 12.1.3 (latest) — 2023-05-24
- 12.1.2 — 2023-05-24
- 12.1.1 — 2023-05-20
- 12.1.0 — 2022-12-09
- 12.0.2 — 2022-08-31
- 12.0.0 — 2022-06-03
- 11.1.0 — 2022-06-03
- 11.0.1 — 2022-05-16
- 11.0.0 — 2022-04-13
- 10.0.0 — 2021-12-02
- 9.3.1 — 2021-11-12
- 9.3.0 — 2021-08-30
- 9.2.0 — 2021-08-20
- 9.1.0 — 2021-07-06
- 9.0.3 — 2021-06-01
- … 27 more at https://npm.io/package/openapi-jsonschema-parameters/versions

## README

# openapi-jsonschema-parameters [![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Coveralls Status][coveralls-image]][coveralls-url]
> Converts openapi parameters to a jsonschema format.

## Highlights

* No validation on the input or the output.  It is expected that you'll do this with
some other library.
* Performant.
* Extensively tested.
* Small footprint.

## Example

See `./test/data-driven` for more examples.

```javascript
import { convertParametersToJSONSchema } from 'openapi-jsonschema-parameters';

const parametersSchemas = convertParametersToJSONSchema([
  {
    in: 'body',
    name: 'wow',
    schema: {
      $ref: '#/definitions/SomeDefinition'
    }
  },

  {
    in: 'header',
    name: 'Accept',
    type: 'string'
  },

  {
    in: 'path',
    name: 'boo',
    type: 'string'
  },

  {
    in: 'query',
    name: 'foo',
    required: true,
    type: 'string'
  }
]);

console.log(parametersSchema); //=>
// {
//   body: {
//     $ref: '#/definitions/SomeDefinition'
//   },
//
//   headers: {
//     properties: {
//       Accept: {
//         type: 'string'
//       }
//     }
//   },
//
//   path: {
//     properties: {
//       boo: {
//         type: 'string'
//       }
//     }
//   },
//
//   query: {
//     properties: {
//       foo: {
//         type: 'string'
//       }
//     },
//     required: ['foo']
//   }
// }
```


## LICENSE
``````
The MIT License (MIT)

Copyright (c) 2016 Kogo Software LLC

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
``````

[downloads-image]: http://img.shields.io/npm/dm/openapi-jsonschema-parameters.svg
[npm-url]: https://npmjs.org/package/openapi-jsonschema-parameters
[npm-image]: http://img.shields.io/npm/v/openapi-jsonschema-parameters.svg

[travis-url]: https://travis-ci.org/kogosoftwarellc/open-api
[travis-image]: https://api.travis-ci.org/kogosoftwarellc/open-api.svg?branch=master

[coveralls-url]: https://coveralls.io/github/kogosoftwarellc/open-api?branch=main
[coveralls-image]: https://coveralls.io/repos/github/kogosoftwarellc/open-api/badge.svg?branch=main

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