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.14k stars 333 forks source link

Update enums schema from OpenAPI 2.0 to OpenAPI 3.0 #581

Closed darrenchang closed 9 months ago

darrenchang commented 9 months ago

Expected Behavior

"parameters": [
        {
          "in": "formData",
          "name": "file",
          "required": true,
          "type": "file"
        },
        {
          "collectionFormat": "csv",
          "in": "formData",
          "items": {
            "enum": [
              "item1",
              "item2",
              "item3",
            ],
            "type": "string"
          },
          "name": "picked_items",
          "type": "array"
        },

Actual Behavior

"parameters": [
        {
          "in": "formData",
          "name": "file",
          "required": true,
          "type": "file"
        },
        {
          "collectionFormat": "csv",
          "enum": [
            "item1",
            "item2",
            "item3",
          ],
          "in": "formData",
          "items": {
            "type": "string"
          },
          "name": "picked_items",
          "type": "array"
        },

Environment

peter-doggart commented 9 months ago

Flask-restx generates Swagger 2.0 (https://swagger.io/specification/v2/) compliant docs only. Unfortunately, OpenAPI 3.0 support has been on the ask list for a long time but because of the way schemas are generated it's not a small change.

darrenchang commented 9 months ago

Flask-restx generates Swagger 2.0 (https://swagger.io/specification/v2/) compliant docs only. Unfortunately, OpenAPI 3.0 support has been on the ask list for a long time but because of the way schemas are generated it's not a small change.

I see. Thank you for the replying to this issue