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

Add support for union type in payload #301

Merged
merged 1 commit into from
Jan 30, 2022

Conversation

AkeemMcLennon
Copy link

@AkeemMcLennon AkeemMcLennon commented Dec 14, 2021

@vitalik This MR adds support for defining a request body as a union of two schemas.

Prior to this change, a payload with the union type would be incorrectly classified as a query parameter, and fail to appear within the list of components defined in the OpenAPI schema

@vitalik
Copy link
Owner

vitalik commented Dec 15, 2021

Hi @AkeemMcLennon

you need to to use get_origin from ninja/compatibility/util.py
(to support python 3.6, 3.7 etc)

@AkeemMcLennon
Copy link
Author

@vitalik Ah, thanks. Updated

@AkeemMcLennon
Copy link
Author

AkeemMcLennon commented Dec 15, 2021

@vitalik Just fixed codestyle linting errors as well

@vitalik vitalik merged commit f81de34 into vitalik:master Jan 30, 2022
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.

None yet

3 participants