@kubb/adapter-oas 5.0.0-beta.51 → 5.0.0-beta.52
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/dist/index.cjs.map +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/resolvers.ts +1 -1
- package/src/types.ts +1 -20
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/adapter-oas",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.52",
|
|
4
4
|
"description": "OpenAPI and Swagger adapter for Kubb. Parses and validates OAS 2.0/3.x specifications into a @kubb/ast RootNode for downstream code generation plugins.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"adapter",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"oas": "^32.1.18",
|
|
48
48
|
"oas-normalize": "^16.0.5",
|
|
49
49
|
"swagger2openapi": "^7.0.8",
|
|
50
|
-
"@kubb/ast": "5.0.0-beta.
|
|
51
|
-
"@kubb/core": "5.0.0-beta.
|
|
50
|
+
"@kubb/ast": "5.0.0-beta.52",
|
|
51
|
+
"@kubb/core": "5.0.0-beta.52"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@types/swagger2openapi": "^7.0.4",
|
package/src/resolvers.ts
CHANGED
|
@@ -223,7 +223,7 @@ type SchemaSourceMode = 'schemas' | 'responses' | 'requestBodies'
|
|
|
223
223
|
/**
|
|
224
224
|
* A schema annotated with its component section source and original name. Used by `resolveNameCollisions` for cross-source collision resolution.
|
|
225
225
|
*/
|
|
226
|
-
|
|
226
|
+
type SchemaWithMetadata = {
|
|
227
227
|
schema: SchemaObject
|
|
228
228
|
source: SchemaSourceMode
|
|
229
229
|
originalName: string
|
package/src/types.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// external packages
|
|
2
2
|
|
|
3
3
|
import type { AdapterFactoryOptions } from '@kubb/core'
|
|
4
|
-
import { ast } from '@kubb/core'
|
|
4
|
+
import type { ast } from '@kubb/core'
|
|
5
5
|
import type { Operation as OASOperation } from 'oas/operation'
|
|
6
6
|
import type {
|
|
7
7
|
DiscriminatorObject as OASDiscriminatorObject,
|
|
@@ -12,11 +12,6 @@ import type {
|
|
|
12
12
|
} from 'oas/types'
|
|
13
13
|
import type { OpenAPIV3 } from 'openapi-types'
|
|
14
14
|
|
|
15
|
-
/**
|
|
16
|
-
* Re-exports of `openapi-types` for use by adapter consumers.
|
|
17
|
-
*/
|
|
18
|
-
export type { OpenAPIV3, OpenAPIV3_1 } from 'openapi-types'
|
|
19
|
-
|
|
20
15
|
/**
|
|
21
16
|
* Content-type string for selecting request/response schemas from an OpenAPI spec.
|
|
22
17
|
* Supports `'application/json'` or any other media type.
|
|
@@ -73,20 +68,6 @@ export type SchemaObject = OASSchemaObject & {
|
|
|
73
68
|
enum?: Array<string | number | boolean | null>
|
|
74
69
|
}
|
|
75
70
|
|
|
76
|
-
/**
|
|
77
|
-
* Maps uppercase HTTP method names to lowercase for backwards compatibility.
|
|
78
|
-
*
|
|
79
|
-
* @example
|
|
80
|
-
* ```ts
|
|
81
|
-
* HttpMethods['GET'] // 'get'
|
|
82
|
-
* HttpMethods['POST'] // 'post'
|
|
83
|
-
* ```
|
|
84
|
-
*/
|
|
85
|
-
export const HttpMethods = Object.fromEntries(Object.entries(ast.httpMethods).map(([lower, upper]) => [upper, lower])) as Record<
|
|
86
|
-
Uppercase<ast.HttpMethod>,
|
|
87
|
-
Lowercase<ast.HttpMethod>
|
|
88
|
-
>
|
|
89
|
-
|
|
90
71
|
/**
|
|
91
72
|
* HTTP method as a lowercase string (`'get' | 'post' | ...`).
|
|
92
73
|
*/
|