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

Fix treatment of @DefaultValue for missing @PathParam

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 4.0.0.Beta1
    • Component/s: None
    • Labels:
      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.
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                ron_sigal Ron Sigal
                Reporter:
                ron_sigal Ron Sigal
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: