Effector invoke API accepts form encoded data#75
Conversation
|
I added |
e.g. pathOf http://abc.com/d/e/f == /d/e/f
* Adds FormMapProvider, which reads an InputStream into a Map<String, Object>, where the Object values are either a String, a List<String> or null. * Uses this in EffectorApi to support form encoded data. * Changes signature of EffectorApi.invoke parameters argument from Map<String, String> to Map<String, Object>.
There was a problem hiding this comment.
Preference for Map<String, ? extends Object> so can be more easily called. Not particularly important here as main usage is REST api.
However, I think it's possible to use the EffectorApi with some library goodness to provide a client java api that turns its calls into REST request/response. Do we have that out of interest?
There was a problem hiding this comment.
Do you mean using tools like Retrofit? I think it's probably a change worth making.
There was a problem hiding this comment.
Or maybe not. Changing the signature to Map<String, ? extends Object> results in Jersey warning:
WARNING: The following warnings have been detected with resource and/or provider classes:
WARNING: Parameter 5 of type java.util.Map<java.lang.String, ?> from public abstract javax.ws.rs.core.Response brooklyn.rest.api.EffectorApi.invoke(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.util.Map<java.lang.String, ?>) is not resolvable to a concrete type
And the test added to ApplicationResourceTest fails too.
|
Looks really good. Only some very minor comments. Let me know when you've looked over those and think it's ready to merge. |
|
+1 from me as well. |
A bunch of uncontroversial commits and 85a2b0c which adds FormMapProvider to marshal an InputStream to a
Map<String, Object>. It's used in the effector API to let the invoke method accept form-encoded data.