swagger-api/swagger-codegen

[Python] Debug issues when using 'params' as name of query parameter

Open

#6 216 ouverte le 31 juil. 2017

Voir sur GitHub
 (4 commentaires) (0 réactions) (0 assignés)HTML (5 474 forks)batch import
Client: PythonIssue: Bughelp wanted

Métriques du dépôt

Stars
 (12 701 stars)
Métriques de merge PR
 (Merge moyen 4h 43m) (10 PRs mergées en 30 j)

Description

Description

It seems that the code generated for parameter handling in Python will end up creating a recursive params dictionary, if you have a query parameter called 'params'. This does not cause problems running the code normally, but will cause max recursion exception when debugging.

The easy work-around is to avoid 'params' as a parameter name.

Swagger-codegen version

Code generated with swagger-codegen-maven-plugin 2.2.2

Swagger declaration file content or url
    "/v1/instrumentParameters/{id}" : {
      "get" : {
        "summary" : "Get instrument params",
        "description" : "...",
        "operationId" : "getInstrumentParameters",
        "produces" : [ "application/json" ],
        "parameters" : [ {
          "name" : "id",
          "in" : "path",
          "description" : "...",
          "required" : true,
          "type" : "string"
        }, {
          "name" : "params",
          "in" : "query",
          "description" : "Parameters to return",
          "required" : false,
          "type" : "array",
          "items" : {
            "type" : "string",
            "enum" : [ "..." ]
          },
          "collectionFormat" : "multi"
        } ],
        "responses" : {
          "200" : {
            "description" : "successful operation",
            "schema" : {
              "type" : "object",
              "additionalProperties" : {
                "type" : "object"
              }
            }
          }
        }
      }
    }
Command line used for generation
Steps to reproduce
Related issues/PRs
Suggest a fix/enhancement

Guide contributeur