-
Notifications
You must be signed in to change notification settings - Fork 123
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
Programmatic Server APIs for producing RESTful APIs #1301
Comments
In my opinion, such an API completely contradicts the basic idea of the previous JAX-RS API. I don't see any advantage over the previous API. Can you give us a few advantages of what is supposed to be better with the new API than with the previous one? |
The annotation-based resources class and programmatic APIs should share a common code base. For developers, it provides two options for building RESTful APIs, more flexible.
As https://github.com/hantsy/spring-puzzles/tree/master/programming-models, spring provides several options when archiving the same purpose. And as I saw in some ppt of demonstrating Jakarta EE future, if we provide more Bootstrap APIs for specs, such as Messaging, etc. (CDI, REST already included Bootstrap API), and a root |
This is introducing a whole new API flavor that isn't declarative or traditional IoC. Although useful for some applications, it probably does not belong in Jakarta REST. |
@spericas Check the API design of Spring WebFlux. I hope annotation resources and route functions share the same handling process in the background. It is NOT a whole new thing. |
I disagree. The moment your handlers are of the form |
We can get the raw data(headers, params, path variables) directly in the A programmatic API tries to remove the use of annotations, using functional API to assemble the process manually. |
Jersey does support a proprietary programmatic API for building resources. Maybe if other vendors do support similar API, it would make sense to standardize it. |
@jansupol It looks good, but the programming style is a little old, I would like to embrace the Java 8
|
Spring WebMvc and WebFlux provide flexible APIs for developers to build Web APIs by annotation controllers or functional programming APIs.
Every request handler is something like a
Function<Request, Response>
.In Jakarta Rest, we can add a method to
Application
to accept route definitions or declare a CDI bean via@Produces
.See:
The text was updated successfully, but these errors were encountered: