Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork136
Add deepObject support#379
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
d084df1
to23cc3e4
Comparecodecovbot commentedSep 23, 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 #379 +/- ##==========================================- Coverage 93.16% 93.08% -0.09%========================================== Files 94 94 Lines 2311 2327 +16 Branches 286 291 +5 ==========================================+ Hits 2153 2166 +13- Misses 123 124 +1- Partials 35 37 +2
Help us with your feedback. Take ten seconds to tell ushow you rate us. Have a feature suggestion?Share it here. |
23cc3e4
tocc42e15
CompareThere 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.
We can add this as experimental support.
Uh oh!
There was an error while loading.Please reload this page.
Problem statement
Currently deepObjects are not supported, this PR adds that support.
Description
Example spec
Sadly it doesn't really fit in the
ParameterDeserializersFactory
ideology as it would never reach that step asget_value()
inparameters.py would always fail as it tries to find thename
of theparam_or_header
in the specific location. This is because how a deepObjects query param looks like (e.g.someurl.com/?paramObj[count]=1¶mObj[name]=John
), the function would try to findparamObj
in the location, which it would not find as the QueryParams will be split into a dict like this:{'paramObj[count]': 1, 'paramObj[name]': John}
.In my proposed solution it would split the location dict key into 2 parts, the actual key we want to find
paramObj
and then create a dict of the 2nd part of the key (whats inside the brackets) with its actual value:{'count': 1, 'name': 'John'}
.Afterwards this dict is checked via the schema of the object.
I highly doubt this solution will get accepted, so if you know a way to make this cleaner/better please lmk 🙏
Todos
Related issue