play-swagger icon indicating copy to clipboard operation
play-swagger copied to clipboard

Package objects break property references

Open sloshy opened this issue 6 years ago • 3 comments

I have a case class in my Play app called Movies. Movies has an item editions which is of type Seq[MovieEdition]. With the classes in the file models/Output.scala with the package models.output, the swagger JSON is generated properly including all types (/definitions/models.output.MovieEdition as expected) and property type references resolve as expected. Since moving the case classes to a package object, I get the following error when opening my swagger.json file:

Resolver error at paths./movies.get.responses.200.schema.properties.editions.items.$ref
Could not resolve reference because of: Could not resolve pointer: /definitions/models.output.package.MovieEdition does not exist in document

The case classes are located in a file models/output/package.scala with the package models.output. The model types are generated just fine in the swagger.json file, but the references mistakenly assume that the name includes .package as part of the package name.

sloshy avatar Nov 01 '17 18:11 sloshy

Same exact issue for me as well !

senegalo avatar Jun 19 '20 10:06 senegalo

same here

alexmnyc avatar Oct 20 '21 21:10 alexmnyc

@sloshy @senegalo @alexmnyc We are currently reviewing it. It may take some time, but we plan to address it.

Javakky-pxv avatar Jul 21 '23 03:07 Javakky-pxv