Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.7k
Comments
✨ UpdateORJSONResponse to support nonstr keys and serializing Numpy arrays#3892
✨ UpdateORJSONResponse to support nonstr keys and serializing Numpy arrays#3892tiangolo merged 8 commits intofastapi:masterfrom
ORJSONResponse to support nonstr keys and serializing Numpy arrays#3892Conversation
adam-tokarski left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Please provide any tests for that.
baby5 commentedOct 6, 2021
@adam-tokarski done |
tests/test_default_response_class.py Outdated
| @app.get("/orjson_non_str_keys") | ||
| def get_orjson_non_str_keys(): | ||
| key = quoted_name("msg") | ||
| return {key: "Hello World"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Isn't thatkey still a string? It seems like it should be working even before the fix (I didn't check that though).
Also, you could provide a test with some integer as a key maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
yes, it is a string, but not astr type, orjson not support withoutoption=orjson.OPT_NON_STR_KEYS
'integer as a key' is coming
baby5 commentedOct 6, 2021
@adam-tokarski done |
ORJSONResponse to support nonstr keys and serializing Numpy arraystiangolo commentedSep 2, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Great, thank you@baby5! And thanks for adding tests! 🍰 And thanks@adam-tokarski for the help and review! ☕ I updated the implementation a bit to include serializing Numpy arrays and testing the included This will be available in the next release, in the next hours, FastAPI |
📝 Docs preview for commit37621c8 at:https://6311d5f220a23774734691d2--fastapi.netlify.app |
codecovbot commentedSep 2, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Codecov Report
@@ Coverage Diff @@## master #3892 +/- ##========================================= Coverage 100.00% 100.00% ========================================= Files 537 538 +1 Lines 13856 13870 +14 =========================================+ Hits 13856 13870 +14
Help us with your feedback. Take ten seconds to tell ushow you rate us. Have a feature suggestion?Share it here. |
NikosAlexandris commentedApr 4, 2024
What is the status of this issue regarding support for NumPy arrays ? |
the detail see:https://github.com/ijl/orjson/issues/197
my case is
<class 'sqlalchemy.sql.elements.quoted_name'>