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
  • #11464
Closed
Open
Issue created Jan 31, 2022 by Administrator@rootContributor4 of 6 checklist items completed4/6 checklist items

[BUG][SPRING] Generates mutlible tags in Operation annotation if more then one tag is defined.

Created by: ugrave

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

If more than one tag is given in the api, the generator generates two tag entries in the operational annotation

openapi-generator version

5.4.0

OpenAPI declaration file content or url
openapi: '3.0.3'
info:
  version: 1.0.0
  title: Example Api
paths:
  /:
    get:
      operationId: example
      tags:
        - tag1
        - tag2
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
Generation Details

Using the spring generator with default annotationLibrary and documentation provider (springdoc).

The openapi declaration above creates this java file:

    @Operation(
        operationId = "example",
        tags = { "tag1", "tag2" },
        tags = { "tag1", "tag2" },
        responses = {
            @ApiResponse(responseCode = "200", description = "OK", content = @Content(mediaType = "application/json", schema = @Schema(implementation =  InlineResponse200.class)))
        }
    )
    @RequestMapping(
        method = RequestMethod.GET,
        value = "/",
        produces = { "application/json" }
    )
    default ResponseEntity<InlineResponse200> example(
Steps to reproduce

See example project.

bug-report.zip

Assignee
Assign to
Time tracking