martin-mfg b6db4f73f1
[JAVA] fix: oneOf generates incorrect model for primitive types (#16834)
* generate samples

* try fix

* add new sample for fixed case

* also improve native library

Other libraries don't need fixes.

* add oneOf_twoPrimitives.yaml

* generate samples

* resolve comment
2023-10-16 22:18:52 +08:00

30 lines
672 B
YAML

openapi: 3.0.3
info:
description: "oneOf with two entries of type string, see https://github.com/OpenAPITools/openapi-generator/issues/10450"
title: oneOf two primitives
version: 1.0.0
servers:
- url: /
paths:
/myExample:
post:
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/_myExample_post_request'
responses:
"200":
description: OK
x-content-type: application/json
x-accepts: application/json
components:
schemas:
_myExample_post_request:
oneOf:
- format: ipv4
type: string
- format: ipv6
type: string