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

Multiple Swagger Docs in same Javalin Application #893

Closed
A1Liu opened this issue Mar 8, 2020 · 5 comments
Closed

Multiple Swagger Docs in same Javalin Application #893

A1Liu opened this issue Mar 8, 2020 · 5 comments

Comments

@A1Liu
Copy link

A1Liu commented Mar 8, 2020

Describe the feature
I'd like to be able to document multiple different APIs separately in the same Javalin application. I.e. have 3 handlers go to doc A, and have another 3 handlers go to doc B.

Additional context
The purpose of this feature request is API versioning; I'd like to version my API, and have separate docs for each version.

@tipsy
Copy link
Member

tipsy commented Mar 8, 2020

Interesting idea. Did you look into this when you were creating the plugin @TobiasWalle?

@tobias-walle
Copy link
Contributor

@A1Liu This use case is indeed very interesting. I didn't though about it yet.

Could you provide an example on how you would like to use a feature like that? Do you have any proposals for a possible api?

@A1Liu
Copy link
Author

A1Liu commented Mar 9, 2020

@TobiasWalle I'd use it to document different versions of my API.

Also, I think it'd be fine if Javalin added support for nesting Javalin instances on the same threadpool, then we could just attach different endpoints to different Javalin instances and attach docs to those instances.

@28Smiles
Copy link
Contributor

Imo, the most intutive to do in this case is to add a sort of tag for every endpoint. Is the tag unset, will the doc be visible in the default swagger, is it set, will the endpoint be visible in /swagger/{tag}.

@tipsy
Copy link
Member

tipsy commented Mar 22, 2020

I agree that adding a "tag" (but not an "OpenAPI tag") makes sense. I guess we have one root object now for building the OpenAPI document, but instead we would need a set of such objects? 🤔

It doesn't sound too complicated, but that depends a lot on the current implementation, which I'm still not familiar with. I'd be happy to review a PR if someone wants to work on this.

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

No branches or pull requests

4 participants