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

Better REST support #69

Open
iluvtr opened this issue Jul 30, 2017 · 0 comments
Open

Better REST support #69

iluvtr opened this issue Jul 30, 2017 · 0 comments

Comments

@iluvtr
Copy link

iluvtr commented Jul 30, 2017

Hi Stripes, here I make so suggestions in order to give a better REST support.

REST support uses naming patterns which is discouraged because typographical errors may result in silent failures and other points described by Bloch (http://jtechies.blogspot.pe/2012/07/item-35-prefer-annotations-to-naming.html). Now we have annotations. Look at JUnit, they are no more using naming patterns to test classes, they have @test. Naming patterns seems like we're back in Java 1.4. Please let's use @post, @get, @delete,etc. Right now the annotations just doesn't work. These annotations should work even if the ActionBean is not marked with the RestActionBean annotation.

REST support by default, and with no chance for further customization, packages up all the validation errors in a defined way. It will be better if we leave the developer free to change it respecting ValidationErrorHandler. Look line 447 of DispatcherHelper.

REST support doesn't have an expressive way to return headers or error codes. It will be nice if we create a base class called HttpResolution where we can set headers, error codes, check ResponseEntity of Spring MVC or DefaultHttpHeaders of Struts2.

The new class JsonResolution is tightly coupled with Jackson because JsonBuilder uses Jackson directly. What if need Gson? We need a JsonBuilderFactory there.

The parsing of JSON body is tightly coupled with Jackson. I developed in my fork a pluggable content type request wrapper and a Gson implementation.

Thank you so much. I'm open to code these features.

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

1 participant