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

Unable to extract null to numerical parameter

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 6.2.7.Final, 7.0.0.Alpha1
    • None
    • Core
    • None

      Describe the bug

      @GET
      @Path("/hello")
      @Produces(MediaType.APPLICATION_JSON)
      public Object hello(@QueryParam Long userId) {
          return userId;
      }
      

      if my request param is nothing and the url will be
      http://localhost:8080/hello?userId=

      Expected behavior

      return null
      or
      return 0

      Actual behavior

      return nothing
      the error is
      Unable to extract parameter from http request: jakarta.ws.rs.QueryParam("userId") value is '' for public java.lang.Object xxx

              rhn-support-rbudinsk Rastislav Budinský (Inactive)
              jperkins-rhn James Perkins
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: