Skip to content

Commit 450a126

Browse files
Update issue_21587 unit test to catch the Array<Model> case
1 parent b9cd2db commit 450a126

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchClientCodegenTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,7 @@ public void testOneOfModelsImportNonPrimitiveTypes() throws IOException {
441441
);
442442
TestUtils.assertFileContains(testResponse, "import type { OptionOne } from './OptionOne'");
443443
TestUtils.assertFileContains(testResponse, "import type { OptionTwo } from './OptionTwo'");
444+
TestUtils.assertFileContains(testResponse, "import type { OptionThree } from './OptionThree'");
444445
}
445446

446447
private static File generate(

modules/openapi-generator/src/test/resources/3_0/typescript-fetch/issue_21587.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ paths:
2020
oneOf:
2121
- $ref: '#/components/schemas/OptionOne'
2222
- $ref: '#/components/schemas/OptionTwo'
23+
- type: array
24+
items:
25+
$ref: '#/components/schemas/OptionThree'
2326
- type: string
2427
enum:
2528
- "fixed-value-a"
@@ -66,4 +69,11 @@ components:
6669
title: OptionTwo
6770
properties:
6871
propTwo:
69-
type: string
72+
type: string
73+
OptionThree:
74+
type: object
75+
title: OptionThree
76+
properties:
77+
propThree:
78+
type: boolean
79+
additionalProperties: true

0 commit comments

Comments
 (0)