-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Add @Field, @Part and @Path #1448
Add @Field, @Part and @Path #1448
Conversation
3be3e1a to
3ed9709
Compare
3ed9709 to
624acaf
Compare
|
I would add the annotations |
|
@yDelouis adding that header again and again is a little bit dumb i think. Maybe we should create |
|
With retrofit, according to the main page, you have to add
Maybe we should wait the plugin system also. |
|
What is the difference between |
|
|
|
Are you sure I rename |
624acaf to
70cee67
Compare
|
|
|
These two would only work with |
|
No, this could be used with |
|
Well, in that case we could allow it for any HTTP method. |
|
I realized that we already use the "url variable" term for path parameters in the existing code and messages. Maybe we should use |
35201be to
bad67c5
Compare
|
This PR is already big. The work for |
|
Okay for making another PR. |
37aebd9 to
bd903b1
Compare
|
@yDelouis i am starting to think we should require annotations for all method parameters in a REST method. That way the AA code would be more simpler, and also it would be much more clearer for the caller how to use the parameters. It will break the API, but users will see the change and the necessary actions at compile-time. |
|
You're right. And with the plugin system, we are breaking everything so we shouldn't worry about that. |
|
👍 |
bd903b1 to
8e2d87c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you put process before validate ? It's a bit strange to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, i do not know why i did it.
|
It seems good. Could you rebase and address my comments. |
8e2d87c to
c2fe71e
Compare
|
Wiki edited. |
@PathParam: allows to add different url variable name than the method parameter name. It can be expanded later to use url encoding.@Field: allows to add post parameters as method parameters, just like url variables. Form data and multipart data are supported.About multipart: currently, it requires some boilerplate, but much less than before:
It would be better to remove the need for this.
@Headers(@Header(headerName = "Content-Type", value = MULTIPART_FORM_DATA ))@Partannotation which automatically adds the header, and works like@Field@Postwhich adds the headerResourceI am open to any suggestions.
Implements #1438.