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
  • #11218
Closed
Open
Issue created Jan 03, 2022 by Administrator@rootContributor

Cannot find symbol 'allowableValues' in pathParams template with oas3 and JavaSpring

Created by: agmyrek

Description

Defining an enum schema in parameters object will cause the following compiling error:

'cannot find symbol': allowableValues

You can see the causing code here:

https://github.com/OpenAPITools/openapi-generator/blob/5.3.x/modules/openapi-generator/src/main/resources/JavaSpring/pathParams.mustache

The field "allowableValues" no longer exists in the annotation @Parameter from io.swagger.v3.oas.annotations

openapi-generator version

5.3.1

OpenAPI declaration file content or url
openapi: 3.0.3
paths:
  /api/{myEnum}:
    post:
      parameters:
        - name: myEnum
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/MyEnum'
components:
  schemas:
    MyEnum:
      type: string
      enum:
        - A
        - B
        - C
Generation Details

I am using the maven plugin with the following config option:

<oas3>true</oas3>

Steps to reproduce

generate with maven plugin

Suggest a fix

Remove "allowableValues" from the template and use the @Schema annotation

Assignee
Assign to
Time tracking