Swagger-codegen: [JAVA] Bug: Code with compile errors is generated for 'path' query param

Created on 11 Oct 2017  路  3Comments  路  Source: swagger-api/swagger-codegen

Description

If you have path as your query parameter, code gen generates non compilable Java client.

Swagger-codegen version

2.2.3

Swagger declaration
  "parameters": [
          {
            "name": "path",
            "in": "query",
            "description": "path",
            "required": false,
            "type": "string"
          },
Variable name clashes with this
        String path = UriComponentsBuilder.fromPath("/fieldchanges").buildAndExpand(uriVariables).toUriString();

Java Bug

All 3 comments

Oh, I've missed this one. With localVariablePrefix it does compile.
Although, probably it needs better documentation for that kind of cases.

Please feel free to submit a PR to improve the documentation :)

Was this page helpful?
0 / 5 - 0 ratings