sdaschner / jaxrs-analyzer

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

Reflect model/POJO JavaDocs through to Swagger 'description' fields #195

Open TristanPerry opened 4 years ago

TristanPerry commented 4 years ago

Ensures that the JavaDocs from the POJOs which represent the JSON models (i.e. the POJOs representing the request and response objects) are captured, so that these can be used in the Swagger model 'description' fields:

Swagger description example

I know this sort of thing was discussed in https://github.com/sdaschner/jaxrs-analyzer/issues/128, and it does seem like using JavaDocs makes the most sense for this usecase (especially because the JavaDocs within a 'JSON POJO' will be very unlikely to contain anything programmatically important to other developers).

A lot of files were changed here due to implementing a builder pattern instead of doing TypeRepresentation.ofConcrete (the alternative would have been quite messy), but the core changes are to capture extra data in MemberParameterTag and TypeRepresentation, and then use this in the Swagger SchemaBuilder as appropriate.