We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug When try to send enum values the payload send is the string of the class
To Reproduce Execute the following code:
from enum import Enum class OptionType(Enum): OP1 = 'FirstOp' OP2 = 'SecondOp' OP3 = 'ThirdOp' class SomeAPI(Consumer): @returns.json() @get("/path") def list_elements(self, option_type: Query(type=OptionType), page: Query(type=int) = 0, limit: Query(type=int) = 100 ): """ Get list """ ... if __name__ == '__main__': session = requests.Session() client = SomeAPI('http://localhost:5000', client=session) resp = client.list_elements(option_type=OptionType.OP1)
The payload send to the server is: {'option_type': 'OptionType.OP1', 'page': '0', 'limit': '100'}
{'option_type': 'OptionType.OP1', 'page': '0', 'limit': '100'}
Expected behavior The payload expected is: {'option_type': 'FirstOp', 'page': '0', 'limit': '100'}
{'option_type': 'FirstOp', 'page': '0', 'limit': '100'}
Additional context I think the issue is on the function Sequence.convert
The text was updated successfully, but these errors were encountered:
I will try to fix it and adding test when i have some time to do it
Sorry, something went wrong.
Fix enum conversion
a78271c
Issue prkumar#281 TODO tests
Test for fix enum conversion
8e1bc88
Fix prkumar#281
Successfully merging a pull request may close this issue.
Describe the bug
When try to send enum values the payload send is the string of the class
To Reproduce
Execute the following code:
The payload send to the server is:
{'option_type': 'OptionType.OP1', 'page': '0', 'limit': '100'}
Expected behavior
The payload expected is:
{'option_type': 'FirstOp', 'page': '0', 'limit': '100'}
Additional context
I think the issue is on the function Sequence.convert
The text was updated successfully, but these errors were encountered: