Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-6412

MessageBodyReader and MessageBodyWritter should follow different sorting rule

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Implemented
    • 3.0.4, 2.7.15, 3.0.5
    • 3.1.1, 3.0.6
    • JAX-RS
    • None
    • Unknown
    • Patch

    Description

      According to JSR-339 spec, section 4.2.1 and 4.2.2, we need follow different sorting rule for MessageBodyReader and MessageBodyWritter:

      For MessageBodyReader, it is:
      <h3> 2. Identify the Java type of the parameter whose value will be mapped from the entity body. Section 3.7</h3>
      describes how the Java method is chosen.
      <h3>3. Select the set of MessageBodyReader classes that support the media type of the request, see Section 4.2.3. </h3>

      For MessageBodyWritter, it is:
      <h3>4. Sort the selected MessageBodyWriter providers with a primary key of generic type where providers whose generic type is the nearest superclass of the object class are sorted first and a secondary key of media type (see Section 4.2.3).</h3>

      But in our implementation, we use the same sorting rule:
      1. compareClasses() ->compareSortedMediaTypes()

      This caused an issue in https://issues.apache.org/jira/browse/CXF-6380.

      Actually we need to adjust the MessageBodyReader sorting method.

      Attachments

        Activity

          People

            sergey_beryozkin Sergey Beryozkin
            irisding Iris Ding
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: