[BUG] Missing attributes from allOf when target contains oneOf using python-flask
Created by: Holt59
Description
When using the python-flask
generator where a component contains a allOf
targeting a component with a oneOf
, the extra properties of the targeted element are missing from the extending element.
Note: This might be a misunderstanding of the OpenAPI specification on my side. If so, feel free to tell me and close this issue / point me to the specification details.
openapi-generator version
5.3.0
OpenAPI declaration file content or url
---
openapi: 3.0.3
info:
title: Demo
version: "1.0.0"
paths:
/Route:
post:
requestBody:
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/ClassB"
required: true
responses:
"200":
description: Successful operation.
content: {}
"500":
description: Error during operation.
content: {}
components:
schemas:
ClassA:
type: object
properties:
x:
type: integer
format: int32
y:
type: number
ClassB:
type: object
oneOf:
- type: object
properties:
y:
type: number
- type: object
properties:
u:
type: array
items:
$ref: '#/components/schemas/ClassA'
properties:
z:
type: string
ClassC:
type: object
properties:
a:
type: number
ClassD:
type: object
allOf:
- $ref: "#/components/schemas/ClassB"
- properties:
t:
$ref: "#/components/schemas/ClassC"
Generation Details / Steps to reproduce
Single command to generate the python server:
java -jar ./openapi-generator-cli-5.3.0.jar generate -i ./openapi.yml -g python-flask -o ./server
The generated ClassD
only contains the y
, u
and t
attributes, and is missing the z
one. Below is the generated __init__
class of ClassD
:
def __init__(self, y=None, u=None, t=None): # noqa: E501
"""ClassD - a model defined in OpenAPI
:param y: The y of this ClassD. # noqa: E501
:type y: float
:param u: The u of this ClassD. # noqa: E501
:type u: List[ClassA]
:param t: The t of this ClassD. # noqa: E501
:type t: ClassC
"""
self.openapi_types = {
'y': float,
'u': List[ClassA],
't': ClassC
}
self.attribute_map = {
'y': 'y',
'u': 'u',
't': 't'
}
self._y = y
self._u = u
self._t = t