flask-restx icon indicating copy to clipboard operation
flask-restx copied to clipboard

Fields.Nested() not supported in Swagger UI

Open simk0024 opened this issue 2 years ago • 2 comments

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))
})
  1. Nested field
route_field = api.model("Route", {
    'name': fields.String(required=True, example="Name", description="Name of the route"),
    'waypoints': fields.Nested(waypoint_field)
})

simk0024 avatar Apr 11 '22 08:04 simk0024

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.

Yoshi325 avatar Apr 11 '22 16:04 Yoshi325

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

simk0024 avatar Apr 12 '22 04:04 simk0024