# @basketry/openapi-3

> Basketry parser for OpenAPI 3.x service definitions

Latest version **0.2.4** (published 2025-08-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install @basketry/openapi-3
pnpm add @basketry/openapi-3
yarn add @basketry/openapi-3
bun add @basketry/openapi-3
```

Provides the command `basketry-openapi-3`.

## Health

**Score 40/100 (D)** — status: maintenance-mode.

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

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

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.4 |
| Published | 2025-08-23 |
| First published | 2022-10-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 786.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 0 |
| Author | Steve Konves |
| Maintainers | skonves |

## Links

- npm: https://www.npmjs.com/package/@basketry/openapi-3
- Repository: https://github.com/basketry/openapi-3
- Homepage: https://basketry.io/docs/components/@basketry/openapi-3
- Issues: https://github.com/basketry/openapi-3/issues
- Funding: https://github.com/sponsors/basketry
- npm.io page: https://npm.io/package/@basketry/openapi-3

## Dependencies (7)

- [case](https://npm.io/package/case.md) ^1.6.3
- [semver](https://npm.io/package/semver.md) ^7.3.5
- [basketry](https://npm.io/package/basketry.md) ^0.2.1
- [pluralize](https://npm.io/package/pluralize.md) ^8.0.0
- [json-to-ast](https://npm.io/package/json-to-ast.md) ^2.1.0
- [@basketry/ast](https://npm.io/package/@basketry/ast.md) ^0.2.0
- [yaml-ast-parser](https://npm.io/package/yaml-ast-parser.md) ^0.0.43

## Recent versions

- 0.2.4 (latest) — 2025-08-23
- 0.2.0-rc.0 (rc) — 2025-07-31
- 0.2.0-alpha.4 (alpha) — 2025-07-27
- 0.2.3 — 2025-08-16
- 0.2.2 — 2025-08-14
- 0.2.1 — 2025-08-13
- 0.2.0 — 2025-08-10
- 0.2.0-alpha.3 — 2025-07-26
- 0.2.0-alpha.2 — 2025-05-28
- 0.1.6 — 2025-05-20
- 0.1.5 — 2025-05-13
- 0.1.4 — 2025-04-30
- 0.1.3 — 2025-04-23
- 0.2.0-alpha.1 — 2025-03-09
- 0.1.2 — 2024-05-20
- … 10 more at https://npm.io/package/@basketry/openapi-3/versions

## README

[![main](https://github.com/basketry/openapi-3/workflows/build/badge.svg?branch=main&event=push)](https://github.com/basketry/openapi-3/actions?query=workflow%3Abuild+branch%3Amain+event%3Apush)
[![master](https://img.shields.io/npm/v/@basketry/openapi-3)](https://www.npmjs.com/package/@basketry/openapi-3)

# OpenAPI 3.x

[Basketry parser](https://github.com/basketry/basketry) for OpenAPI 3.x service definitions. This parser can be coupled with any Basketry generator to translate a OpenAPI 3.x document into other artifacts including servers, clients, and human-readable documentation.

## Quick Start

The following example converts an OpenAPI doc into Typescript types:

1. Save `https://petstore.swagger.io/v2/swagger.json` as `petstore.json` in the root of your project.
1. Install packages: `npm install -g basketry @basketry/openapi-3 @basketry/typescript`
1. Generate code: `basketry --source petstore.json --parser @basketry/openapi-3 --generators @basketry/typescript --output src`

When the last step is run, basketry will parse the source file (`petstore.json`) using the specified parser (`@basketry/openapi-3`) and then run each specified generator (in this case only `@basketry/typescript`) writing the output folder (`src`).

---

## For contributors:

### Run this project

1.  Install packages: `npm ci`
1.  Build the code: `npm run build`
1.  Run it! `npm start`

Note that the `lint` script is run prior to `build`. Auto-fixable linting or formatting errors may be fixed by running `npm run fix`.

### Create and run tests

1.  Add tests by creating files with the `.test.ts` suffix
1.  Run the tests: `npm t`
1.  Test coverage can be viewed at `/coverage/lcov-report/index.html`

### Publish a new package version

1. Create new version
   1. Navigate to the [version workflow](https://github.com/basketry/openapi-3/actions/workflows/version.yml) from the Actions tab.
   1. Manually dispatch the action with the appropriate inputs
   1. This will create a PR with the new version
1. Publish to NPM
   1. Review and merge the PR
   1. The [publish workflow](https://github.com/basketry/openapi-3/actions/workflows/publish.yml) will create a git tag and publish the package on NPM

---

Generated with [generator-ts-console](https://www.npmjs.com/package/generator-ts-console)

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