Skip to content

Instantly share code, notes, and snippets.

@Gerschtli
Created June 24, 2024 15:07
Show Gist options
  • Save Gerschtli/197faf5d172bcaf63d08cedaa364107f to your computer and use it in GitHub Desktop.
Save Gerschtli/197faf5d172bcaf63d08cedaa364107f to your computer and use it in GitHub Desktop.
Example for OpenAPI generator bug report
openapi: '3.0.3'
info:
title: API Title
version: '1.0'
servers:
- url: https://api.server.test/v1
paths: {}
components:
schemas:
Test:
type: object
additionalProperties: false
discriminator:
propertyName: type
mapping:
A: "#/components/schemas/TestA"
B: "#/components/schemas/TestB"
anyOf:
- $ref: "#/components/schemas/TestA"
- $ref: "#/components/schemas/TestB"
properties:
type:
enum:
- A
- B
type: string
TestA:
additionalProperties: false
type: object
allOf:
- $ref: "#/components/schemas/Test"
properties:
keyA:
enum:
- X
- Y
type: string
TestB:
additionalProperties: false
type: object
allOf:
- $ref: "#/components/schemas/Test"
properties:
keyB:
type: string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment