[BUG][Java Spring OAS3] Invalid allowable values generated for enum path variables
Created by: whydoievenneedthis
Description
Enum path variables with java spring oas3 option are generated incorrectly.
openapi-generator version
5.3.1
OpenAPI declaration file content
openapi: 3.0.3
info:
title: Api Documentation
description: Api Documentation
termsOfService: urn:tos
contact: {}
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0
version: '1.0'
paths:
/thingy/{type}:
get:
operationId: get
parameters:
- name: type
in: path
description: type
required: true
schema:
$ref: '#/components/schemas/Periodicity'
responses:
'200':
description: OK
components:
schemas:
Periodicity:
type: string
enum:
- MORNING
- EVENING
- DAILY
- WEEKLY
- BIWEEKLY
- MONTHLY
Generation Details
Generator name: spring Config options: oas3 = true
Generated java code
The following code fragment is generated with the oas3 option turned on:
@Parameter(
name = "type",
description = "type",
required = true,
allowableValues = "MORNING, EVENING, DAILY, WEEKLY, BIWEEKLY, MONTHLY"
)
Expected java code
@Parameter(
name = "type",
description = "type",
required = true,
schema = @Schema(allowableValues = "MORNING, EVENING, DAILY, WEEKLY, BIWEEKLY, MONTHLY")
)