Luxoft / gengen

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

Error generating methods with path parameters #53

Closed ddiyteam closed 3 years ago

ddiyteam commented 3 years ago

Describe the bug Generating query parameters for methods with path parameters.

To Reproduce gengen ver. 1.0.0-rc.1 Method parameter in openapi json file marks as path type

{
  "paths": {
    "/Product/Download/{id}": {
          "get": {
            "tags": [
              "Product"
            ],
            "parameters": [
              {
                "name": "id",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              }
            ],
            "responses": {
              "200": {
                "description": "Success"
              }
            }
          }
        }
    }
}
...

Actual behavior

public download(id: string): Observable<void> {
        return this.get<void>(
            `download?id=${encodeURIComponent(id)}`,
        );
    }

Expected behavior

public download(id: string): Observable<void> {
        return this.get<void>(
            `download/${encodeURIComponent(id)}`,
        );
    }