Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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()
in parameters.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