Identify local object definitions and recurse over the properties#186
Merged
sloria merged 1 commit intomarshmallow-code:devfrom Apr 5, 2018
Merged
Conversation
Member
|
IIUC, you're stepping into the object to identify properties using known schemas. If we go this route, why stop at the first level and not recurse through the whole schemas? Also, it looks like your use case is similar to http://marshmallow.readthedocs.io/en/latest/extending.html#example-enveloping. I'm not sure how to use this pre_load/post_dump trick with apispec, though |
Contributor
Author
|
The patch does recurse through the entire structure of object definitions as the same function is called for each matching child entry. |
Member
|
Oh, right. Sorry. I don't have any objection to this PR. |
Member
|
Good change. Thanks @lphuberdeau! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This adds a little bit of consistency allowing object definitions as part of the response - not only arrays. My primary case for this is to wrap all of our responses in a data property without having to declare a custom schema for each data type individually.