@kubb/adapter-oas 5.0.0-alpha.69 → 5.0.0-alpha.70

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/adapter-oas",
3
- "version": "5.0.0-alpha.69",
3
+ "version": "5.0.0-alpha.70",
4
4
  "description": "OpenAPI / Swagger adapter for Kubb converts OAS input into a @kubb/ast RootNode.",
5
5
  "keywords": [
6
6
  "adapter",
@@ -42,11 +42,11 @@
42
42
  "registry": "https://registry.npmjs.org/"
43
43
  },
44
44
  "dependencies": {
45
- "@redocly/openapi-core": "^2.29.2",
45
+ "@redocly/openapi-core": "^2.30.0",
46
46
  "oas": "^32.1.17",
47
47
  "oas-normalize": "^16.0.4",
48
48
  "swagger2openapi": "^7.0.8",
49
- "@kubb/core": "5.0.0-alpha.69"
49
+ "@kubb/core": "5.0.0-alpha.70"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@types/swagger2openapi": "^7.0.4",
package/src/parser.ts CHANGED
@@ -242,9 +242,11 @@ function createSchemaParser(ctx: OasParserContext) {
242
242
  }
243
243
 
244
244
  const unionMembers = [...(schema.oneOf ?? []), ...(schema.anyOf ?? [])]
245
+ const strategy: 'one' | 'any' = schema.oneOf ? 'one' : 'any'
245
246
  const unionBase = {
246
247
  ...buildSchemaNode(schema, name, nullable, defaultValue),
247
248
  discriminatorPropertyName: isDiscriminator(schema) ? schema.discriminator.propertyName : undefined,
249
+ strategy,
248
250
  }
249
251
  const discriminator = isDiscriminator(schema) ? schema.discriminator : undefined
250
252
  const sharedPropertiesNode = schema.properties