Skip to content

Commit 115dca6

Browse files
chore: update tests
1 parent b78050a commit 115dca6

File tree

1 file changed

+134
-0
lines changed

1 file changed

+134
-0
lines changed

test.yaml

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12493,6 +12493,28 @@ paths:
1249312493
schema:
1249412494
$ref: "#/components/schemas/AnyOfMultiMatch"
1249512495

12496+
/anything/crossRefUnions:
12497+
get:
12498+
operationId: crossRefUnions
12499+
summary: GEN-2264 - Test cross-referencing discriminated unions
12500+
description: |
12501+
Tests two mutually referencing unions where one union's array variant
12502+
references a different union (not itself). This tests the one-way
12503+
dependency ordering fix.
12504+
tags: [unions]
12505+
responses:
12506+
"200":
12507+
description: OK
12508+
content:
12509+
application/json:
12510+
schema:
12511+
type: object
12512+
properties:
12513+
unionA:
12514+
$ref: "#/components/schemas/CrossRefUnionA"
12515+
unionB:
12516+
$ref: "#/components/schemas/CrossRefUnionB"
12517+
1249612518
/anything/smartUnion/openEnums:
1249712519
post:
1249812520
operationId: smartUnionOpenEnums
@@ -13697,6 +13719,118 @@ components:
1369713719
type: string
1369813720
required: [name, description]
1369913721

13722+
# GEN-2264: Test case for two mutually referencing unions where one union's
13723+
# array variant references a DIFFERENT union (not itself). This tests the
13724+
# one-way dependency ordering fix where a union depends on a local class
13725+
# that doesn't reference back to the same union.
13726+
# Pattern: CrossRefUnionA's array -> CrossRefUnionB
13727+
# CrossRefUnionB's object -> CrossRefUnionA
13728+
CrossRefUnionA:
13729+
description: Union A - array variant references CrossRefUnionB (different union).
13730+
anyOf:
13731+
- type: object
13732+
title: CrossRefUnionAText
13733+
description: A text field
13734+
properties:
13735+
type:
13736+
type: string
13737+
const: text
13738+
label:
13739+
type: string
13740+
required:
13741+
- label
13742+
- type
13743+
- type: object
13744+
title: CrossRefUnionANumber
13745+
description: A number field
13746+
properties:
13747+
type:
13748+
type: string
13749+
const: number
13750+
label:
13751+
type: string
13752+
required:
13753+
- label
13754+
- type
13755+
- type: object
13756+
title: CrossRefUnionAArray
13757+
description: An array field containing CrossRefUnionB items
13758+
properties:
13759+
type:
13760+
type: string
13761+
const: array
13762+
label:
13763+
type: string
13764+
item_type:
13765+
$ref: "#/components/schemas/CrossRefUnionB"
13766+
required:
13767+
- label
13768+
- type
13769+
- item_type
13770+
discriminator:
13771+
propertyName: type
13772+
CrossRefUnionB:
13773+
description: Union B - object variant references CrossRefUnionA, array variant is self-referential.
13774+
anyOf:
13775+
- type: object
13776+
title: CrossRefUnionBText
13777+
description: A text field
13778+
properties:
13779+
type:
13780+
type: string
13781+
const: text
13782+
label:
13783+
type: string
13784+
required:
13785+
- label
13786+
- type
13787+
- type: object
13788+
title: CrossRefUnionBNumber
13789+
description: A number field
13790+
properties:
13791+
type:
13792+
type: string
13793+
const: number
13794+
label:
13795+
type: string
13796+
required:
13797+
- label
13798+
- type
13799+
- type: object
13800+
title: CrossRefUnionBObject
13801+
description: An object field with properties from CrossRefUnionA
13802+
properties:
13803+
type:
13804+
type: string
13805+
const: object
13806+
label:
13807+
type: string
13808+
properties:
13809+
type: object
13810+
additionalProperties:
13811+
$ref: "#/components/schemas/CrossRefUnionA"
13812+
required:
13813+
- label
13814+
- type
13815+
- properties
13816+
- type: object
13817+
title: CrossRefUnionBArray
13818+
description: An array field containing CrossRefUnionB items (self-ref)
13819+
properties:
13820+
type:
13821+
type: string
13822+
const: array
13823+
label:
13824+
type: string
13825+
item_type:
13826+
$ref: "#/components/schemas/CrossRefUnionB"
13827+
required:
13828+
- label
13829+
- type
13830+
- item_type
13831+
discriminator:
13832+
propertyName: type
13833+
1370013834
ExampleVehicle:
1370113835
type: object
1370213836
oneOf:

0 commit comments

Comments
 (0)