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

Add support for injecting Optional<T> parameter types

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Done
    • Icon: Major Major
    • 4.3.0.Final, 3.9.0.Final
    • None
    • jaxrs
    • None

      Currently, PathParam and QueryParam support the following construct (from https://docs.jboss.org/resteasy/docs/3.0.17.Final/userguide/html_single/#_PathParam):

      The parameter type you inject into can be any primitive type, a String, or any Java object that has a constructor that takes a String parameter, or a static valueOf method that takes a String as a parameter.

      Proposal is to also support java.util.Optional.ofNullable as a wrapper object for Strings, which is always called. This will eliminate all null checks for optional parameters in resource classes with the different Optional followup methods, such as optional.ifPresent.

              weli@redhat.com Weinan Li
              tagliola_jira Claudio Tagliola (Inactive)
              Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: