Skip to content

Unable to access nested list property using dot(.) notation as specified in documentation. #91

Closed
@mukeshsharma1201

Description

@mukeshsharma1201

Code

field = fields.Raw(attribute='bar.0')
assert field.output('foo', {'bar': [42]}) == 42

Repro Steps (if applicable)
Try with the above snippet

Expected Behavior
Properties which are nested under list should be accessible according to https://flask-restplus.readthedocs.io/en/stable/marshalling.html#renaming-attributes
AND
https://flask-restx.readthedocs.io/en/latest/marshalling.html#renaming-attributes

Actual Behavior
A description of the unexpected, buggy behaviour.

Error Messages/Stack Trace
No error/exception thrown, but it outputs None

Environment
Python 3.7.2
Flask 1.1.1
Werkzeug 0.16.1
Flask-RESTPlus 0.13.0
flask-restx 0.1.1

Additional Context

This is the exact issue #783 of flask-restplus. Since I am experiencing the same behaviour in flask-restx and there are no previous issues mentioning this, so I am creating an exact copy of the issue here!

There is an open PR on flask-restplus that solves the issue. I am just beginner with python and flask-restx, but if anyone can port that solution here, it would be great!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions