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
  • #5591
Closed
Open
Issue created Mar 13, 2020 by Jim Schubert@jimschubertContributor5 of 6 checklist items completed5/6 checklist items

[BUG][spring] -Dapis requires title-cased tags, even when tags are lowercase

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • What's the version of OpenAPI Generator used?
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Bounty to sponsor the fix (example)
Description

This may be related only to Spring generator.

If a user has a tag defined as devices, the user will have to request -Dapis=Devices (or <apis>Devices</apis> in Maven). This isn't intuitive.

This was found by a user in Slack. I repro'd with:

<configuration>
    <inputSpec>lukas.yml</inputSpec>
    <generatorName>spring</generatorName>
    <configOptions>
        <sourceFolder>/</sourceFolder>
        <modelPackage>org.openapi.tools.model</modelPackage>
        <apiPackage>org.openapi.tools.api</apiPackage>
        <interfaceOnly>true</interfaceOnly>
        <java8>true</java8>
        <dateLibrary>java8</dateLibrary>
        <booleanGetterPrefix>is</booleanGetterPrefix>
        <useTags>true</useTags>
    </configOptions>
    <environmentVariables>
        <apis>Devices</apis>
    </environmentVariables>
</configuration>
openapi-generator version

4.3.0-SNAPSHOT (as of today) and below

OpenAPI declaration file content or url
openapi: 3.0.2
info:
  title: "Java template service"
  description: "Example of java microservice API defined with OpenApi v3"
  version: 1.0.0
tags:
  - name: devices
    description: Box devices
paths:
  '/api/devices':
    get:
      tags:
        - devices
      operationId: "getDevices"
      summary: List of devcies
      description: Devices
      responses:
        200:
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Device"

components:
  schemas:
    Device:
      required:
        - "id"
        - "mac"
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          example: "EF41860F-68AD-4ABE-8D6F-3734EDDE3017"
        mac:
          type: string
          format: mac_address
          readOnly: true
          example: "112233445566"
        online:
          type: boolean
          readOnly: true
          default: false
          example: false
        
Command line used for generation
Steps to reproduce

Copied above maven config into maven example java-client.xml and ran.

Related issues/PRs
Suggest a fix

Support both title and lower cases.

Assignee
Assign to
Time tracking