Open olivierbeaulieu opened 3 years ago
👍 Thanks for opening this issue! 🏷 I have applied any labels matching special text in your issue.
The team will review the labels and make any necessary changes.
I am facing the same issue, @olivierbeaulieu were you able to find any fix or workaround for this issue?
We just avoided allOf
s :(
Also Facing this issue
Probably the same as https://github.com/OpenAPITools/openapi-generator/issues/16150
we are using version 7.4 for python, has a similar issue
// spec
schemas:
Cat:
type: object
allOf:
- $ref: "#/components/schemas/Kitty"
- $ref: "#/components/schemas/Tiger"
Kitty:
type: object
oneOf:
- $ref: "#/components/schemas/Kitty1"
- $ref: "#/components/schemas/Kitty2"
Kitty1:
type: object
properties:
size:
type: integer
Kitty2:
type: object
properties:
food:
type: integer
Tiger:
type: object
properties:
color:
type: string
the cat class should be
# data type: Kitty1
oneof_schema_1_validator: Optional[Kitty1] = None
# data type: Kitty2
oneof_schema_2_validator: Optional[Kitty2] = None
actual_instance: Optional[Union[Kitty1, Kitty2]] = None
one_of_schemas: Set[str] = { "Kitty1", "Kitty2" }
but we get:
class Cat(BaseModel):
"""
Cat
""" # noqa: E501
size: Optional[StrictInt] = None
food: Optional[StrictInt] = None
color: Optional[StrictStr] = None
__properties: ClassVar[List[str]] = ["size", "food", "color"]
Bug Report Checklist
Description
Using the typescript-axios generator fails to properly generate the client when using
allOf
with a combination of a$ref
and an object.openapi-generator version
5.1.0
OpenAPI declaration file content or url
swagger.yml:
Generation Details
Steps to reproduce
1) Run the above script 2) Look at the generated
api.ts
3) Notice thatfoobarGet
returnsAxiosPromise<SomeSchema & object>
I would expect the return type to be
AxiosPromise<SomeSchema & { foobar?: string }>