-
Notifications
You must be signed in to change notification settings - Fork 333
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
Value of different types (e.g., str, list) #564
Comments
Having a look at the I don't think there is any neat way to allow |
@peter-doggart Thanks for the insight! This is what I have seen, as well, however I am not sure If I can apply your suggestion as is, since there might be objects of different types, i.e., floats, integers, strings. I was hoping flask-restx could support multiple data types. |
It seems swagger cannot properly handle the JSON payload and I've been wondering if it's my implementation or there's something wrong. I have attached a MWE to demonstrate part of the issue I have been facing and it is mainly associated with the fact that a value of a key could be of different types, e.g.
str
orlist
(that's why in the following example I have usedfields.Raw
)If I go to swagger and try out the endpoint with the following endpoint:
everything seems to work as expected and get the expected output:
However, if I use the following payload:
when I hit the execute button, I don't seem to get anything back.
Expected output:
I'm not sure if this is a bug or no, so I have set this as a question. Please feel free to ask if anything else is needed.
python version: 3.11.5
flask version: 2.3.3
flask-restx version: 1.1.0
The text was updated successfully, but these errors were encountered: