-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Swagger support #799
base: master
Are you sure you want to change the base?
Swagger support #799
Conversation
… for description info at the accordian area of the UI
Is it possible to do an annotation approach here instead? I think that is cleaner. |
@ruurd the lambda could be annotated -- let me know if you intended something else, otherwise I can make those changes. Here's an example:
I don't see a way this can be done in the method call itself -- meaning the put(...), get(...) delete(...), etc. call itself, at least not in a way I found possible - thus you'll need to declare the lambda in advance of the HTTP verb invocation and then pass that as a parameter from which the swagger content can interrogate the annotations. |
OK I think this is workable. Thanks. |
@ruurd annotations can be applied to local variables generally but the reflection inspection available at run time does not allow for the modeling of these annotations at the local variable level, so they're basically useless unless you want compile time process the code using something like Checker... because of the lambda's there really isn't a way to do this with annotations I can think of.... |
+1 Is it possible push the ball forward on this? |
I realize this issue has been open for quite a while, and not certain if there are plans still to release v3.0 or patch support for 2.x. If anybody is interested, I recently built on some code examples from back in 2016 and updated to support Swagger annotations using the lambda route declaration syntax. The code used to parse and support swagger annotations are minimal, and uses org.reflections and JAX RS with Spark 2.9.4. An example project using this approach is at: https://github.com/ericblue/spark-starter-basic |
Quick Hack to support Swagger v2.0 (incomplete, still in progress)
Produces: