swagger-core
                                
                                 swagger-core copied to clipboard
                                
                                    swagger-core copied to clipboard
                            
                            
                            
                        @ApiResponse cannot infer parametrised type with Java Generics
I have the following code snippet
public class ApiStandardResponse<T> {
    T data;
}
and use that to annotate my endpoint
@Operation(
   ...
      responses = {
          @ApiResponse(
              responseCode = "200",
              description = "Success",
              content = {@Content(
                  mediaType = "application/json",
                  schema = @Schema(implementation = ApiStandardResponse.class)
              )}
          )
      }
   ...
  )
It turns out that there is no way to specify the parametrised type and thus swagger ui cannot infer it making it impossible for contract clients to generate the appropriate stubs

Is there an elegant way to specify the parametrised type somehow without using workarounds such as subclasses?