sdaschner / jaxrs-analyzer

Creates REST documentation for JAX-RS projects
Apache License 2.0
319 stars 101 forks source link

Swagger backend now separates multiple dynamic type instances #148

Closed hindsholm closed 6 years ago

hindsholm commented 6 years ago

This is a fix for issue #147 . The fix contains code to generate separate dynamic Json types in the swagger backend so that e.g. responses generated with the javax.json builders will give correct results. There is also a test for the issue. Some other tests needed small changes because they actually relied on the erratic behavior. I also had to introduce a resetDynamicCounter() method in the TypeIdentifier class in order to test because it uses a static variable for counting which is not otherwise accessible.

sdaschner commented 6 years ago

Thanks for contributing and thanks a lot for adding tests, so many times they are neglected :-)

I saw the reset method. I added it into a test scope functionality that resets it via reflection. Not the nicest code, but I personally prefer this over adding functionality to production code.