python-restx / flask-restx

Fork of Flask-RESTPlus: Fully featured framework for fast, easy and documented API development with Flask
https://flask-restx.readthedocs.io/en/latest/
Other
2.16k stars 335 forks source link

Fields.Nested() not supported in Swagger UI #431

Open simk0024 opened 2 years ago

simk0024 commented 2 years ago

I am using flask-restx 0.5.1.

I am using fields.nested() in my program, but both below scenarios have same problem: when I go to swagger-ui, complete the field and click on Execute button - nothing happens (the request is not made, button have no response).

1) List of nested field

route_field = api.model("Route", {
    'name': fields.String(required=True, example="Name", description="Name of the route"),
    'waypoints': fields.List(fields.Nested(waypoint_field))
})

2) Nested field

route_field = api.model("Route", {
    'name': fields.String(required=True, example="Name", description="Name of the route"),
    'waypoints': fields.Nested(waypoint_field)
})
Yoshi325 commented 2 years ago

I think this may be related to werkzeug 2.1.0 or later. Pinning the version back to 2.0.3 fixes the problem I am seeing.

simk0024 commented 2 years ago

Hi @Yoshi325, just checked, i am using Wekzeug 2.0.3. Do you face same issue in Wekzeug 2.1.0?