kbuntrock / openapi-maven-plugin

Generate openapi documentation for SpringMVC or JaxRS/JakartaRS projects.
https://kbuntrock.github.io/openapi-maven-plugin/
MIT License
13 stars 8 forks source link

Add support for Swagger annotations #118

Closed hugop95 closed 3 months ago

hugop95 commented 3 months ago

Annotations such as @Operation(summary = 'What I am doing') could fill the summary OpenAPI attribute, and

@ApiResponses(value = {
            @ApiResponse(responseCode = "200", description = "Success"),
            @ApiResponse(responseCode = "400", content = {
                    @Content(schema = @Schema(implementation = AnotherSchema.class))})
    })
    @PostMapping(produces = MediaType.APPLICATION_JSON_VALUE)
    ResponseEntity<MySchema> test()

could generate

responses:
  '200':
    description: Success
    content:
      application/json:
        schema:
          "$ref": "#/components/schemas/MySchema"
  '400':
    description: Bad Request
    content:
      application/json:
        schema:
          "$ref": "#/components/schemas/AnotherSchema"
hugop95 commented 3 months ago

Closing as duplicate of #64