Closed angeloh closed 12 years ago
swagger-ui is working well for me, but I had to make a few small fixes. I suspect the one you want for this is:
https://github.com/Xeralux/swagger-core/commit/688616e8c87b64b920183c094fa9b31f1a5fb5c4
I tried you patch.
First, I git pull latest changes from swagger-core repo, and publish local for swagger-play2. Make java-play2 to use local repo jars. Then, I tried you patch. Remove local cache. Republish and recompile.
The result looks the same to me with or without your patch. Only /store.{format} have shown up on swagger-ui, not the other two (/pet and /user). Did you try java-play2 example at your local env?
I'm seeing this issue also, has it been resolved.
Hi, please pull from this branch:
https://github.com/wordnik/swagger-core/tree/1.1.0-spec
Which will be merged with master shortly. It should work fine and has been tested with the latest swagger-ui
correction on my last post--the scala play2 app is updated, the java-play2 sample will be shortly. Apologies on that!
@cainj, @angelokh, this is now fixed--I've committed the java-play2 sample changes here:
https://github.com/wordnik/swagger-core/tree/1.1.0-spec/samples/java-play2
The updated support is in the 1.1.0-SNAPSHOT for swagger-core as well as swagger-play2. You can build each module as needed, or you can grab them from Sonatype:
And swagger-play2 from our github repo:
http://wordnik.github.com/repository/com.wordnik/swagger-play2_2.9.1/1.1.0-SNAPSHOT/ivys/ivy.xml
Thanks for your patience with this--I'm going to keep this open until I hear that it's resolved the issue, which was based on reading the host class from the route + method name, which was different from java & scala (per our implementation at least):
https://github.com/wordnik/swagger-core/commit/e2bfd57a37f95901f7c95066ea4a164beaea798b
Tested with latest swagger-ui and swagger-codegen
I'm still see these errors. Everything works fine with scala-play, but the java-play not so well. PathParams are not showing up in swagger-ui
@cainj you mean the stock sample here:
https://github.com/wordnik/swagger-core/tree/1.1.0-spec/samples/java-play2
is not showing up in the ui for you? can you please wipe your ivy cache?
rm -rf ~/.ivy2/local && rm -rf ~/.ivy2/cache
and try again? I'm baffled, just ran the project and it's behaving nicely with the swagger ui.
Did as you suggested and came to the following conclusion. It works like a charm, when I run the sbt console, but if I use the play console, that's when the errors happen. So I think it's a play issue and not swagger. Although, if I run the scala-play2 with the play console it works fine.
aha! ivy strikes again. Please nuke your play ivy cache as follows:
rm -rf $PLAY_HOME/repository/cache/com.wordnik* && rm -rf $PLAY_HOME/repository/local/com.wordnik*
That should do it--please post back after you give it a shot.
That did it. You are the man!
The ivy cache can really mess things up. Thanks again.
Awesome, glad that did it
closing this out, if issue comes back, please reopen. Now pushed to master, artifacts in maven central
When running swagger-ui and read from http://localhost:9000/resources.json, it will give me errors on the console:
[error] application - Cannot determine Path. Nothing defined in play routes file for api method public static play.mvc.Result controllers.UserApiController.updateUser(java.lang.String) [error] application - Cannot determine Path. Nothing defined in play routes file for api method public static play.mvc.Result controllers.PetApiController.addPet() [error] application - Cannot determine Path. Nothing defined in play routes file for api method public static play.mvc.Result controllers.StoreApiController.placeOrder() [debug] application - /store [debug] application - /pet [debug] application - /user [error] application - Could not find route controllers.StoreApiController.placeOrder [error] application - Could not find route controllers.PetApiController.addPet [error] application - Could not find route controllers.UserApiController.updateUser
If I change 'swagger-play2' to 'swagger-play2-utils' in Build.scala, the errors go away but stuck at 'Fetching _store...'.