Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make it easy to extend swaggerbackend #153

Open
rmannibucau opened this issue Mar 14, 2018 · 4 comments
Open

make it easy to extend swaggerbackend #153

rmannibucau opened this issue Mar 14, 2018 · 4 comments

Comments

@rmannibucau
Copy link
Contributor

rmannibucau commented Mar 14, 2018

the need is to be able to implement its own swagger backend to add custom extensions in the model
so it requires classes to become public and method protected

Some rational behind it: to add x-restlet swagger extension i needed to fork the whole swagger backend (https://github.com/rmannibucau/jaxrs-analyzer-extension/blob/master/src/main/java/com/github/rmannibucau/jaxrsanalyzer/backend/EnrichedSwaggerBackend.java) which is a pain. Enhancements are:

  1. bytes handling https://github.com/rmannibucau/jaxrs-analyzer-extension/blob/master/src/main/java/com/github/rmannibucau/jaxrsanalyzer/backend/EnrichedSwaggerBackend.java#L399,
  2. section handling https://github.com/rmannibucau/jaxrs-analyzer-extension/blob/master/src/main/java/com/github/rmannibucau/jaxrsanalyzer/backend/EnrichedSwaggerBackend.java#L422 + https://github.com/rmannibucau/jaxrs-analyzer-extension/blob/master/src/main/java/com/github/rmannibucau/jaxrsanalyzer/backend/EnrichedSwaggerBackend.java#L129
@sdaschner
Copy link
Owner

Hmm.. what would you suggest? Having an SPI would be the most flexible option I guess.

@rmannibucau
Copy link
Contributor Author

There is already a spi in the analyzer (see the issue in mvn plugin) but methods should be protected to let it be useful

@sdaschner
Copy link
Owner

I see (sorry for the late response, once again :))

So, a solution would be to modularize the Swagger backend impl (so the methods fits the swagger concepts) to make it extendable, while doing the "hard work" in the base API class?

@rmannibucau
Copy link
Contributor Author

Sounds good as the generic solution.

Side note: supporting some widely spread extensions can be good too (restlet, tomitribe, etc...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants