marshmallow-code / marshmallow-code/flask-marshmallow
UrlFor fields include all passed params in url.
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 887
- Forks
- 65
- Avg merge
- 7h 25m
- Merged PRs (30d)
- 3
Description
UrlFor fields use all the passed parameters of the field in construct the url, this makes those fields unsuitable to use with apispec in the same way as other marshmallow fields, or with any information at all.
Example:
image_url = URLFor(
endpoint='return_image_file',
id='<id>',
required=True,
description='url location of the image file.',
)
Result:
"image_url": "/api/image/191.png?description=url+location+of+the+image+file.&required=True",
Perhaps the best way to avoid this is define a new argument in the fields: endpoint_params, for example, to store a dict with all the endpoint parameters. For backward compatibility it can look for the existence of that argument and if exists use the parameters of the dict inside, if not use the parameters of the field as is currently done.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the URLFor field implementation and its handling of passed parameters, using the issue's apispec and marshmallow example as the behavioral reference. Done means endpoint parameters are included in the generated URL without unrelated field metadata such as description and required being included.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- flask, python
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100