Skip to content

fields.Url does not work with indexable objects #324

Closed
@leonhandreke

Description

I'm using the marshal_with decorator on a function that is returning an indexable object (i.e. one that has __getitem__) and the Url field crashes. As far as I can see, this is because it assumes that to_marshallable_type returns a mapping type that can be passed to url_for using the ** notation (see https://github.com/twilio/flask-restful/blob/89150bb6c00fac5bf59d01f0e424098c4d119736/flask_restful/fields.py#L259).

Not sure what should be done here. Maybe make to_marshallable_type more aggressive in its conversion?

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions