swagger-play
swagger-play copied to clipboard
Problems with String Interpolating Routing DSL
Play Swagger isn't working at all with String Interpolating Routing DSL
I think that the problem is related to the fact that routes structured like this -> /my/route
link to java files and not to other routes.
If you want to reproduce the bug quickly you can try with this repo: https://github.com/playframework/play-scala-rest-api-example/tree/2.6.x
Here you the exception:
Caused by: java.lang.NullPointerException: null at java.io.Reader.
(Reader.java:78) at java.io.InputStreamReader. (InputStreamReader.java:129) at scala.io.BufferedSource.reader(BufferedSource.scala:22) at scala.io.BufferedSource.bufferedReader(BufferedSource.scala:23) at scala.io.BufferedSource.charReader$lzycompute(BufferedSource.scala:33) at scala.io.BufferedSource.charReader(BufferedSource.scala:31) at scala.io.BufferedSource.scala$io$BufferedSource$$decachedReader(BufferedSource.scala:60) at scala.io.BufferedSource.mkString(BufferedSource.scala:89) at play.modules.swagger.SwaggerPluginImpl.play$modules$swagger$SwaggerPluginImpl$$parseRoutesHelper$1(SwaggerPlugin.scala:122) at play.modules.swagger.SwaggerPluginImpl$$anonfun$1.applyOrElse(SwaggerPlugin.scala:131)
I was trying to create a pull request but I've just realized how difficult it is to fix this issue. As long as I know there's no way to extract any information from SimpleRouter because it only contains a PartialFunction.
@MatteCarra I think its probably related to #150
I think I'm experiencing this same issue on 2.5.18, see https://github.com/swagger-api/swagger-play/issues/110#issuecomment-354505863
Edit: confirmed, when I switch to only using a routes file everything works.
Is there any update on this issue?
It's relatively difficult to extract the path information from SIRD. In our fork we fixed the NPE so it just ignores the SIRD router.