Uploaded image for project: 'REST Client'
  1. REST Client
  2. MGNLRESTCL-165

rest-client-app does not work with single body parameters

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Neutral
    • None
    • 1.7
    • None
    • None

    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"

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              Unassigned Unassigned
              will Will Scheidegger
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Checklists

                  Bug DoR
                  Task DoD