Luxoft / gengen

Tool for generating models and Angular services based on OpenAPIs and Swagger's JSON.
MIT License
17 stars 8 forks source link

Can't generate methods with enum path/query params #67

Closed sevaru closed 3 years ago

sevaru commented 3 years ago

Describe the bug If you URI has enum as a parameter in query or in path then gengen could't fails to generate anything

It's appears after #53 feature implementation

To Reproduce

"/api/v1/Product/GetProductsByStatus/{status}": {
      "get": {
        "tags": [
          "Product"
        ],
        "parameters": [
          {
            "name": "status",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProductStatus"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Product"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Product"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Product"
                  }
                }
              }
            }
          }
        }
      }
    },

Expected behavior

gengen g 

should not throw an error