Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Unions #137

Merged
merged 2 commits into from
Nov 30, 2022
Merged

Remove Unions #137

merged 2 commits into from
Nov 30, 2022

Conversation

rosesyrett
Copy link
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
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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant