Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add media type to @Content annotation metadata if available (OAS 3.x) #879

Merged
merged 2 commits into from Mar 25, 2021

Conversation

reta
Copy link
Contributor

@reta reta commented Mar 16, 2021

Add media type to @content annotation metadata if available (OAS 3.x), closes #835. A few samples of the generated mediaType metadata:

 @ApiResponses(                                                            
   value = {                                                               
     @ApiResponse(                                                         
       responseCode = "201",                                               
       description = "",                                                   
       content =                                                           
           @Content(                                                       
             mediaType = "application/json",                               
             schema = @Schema(implementation = Person.class)               
           )                                                               
     ),                                                                    
     @ApiResponse(                                                         
       responseCode = "409",                                               
       description = "Person with such e-mail already exists",             
       content =                                                           
           @Content(                                                       
             mediaType = "application/problem+json",                       
             schema = @Schema(implementation = ErrorDetails.class)         
           )                                                               
     )                                                                     
   }                                                                       
 )                                                                         
  @ApiResponses(                                                                      
    value = {                                                                         
      @ApiResponse(                                                                   
        responseCode = "200",                                                         
        description = "",                                                             
        content =                                                                     
            @Content(                                                                 
              mediaType = "*/*",                                                      
              array = @ArraySchema(schema = @Schema(implementation = Person.class))   
            )                                                                         
      )                                                                               
    }                                                                                 
  )                                                                                   

Checked:

  • spring
    • spring-boot
    • spring-mvc
    • spring-cloud
  • jaxrs-jersey
  • jaxrs-di
  • jaxrs-resteasy-eap
  • jaxrs-resteasy
  • jaxrs-cxf-cdi
  • jaxrs-cxf
  • jaxrs-spec

@HugoMario mind taking a look please? Thanks!

@reta
Copy link
Contributor Author

reta commented Mar 21, 2021

Sorry @HugoMario , mind taking a look? Trivial one :)

@HugoMario HugoMario merged commit 16520be into swagger-api:master Mar 25, 2021
@HugoMario
Copy link
Contributor

thanks @reta !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[JavaSpring] Missing media type on @Content in @ApiResponse with new OAS annotations
2 participants