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

Supporting Sink inflection? #230

Open
myok12 opened this issue Dec 15, 2017 · 1 comment
Open

Supporting Sink inflection? #230

myok12 opened this issue Dec 15, 2017 · 1 comment

Comments

@myok12
Copy link

myok12 commented Dec 15, 2017

We want to use swagger-inflector without individual controllers and individual methods. We want to have a single method that accepts incoming requests from multiple operations (somewhat similarly to what one can do with vertx's swagger-router). Obviously, this can be done manually by using swagger-codegen l:java-inflector and then hooking all methods into some shared code, but we'd rather not have to do it at all (manually or using our own code-gen; in fact, we wouldn't be using java-inflector in our project). Not sure if this is a direction the project is willing to accept; if not, I'll fork this project and possibly only support sinks (which is what I need for my project).

I was thinking of 1) exposing an operation-level vendor extension that describe if this operation is handled by a sink and if so, what controller and method. 2) exposing a swagger-level global that applies to all operations (maybe with an operation-level exception). 3) A sink method will accept the request and return a response, but will also accept the operation/operationId (to know which operation was invoked) and an Object[] with the arguments (instead of spreading them).

FYI - a follow up to this will be to add some swagger definition to use AsyncResponse instead of Response, to allow non-blocking handling of requests. This will further change the params.

@webron
Copy link
Contributor

webron commented Feb 12, 2018

@myok12 that's an interesting idea. @frantuma do you have any thoughts on the suggestion?

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