swagger2markup
swagger2markup copied to clipboard
query parameter incorrectly shown as json in request example
Using v1.3.1
Given parameters are defined as query parameters in the swagger, the generated example request should show them as query parameters.
Currently the generated example suggest they are passed in as json, e.g.:
==== Example HTTP request
===== Request path
----
/exchange-rate
----
===== Request query
[source,json]
----
{
"from" : "string",
"to" : "string"
}
----
Since these are defined as query parameters, the example request should show them as such, e.g.:
==== Example HTTP request
===== Request path
----
/exchange-rate?from=string&to=string
----
Similar issue to https://github.com/Swagger2Markup/swagger2markup/issues/266 ?
Yup, they're the same issue I think.
Instead of this JSON string (which is obviously wrong), would you prefer to see a table of possible query parameters, or an example URL with the query parameters in them?
Btw when you use and like Swagger2Markup, we would love to get your GitHub stars :tada:
I think a table would be more readable but a URL is more useful as that can be copy pasted into the browser, curl etc. So overall, I'd prefer the URL.
I have created the following expected result, based on the example in issue #266 :
https://github.com/Swagger2Markup/swagger2markup/blob/issue/264/src/test/resources/expected/asciidoc/query_params/paths.adoc
Nice. And the spec limits us from getting the ability to set example values right?
@cascer1 Thx. Do we still need the table which shows Request Query parameters? We should only add required query parameters to the URL and skip optional parameters.
@alkemann I do think that you can't explicitly define query parameter examples.
@RobWin I guess we can get rid of the table, since it's already in the operation description.
Yes, then let's get rid of the table.
Personally I would prefer the table. Can we make it an option?
On 24 Jul 2017, at 10:34, Robert Winkler [email protected] wrote:
Yes, then let's get rid of the table.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
@alkemann Sorry for the late reply (more than 2 months ;-;), I guess it could be added as configuration variable.
Welcome back @cascer1 :)
Has this issue been fixed? I've tried using the docker image swagger2markup/swagger2markup:1.3.2, but I still see query parameters being shown in examples as JSON
I'm very sorry, life has been super busy and I haven't had the time to work on this still. It might be better if someone else picked up this issue.