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

Query Parameters with enableUrlTemplating set to true #1484

Closed
safari137 opened this issue Sep 12, 2016 · 15 comments
Closed

Query Parameters with enableUrlTemplating set to true #1484

safari137 opened this issue Sep 12, 2016 · 15 comments
Labels
Milestone

Comments

@safari137
Copy link

safari137 commented Sep 12, 2016

Fill details of my issue can be seen at : [http://stackoverflow.com/questions/39439214/swagger-param-documentation]

I have also read the closed issue at [https://github.com//issues/986]

My dilemma is that I need enableUrlTemplating set to true in order to have documentation on similar routes/maps that are only distinguished by certain query parameters (/students/{id}?age=20 and /students{id}?age=20&gender=male). I also can't stand seeing the swagger ui showing url/students{id}{?age}?age=20 and it obviously doesn't work either.

Is there any work around for presenting this correctly in the UI?

@dilipkrish
Copy link
Member

Are you using this dependency io.springfox.ui:springfox-swagger-ui-rfc6570:0.9.7 for swagger-ui? Just released 0.9.7 but 0.9.6 should work too.

@dilipkrish dilipkrish added this to the 2.6.0 milestone Sep 12, 2016
@safari137
Copy link
Author

I thought I was, but apparently I'm not. What repository should I use for that? I'm using gradle.

@dilipkrish
Copy link
Member

0.9.6 is available in both maven central and jcenter. However 0.9.7 is only available as of now on jcenter.

@safari137
Copy link
Author

safari137 commented Sep 12, 2016

In any case I have 0.9.6 working,

However, now when I load localhost:8080/swagger-ui.html I see the navbar on the top with no data.
"Failed to load resource: the server responded with a status of 404 () http;//localhost:8080/configuration/ui" is in the console.

@dilipkrish
Copy link
Member

😫 I just remembered, 0.9.6 will not work, you'll need to use 0.9.7. It takes a few hours to sync to maven central but if you include jcenter() as a repo in your gradle build you should find it.

@safari137
Copy link
Author

Ahh okay. It doesn't seem to be available on jcenter for me just yet. 0.9.6 seems to be the last version.

https://jcenter.bintray.com/io/springfox/springfox-swagger-ui-rfc6570/

@dilipkrish
Copy link
Member

Yeah there seems to be a hiccup. Switched the artifacts group id from io.springfox to io.springfox.ui. Will update this thread when that is fixed

@dilipkrish
Copy link
Member

Ok it should be available now

@safari137
Copy link
Author

That works great! Thank you very much.

@thomaszbz
Copy link

thomaszbz commented Feb 6, 2018

@dilipkrish I have the same issue with springfox versions 2.7.0 and 2.8.0: With enableUrlTemplating(true), swagger ui does not replace the RFC6570 template (e.g. it sends a GET request like https://example.com/api{?user_id%7D=&user_id=123 https://example.com/api{?user_id}&user_id=123) and therefore either receives 404 errors (with springfox-swagger-ui-rfc6570 enabled) or it lets tomcat fail (with springfox-swagger-ui-rfc6570 disabled).

Me too, my maven can only resolve 0.9.6 but not 0.9.7. Could you please publish 0.9.7 in common repos? It should be made available here:

https://mvnrepository.com/artifact/io.springfox/springfox-swagger-ui-rfc6570

@thomaszbz
Copy link

thomaszbz commented Feb 6, 2018

@thomaszbz
Copy link

thomaszbz commented Feb 6, 2018

@dilipkrish With springfox version 2.7.0 or 2.8.0 and springfox-swagger-ui-rfc6570 version 1.0.0, it seems to work and swagger ui produces GET requests like:
https://example.com/api&user_id=1

But unfortunately, I had to disable the springfox-swagger-ui dependency which is tied to a springfox version. Would be great to de-incubate RFC6570 support so that the the ui version goes along with the springfox version.

@dilipkrish
Copy link
Member

@thomaszbz you can use it with the latest springfox versions I believe 2.6+ atleast.

@sivashanthini
Copy link

@dilipkrish I am using springfox and swagger-ui of version 2.9.2. I needed the support of RFC6570 in the swagger-ui version 2.9.2. It would be great if RFC6570 support can be provided in swagger-ui 2.9.2 version also rather than in swagger-ui-rfc6570 1.0.0.

@membersound
Copy link

Is enableUrlTemplates still experimental, or could it be merged into master?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants