[MGNLRESTCL-165] rest-client-app does not work with single body parameters Created: 25/Nov/20  Updated: 25/Nov/20

Status: Open
Project: REST Client
Component/s: None
Affects Version/s: 1.7
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Will Scheidegger Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled

 Description   

If you have a rest method, which does not take any parameters other than the body, the client app will fail to execute the request:

 

@POST
@Path("/v1/recommendations")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
JsonNode recommendations(String body);

{{The parseParameters() method will either not parse any parameters (if you don't enter "body=" in the "Method parameters" field) or will give return "}}Wrong number of arguments" error (when you do add the "body=" parameter). The only way to get this to work Is to add a dummy parameter like so:

@POST
@Path("/v1/recommendations")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
JsonNode recommendations(String body, @HeaderParam("Foo") String foo);

and then fill in the Method parameters as such:

"Foo"="Bar"



 Comments   
Comment by Will Scheidegger [ 25/Nov/20 ]

After I created the ticket, I noticed that this seems to be fixed with version 2.0 according to MGNLRESTCL-99

 

Generated at Mon Feb 12 10:43:49 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.