marshmallow-code / marshmallow-code/flask-marshmallow

UrlFor fields include all passed params in url.

Open
#52 6 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.