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

Bean Validation + CDI + field injection not working

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • 3.0.6.Final
    • CDI Integration
    • None

      When CDI is enabled, bean validation doesn't work for field injected @*Param. This is because the validation is triggered before the values get injected and thus the value is always null.

      I have a small project over at https://github.com/arthurc/jaxrstest1 with this issue. See the param field in the app1.poster.Poster class as well as "all" vs. "none" bean-discovery-mode attribute in beans.xml.

      After deploy
      curl -v -X POST --data "param=aaa" http://localhost:8080/jaxrstest1/rest/poster
      
      Expected

      Status code 200 and "Param: aaa"

      Got
      [FIELD]
      [param]
      [may not be null]
      []
      

              rsigal@redhat.com Ronald Sigal
              arthurcarlsson Arthur Carlsson (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: