Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-3142

POST with OR WITHOUT a request payload

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 6.1.0.Beta3, 6.1.0.Final
    • 4.7.6.Final
    • None
    • None
    • Hide

      Send POST with no body to:

        @POST
        @Path("mypath")
        Response doit (
            @PathParam("foo") Double foo,
            @PathParam("bar") Double bar,
            MyPayload myPayload);
      
      Show
      Send POST with no body to: @POST @Path("mypath") Response doit ( @PathParam("foo") Double foo, @PathParam("bar") Double bar, MyPayload myPayload);

      Using Wildfly 26.1.1.Final with OpenJDK 11.

      We have a requirement to allow POST with OR WITHOUT a request payload. We have the following...

        @POST
        @Path("mypath")
        Response doit (
            @PathParam("foo") Double foo,
            @PathParam("bar") Double bar,
            MyPayload myPayload);
      

      ...however, when there is no request payload, there is a SEVERE message...

      2022-05-23 16:05:49,220 SEVERE [org.eclipse.yasson.internal.Unmarshaller] (default task-675) Invalid token=EOF at (line no=1, column no=0, offset=-1). Expected tokens are: [CURLYOPEN, SQUAREOPEN, STRING, NUMBER, TRUE, FALSE, NULL]
      

            jperkins-rhn James Perkins
            david.everly David Everly (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: