Uploaded image for project: 'Opencast'
  1. MH-12795

REST docs don't respect @Produces annotation on class level

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed and reviewed
    • Affects versions: 4.2
    • Fix versions: 5.0
    • Labels:
      None
    • Severity:
      Incorrect Documentation
    • Steps to reproduce:
      Hide
      Steps to reproduce:
      1. Open REST docs for an endpoint that uses the @Produces annotation on class level
       
       Actual Results:
      The section "Response formats" will not display the formats as defined by the @Produces annotation on class level.

      Java defines the following behaviour:
      "The @Produces annotation is used to specify the MIME media types or representations a resource can produce and send back to the client. If @Produces is applied at the class level, all the methods in a resource can produce the specified MIME types by default. If applied at the method level, the annotation overrides any @Produces annotations applied at the class level."

      See https://javaee.github.io/tutorial/jaxrs002.html#GIPZH
       
       Expected Results:
      The REST docs should correctly display the Response formats.
       
       Workaround (if any):
       





      Show
      Steps to reproduce: 1. Open REST docs for an endpoint that uses the @Produces annotation on class level    Actual Results: The section "Response formats" will not display the formats as defined by the @Produces annotation on class level. Java defines the following behaviour: "The @Produces annotation is used to specify the MIME media types or representations a resource can produce and send back to the client. If @Produces is applied at the class level, all the methods in a resource can produce the specified MIME types by default. If applied at the method level, the annotation overrides any @Produces annotations applied at the class level." See https://javaee.github.io/tutorial/jaxrs002.html#GIPZH    Expected Results: The REST docs should correctly display the Response formats.    Workaround (if any):  

      TestRail: Results

        Attachments

          Activity

            People

            • Assignee:
              staubesv Sven Stauber
              Reporter:
              staubesv Sven Stauber
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                TestRail: Cases