Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON parsing of parameters returning type instead of paramType #770

Closed
thibaultcha opened this issue Nov 25, 2014 · 1 comment
Closed

JSON parsing of parameters returning type instead of paramType #770

thibaultcha opened this issue Nov 25, 2014 · 1 comment

Comments

@thibaultcha
Copy link

With swagger-core_2.10 version 1.3.10, parsing a JSON definition of a Swagger API and using Parameter.paramType() seems to be returning the type property of the parameter instead of paramType

Example:

Having this list of parameters in my petstore.json API definition:

"parameters": [
  {
    "name": "orderId",
    "description": "ID of pet that needs to be fetched",
    "required": true,
    "type": "string",
    "paramType": "path"
  }
]

And doing:

this.apiListing = JsonSerializer.asApiListing(swaggerString);

// more logic, creating an Iterator<Parameter> for this operation

while (parameterIterator.hasNext()) {
  Parameter parameter = parameterIterator.next();
  parameter.paramType(); // returns "string" instead of "path"
}

Investigating further, it seems that Parameter.toString() does not include the paramType property either:

System.out.println(parameter.name() + " " + parameter.paramType() + " " + parameter.toString());
// output:
orderId string Parameter(orderId,Some(ID of pet that needs to be fetched),None,true,false,,AnyAllowableValues,string,None)
@fehguy
Copy link
Contributor

fehguy commented Nov 27, 2014

merged

@fehguy fehguy closed this as completed Nov 27, 2014
fehguy added a commit that referenced this issue Dec 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants