You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
scala> new File("/Users/kevin/Workspace/Work/json_sandbox/petstore.json")
res7: java.io.File = /Users/kevin/Workspace/Work/json_sandbox/petstore.json
scala> res7.toURI
res8: java.net.URI = file:/Users/kevin/Workspace/Work/json_sandbox/petstore.json
scala> SwaggerService.getSwaggerObj(res8)
reading from file:/Users/kevin/Workspace/Work/json_sandbox/petstore.json
File 'file:/Users/kevin/Workspace/Work/json_sandbox/petstore.json' does not exist
reading from file:/Users/kevin/Workspace/Work/json_sandbox/petstore.json
File 'file:/Users/kevin/Workspace/Work/json_sandbox/petstore.json' does not exist
res9: Either[Throwable,Option[io.swagger.models.Swagger]] = Right(None)
However, if I cut out the file: from the URI's constructor's String argument, and then make a new URI, it works:
scala> new URI("/Users/kevin/Workspace/Work/json_sandbox/petstore.json")
res12: java.net.URI = /Users/kevin/Workspace/Work/json_sandbox/petstore.json
scala> SwaggerService.getSwaggerObj(res12)
reading from /Users/kevin/Workspace/Work/json_sandbox/petstore.json
res13: Either[Throwable,Option[io.swagger.models.Swagger]] = Right(Some(io.swagger.models.Swagger@657e4ba9))
Since a new URI can be created via java.io.File#toURI, I would've expected my File#toURI-created URI to have worked here, but it didn't.
The text was updated successfully, but these errors were encountered:
With
"io.swagger" % "swagger-parser" % "1.0.10"
:And the following code:
I then ran it from Scala's REPL:
However, if I cut out the
file:
from the URI's constructor's String argument, and then make a newURI
, it works:Since a new
URI
can be created via java.io.File#toURI, I would've expected myFile#toURI
-created URI to have worked here, but it didn't.The text was updated successfully, but these errors were encountered: