Real-life RESTful server example on Flask-RESTplus
I'm wondering if someone has any good idea's for implementing an expand option similar to that of [Stripe's API](https://stripe.com/docs/api/expanding_objects). The idea is that if an object contains a reference to another object (e.g. a `team` object that has the `id`'s of a set of `user` objects) one can request the `id` to be expanded to the full object instead of only the reference. Stripe does this by an optional parameter called `expand` that contains a list of all the references to be expanded (nested objects are indicated by the dot notation e.g. `expand=["team.users", "team.users.address"]`. Now I'm wondering how one would go about implementing such a feature while keeping it as generic as possible. There seem to be one main issue I'm struggeling with most likely due lack of knowledge on the intricacies of decorators: How can I add an optional parameter to all requests (all methods should be supported and thus locations will differe between query, form, and json) and use this parameter while serializing the response. My current idea is tho expand the object duiring serialization if the `expand` parameter is passed. The expandable ID fields would require a custome marshmallow field that takes a schema object as parameter that is to be used in case of expansion. The syntax I would prefer to use is in the following format for adding this option to a route: `@api.expandable(ignore=["users.address"])` Look forward to hearing any idea's of people smarter than me how to add this feature in a generic way. If desired we can add it ass a pull request to the project.
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be resolved. The issue was opened by theveloped and has received 2 comments.