Created
September 24, 2025 07:23
-
-
Save InfinityByTen/29d554b9dcde1fe08ff6a399cb05b205 to your computer and use it in GitHub Desktop.
Minimal OpenAPI spec using discriminators
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| openapi: 3.0.3 | |
| info: | |
| title: Discriminator Bug Demo API | |
| description: Minimal example demonstrating discriminator field conflicts in OpenAPI Generator | |
| version: 1.0.0 | |
| paths: | |
| /shape: | |
| post: | |
| summary: Submit a shape | |
| requestBody: | |
| required: true | |
| content: | |
| application/json: | |
| schema: | |
| $ref: '#/components/schemas/Shape' | |
| responses: | |
| '200': | |
| description: Success | |
| content: | |
| application/json: | |
| schema: | |
| $ref: '#/components/schemas/Shape' | |
| components: | |
| schemas: | |
| Shape: | |
| type: object | |
| discriminator: | |
| propertyName: type | |
| mapping: | |
| circle: '#/components/schemas/Circle' | |
| rectangle: '#/components/schemas/Rectangle' | |
| oneOf: | |
| - $ref: '#/components/schemas/Circle' | |
| - $ref: '#/components/schemas/Rectangle' | |
| required: | |
| - type | |
| Circle: | |
| type: object | |
| properties: | |
| type: | |
| type: string | |
| enum: [circle] | |
| radius: | |
| type: number | |
| format: double | |
| required: | |
| - type | |
| - radius | |
| Rectangle: | |
| type: object | |
| properties: | |
| type: | |
| type: string | |
| enum: [rectangle] | |
| width: | |
| type: number | |
| format: double | |
| height: | |
| type: number | |
| format: double | |
| required: | |
| - type | |
| - width | |
| - height |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment