Skip to content

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.

2 participants