Closed spring-projects-issues closed 12 years ago
wims.tijd commented
would it not be just to send the json over as in :
invocation.open("GET", url, true); invocation.send(json);
Jon Brisbin commented
The latest snapshot includes code to deal with this situation by allowing you to specify a query parameter of the ID of the complex parameter. In your example, adding a query string of "?customer=1" would look up the Customer entity with ID "1" and use that as the parameter. If the type is not managed by a Repository, then replace the ID value with serialized JSON.
Additionally, it was necessary to add code to enforce putting @Param
on query method parameters since abstract classes (including interfaces) do not keep debug information in the bytecode so it isn't possible to use the method parameter name on the interface as the query parameter key. To properly expose the search method you use as an example, you'd need to add @Param
("customer") to your method parameter
Jon Brisbin commented
Added code to allow you to specify an ID in a query parameter for complex objects managed by a repository. The exporter will look up a managed entity by that ID and use that as the parameter. If the complex object is not managed by a repository, then there should either be a ConversionService converter for that type to turn a String (the URL query string parameter) into that object or you can specify a complex object as a fragment of JSON as the value of the query string parameter. Be sure the JSON is properly URL-encoded, though
Oliver Drotbohm opened DATAREST-27 and commented
Assume you have a repository like this:
If the method now gets exposed, how shall one provide the
Customer
object for theGET
request? Currently a plain call tocauses a
Affects: 1.0.0.RC1