[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.