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

Fix treatment of @DefaultValue for missing @PathParam

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 4.0.0.Beta1, 3.5.0.CR1
    • None
    • None
    • None

    Description

      It is possible to have a missing @PathParam:

          public static class PathBeanParamEntity {
             @PathParam("p") String p;
          }
      
          @Path("test")
          public static class Resource {
             @BeanParam PathBeanParamEntity pbpe;
      
             @Path("get") @GET String method() {}
          }
      

      Currently, an InternalServerErrorException is thrown if the request URI doesn't have a matching "p" path parameter, but the javadoc for @DefaultValue says

      If this annotation is not used and the corresponding meta-data is not present in the request, the value will be an empty collection for List, Set or SortedSet, null for other object types, and the Java-defined default for primitive types.
      

      Attachments

        Activity

          People

            rsigal@redhat.com Ronald Sigal
            rsigal@redhat.com Ronald Sigal
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: