python-restx/flask-restx

Update enums schema from OpenAPI 2.0 to OpenAPI 3.0

darrenchang opened this issue · 2 comments

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

  • Python==3.10.11
  • Flask==2.2.2
  • Flask-RESTX==1.2.0

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.

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