Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #14141
Closed
Open
Issue created Nov 29, 2022 by Administrator@rootContributor

[REQ] Add externalDocs to @Operation

Created by: arey

Is your feature request related to a problem? Please describe.

I'm using the openapi-generator-maven-plugin 6.2.1 and its spring-boot library with springdoc-openapi-ui 1.6.6. I'm configuring an externalDocs at operation level like below in a openapi specification file v3.0.3:

paths:
  /hello/{name}:
    get:
      description: "Say Hello to somebody"
      externalDocs:
        url: "https://wiki.mycompany.com"
        description: "API Wiki Specification"
      operationId: hello

The url and description are used in the generated javadoc:

    /**
     * GET /hello/{name}
     * Say Hello to somebody
     *
     * @param name The person's name (required)
     * @return The greeting (status code 200)
     * API Wiki Specification
     * @see <a href="https://wiki.mycompany.com"> Documentation</a>
     */
    @Operation(
        operationId = "hello",
        responses = {
            @ApiResponse(responseCode = "200", description = "The greeting", content = {
                @Content(mediaType = "application/json", schema = @Schema(implementation = MessageResource.class))
            })
        }
    )
    @RequestMapping(

Describe the solution you'd like

I would like a @ExternalDocumentation will be generated:

    @Operation(
        operationId = "hello",
        externalDocs = @ExternalDocumentation(
            description = "API Wiki Specification",
            url = "https://wiki.mycompany.com"
        ),
        responses = {
            @ApiResponse(responseCode = "200", description = "The greeting", content = {
                @Content(mediaType = "application/json", schema = @Schema(implementation = MessageResource.class))
            })
        }
    )
    @RequestMapping(

Thus Springdoc could add an external link:

image

Describe alternatives you've considered

N/A

Additional context

This requirement looks like the issue https://github.com/OpenAPITools/openapi-generator/issues/13994 for the description value of the @Operation.

If you want, I could try to contribute on this feature.

Assignee
Assign to
Time tracking