@kubb/adapter-oas 5.0.0-beta.4 → 5.0.0-beta.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,100 @@
1
+ <div align="center">
2
+ <a href="https://kubb.dev" target="_blank" rel="noopener noreferrer">
3
+ <img src="https://kubb.dev/og.png" alt="Kubb banner">
4
+ </a>
5
+
6
+ [![npm version][npm-version-src]][npm-version-href]
7
+ [![npm downloads][npm-downloads-src]][npm-downloads-href]
8
+ [![Stars][stars-src]][stars-href]
9
+ [![License][license-src]][license-href]
10
+ [![Node][node-src]][node-href]
11
+
12
+ <h4>
13
+ <a href="https://kubb.dev" target="_blank">Documentation</a>
14
+ <span> · </span>
15
+ <a href="https://github.com/kubb-labs/kubb/issues/" target="_blank">Report Bug</a>
16
+ <span> · </span>
17
+ <a href="https://github.com/kubb-labs/kubb/issues/" target="_blank">Request Feature</a>
18
+ </h4>
19
+ </div>
20
+
21
+ <br />
22
+
23
+ # @kubb/adapter-oas
24
+
25
+ ### OpenAPI and Swagger adapter for Kubb
26
+
27
+ Parses and validates Swagger 2.0, OpenAPI 3.0, and OpenAPI 3.1 specifications and transforms them into a `@kubb/ast` `RootNode` for downstream code generation plugins.
28
+
29
+ ## Installation
30
+
31
+ ```bash
32
+ bun add @kubb/adapter-oas
33
+ # or
34
+ pnpm add @kubb/adapter-oas
35
+ # or
36
+ npm install @kubb/adapter-oas
37
+ ```
38
+
39
+ ## Usage
40
+
41
+ Use `adapterOas` inside your `kubb.config.ts`:
42
+
43
+ ```typescript
44
+ import { defineConfig } from 'kubb'
45
+ import { adapterOas } from '@kubb/adapter-oas'
46
+
47
+ export default defineConfig({
48
+ input: {
49
+ path: './openapi.yaml',
50
+ },
51
+ output: {
52
+ path: './src/gen',
53
+ },
54
+ adapters: [adapterOas()],
55
+ })
56
+ ```
57
+
58
+ ## API
59
+
60
+ ### `adapterOas(options?)`
61
+
62
+ Creates the OAS adapter instance. Pass it in the `adapters` array of `defineConfig`.
63
+
64
+ ### `mergeDocuments(documents)`
65
+
66
+ Merges multiple OpenAPI documents into a single document before parsing.
67
+
68
+ ### Types
69
+
70
+ All OpenAPI types (`Document`, `Operation`, `SchemaObject`, `HttpMethod`, etc.) are re-exported from this package.
71
+
72
+ ## Supporting Kubb
73
+
74
+ Kubb is an open source project, and its development is funded entirely by sponsors. If you would like to become a sponsor, please consider:
75
+
76
+ - [Become a Sponsor on GitHub](https://github.com/sponsors/stijnvanhulle)
77
+ - [See sponsorship tiers and our sponsors](https://kubb.dev/sponsors)
78
+
79
+ <p align="center">
80
+ <a href="https://github.com/sponsors/stijnvanhulle">
81
+ <img src="https://raw.githubusercontent.com/stijnvanhulle/sponsors/main/sponsors.svg" alt="My sponsors" />
82
+ </a>
83
+ </p>
84
+
85
+ ## License
86
+
87
+ [MIT](https://github.com/kubb-labs/kubb/blob/main/licenses/LICENSE-MIT)
88
+
89
+ <!-- Badges -->
90
+
91
+ [npm-version-src]: https://shieldcn.dev/npm/v/@kubb/adapter-oas.svg?variant=secondary&size=xs&theme=zinc&mode=dark
92
+ [npm-version-href]: https://npmx.dev/package/@kubb/adapter-oas
93
+ [npm-downloads-src]: https://shieldcn.dev/npm/dm/@kubb/adapter-oas.svg?variant=secondary&size=xs&theme=zinc&mode=dark
94
+ [npm-downloads-href]: https://npmx.dev/package/@kubb/adapter-oas
95
+ [stars-src]: https://shieldcn.dev/github/stars/kubb-labs/kubb.svg?variant=secondary&size=xs&theme=zinc&mode=dark
96
+ [stars-href]: https://github.com/kubb-labs/kubb
97
+ [license-src]: https://shieldcn.dev/npm/license/@kubb/adapter-oas.svg?variant=secondary&size=xs&theme=zinc
98
+ [license-href]: https://github.com/kubb-labs/kubb/blob/main/LICENSE
99
+ [node-src]: https://shieldcn.dev/npm/node/@kubb/adapter-oas.svg?variant=secondary&size=xs&theme=zinc&mode=dark
100
+ [node-href]: https://npmx.dev/package/@kubb/adapter-oas