Skip to content
This repository was archived by the owner on May 7, 2026. It is now read-only.

Remove Unions#137

Merged
rosesyrett merged 2 commits into
masterfrom
removeUnions
Nov 30, 2022
Merged

Remove Unions#137
rosesyrett merged 2 commits into
masterfrom
removeUnions

Conversation

@rosesyrett
Copy link
Copy Markdown
Contributor

In the last release, Unions were used in some response models, either directly or indirectly, i.e.

@async.get("...", response_model = CoordinateResponse)

CoordinateResponse(BaseModel):
    payload: Union[ .... ]

Or,

@async.get("...", response_model = Union[ArrayResponse, InfoResponse])

Swagger codegen has issues with accurately reproducing java client code that contains oneOf or anyOf, which are generated in the openapi schema by these response models. Therefore, I'm removing them.

@rosesyrett
Copy link
Copy Markdown
Contributor Author

Found the following issue for more detail: swagger-api/swagger-codegen#10011

It has been closed but it is unclear to me what the fix is. For now I will just avoid using Unions in models altogether.

@rosesyrett rosesyrett merged commit 930e098 into master Nov 30, 2022
@rosesyrett rosesyrett deleted the removeUnions branch November 30, 2022 12:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant