Skip to content

Commit bf9affc

Browse files
committed
#21582 [BUG][dart-dio] Bug generating inline enums with common names added petstore test
1 parent 2f0d5bd commit bf9affc

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

modules/openapi-generator/src/test/resources/3_0/dart/petstore-with-fake-endpoints-models-for-testing.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1303,6 +1303,19 @@ paths:
13031303
responses:
13041304
200:
13051305
description: The instance started successfully
1306+
/fake/duplicate-inline-enums:
1307+
get:
1308+
tags:
1309+
- fake
1310+
summary: test objects with duplicate inline enums see issue# 21582
1311+
operationId: fake-duplicate-inline-enum
1312+
responses:
1313+
'200':
1314+
description: OK
1315+
content:
1316+
application/json:
1317+
schema:
1318+
$ref: '#/components/schemas/ObjectThatReferencesObjectsWithDuplicateInlineEnums'
13061319
servers:
13071320
- url: 'http://{server}.swagger.io:{port}/v2'
13081321
description: petstore server
@@ -2081,3 +2094,36 @@ components:
20812094
$ref: '#/components/schemas/TestEnum'
20822095
default: ""
20832096
title: TestItem
2097+
ObjectWithInlineEnum:
2098+
type: object
2099+
properties:
2100+
attribute:
2101+
description: 'Object one attribute enum'
2102+
type: 'array'
2103+
uniqueItems: true
2104+
items:
2105+
type: 'string'
2106+
enum: [
2107+
'value_one',
2108+
'value_two'
2109+
]
2110+
ObjectWithDuplicateInlineEnum:
2111+
type: object
2112+
properties:
2113+
attribute:
2114+
description: 'Object two attribute enum'
2115+
type: 'array'
2116+
uniqueItems: true
2117+
items:
2118+
type: 'string'
2119+
enum: [
2120+
'value_one',
2121+
'value_two'
2122+
]
2123+
ObjectThatReferencesObjectsWithDuplicateInlineEnums:
2124+
type: object
2125+
properties:
2126+
object_one:
2127+
$ref: '#/components/schemas/ObjectWithInlineEnum'
2128+
object_two:
2129+
$ref: '#/components/schemas/ObjectWithDuplicateInlineEnum'

0 commit comments

Comments
 (0)