Uploaded image for project: 'Geronimo'
  1. Geronimo
  2. GERONIMO-6722

The AnnotationProcessor should inject media type instead of response code (when endpoint returns void or Response)

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: OpenAPI_1.0.7
    • Fix Version/s: OpenAPI_1.0.8
    • Component/s: None
    • Security Level: public (Regular issues)
    • Labels:
      None

      Description

      The Problem


      Under certain conditions, for example when endpoint returns `void` or generic `Response`, the `AnnotationProcessor` does not properly inject the media type (which could be omitted or explicitly provided using `@Produces` JAX-RS annotation). Here is an example (using Swagger UI here as it is easier to spot the issue visually, the underlying JSON / YAML spec has the same data):


       

      Whereas the expected media type should be compatible with https://tools.ietf.org/html/rfc6838 (https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#mediaTypes). The expected behavior is to set media type to */* (if not provided):

      Or pick the value from `@Produces` annotation.

        Attachments

        1. after.png
          18 kB
          Andriy Redko
        2. before.png
          25 kB
          Andriy Redko

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              reta Andriy Redko

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment