swagger-api / swagger-play

Apache License 2.0
330 stars 181 forks source link

Calls to ApiHelpController.getResource corrupt ApiHelpController.getResources results #106

Open marcus-degruttola opened 8 years ago

marcus-degruttola commented 8 years ago

If you've upgraded from swagger-play 1.3.x to 1.5.x, chances are good that you have calls to ApiHelpController.getResource in your call path.

GET /api-docs.json controllers.ApiHelpController.getResources GET /api-docs.json/DataRequest controllers.ApiHelpController.getResource(path = "/DataRequest") GET /api-docs.json/Auth controllers.ApiHelpController.getResource(path = "/Auth") GET /api-docs.json/Access controllers.ApiHelpController.getResource(path = "/Access") GET /api-docs.json/Rubric controllers.ApiHelpController.getResource(path = "/Rubric")

Code like this would not be uncommon in 1.3.x versions of swagger-play.

At some point, the calls to getResource seem to re-write what appears to be a single cache of paths so that calls to getResources so that calls to the generic swagger sandbox end up containing truncated sets of paths depending on the last call to getResource.

Solutions? Fix underlying cache to getResource, depreciate (or remove) getResource, mention it in a migration path between 1.3 and 1.5. In the end, we removed the paths that use getResource because we don't need them with 1.5 and it prevents them from getting called by internet web crawlers that must have had cached versions of our older website and leave our swagger interface useless.