I would like to add a custom controller to swagger API descriptor. It's quite easy with spring fox to a custom existing model. But I don't succeed to add custom API to swagger descriptor from scratch. An example is better than a long speech.
I did a test project springfox-test
I have a controller (ItemController) who handle two URLs (/item/name
and /item/number
) and return two different beans (ItemName
and ItemNumber
).
It wasn't that hard to add both Operations to Swagger through an ApiListingScannerPlugin implementation, but I had to make reference to my beans (ItemName and ItemNumber), and I don't know how and where I can describe these beans.
The ApiListingBuilderPlugin class seems to work that way, but we can only access the builder of the API and then I have to override all models.
Is there a way to ask spring fox to describe these beans?