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
  • #2319
Something went wrong while setting issue due date.
Closed
Open
Issue created 6 years ago by Administrator@rootContributor
  • New related issue

  • Report abuse to administrator

  • New related issue

  • Report abuse to administrator

[BUG] Gradle plugin, value of validateSpec is overridden by skipValidateSpec

Closed

[BUG] Gradle plugin, value of validateSpec is overridden by skipValidateSpec

Created by: iurii-untilov

Description

Please see: https://github.com/OpenAPITools/openapi-generator/blob/b302c16f74fdbf8d6034b924e0906ad60b4d5d29/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt#L528

            skipValidateSpec.ifNotEmpty { value ->
                configurator.setValidateSpec(value)
            }

as a result validateSpec is set as value of skipValidateSpec, as by default skipValidateSpec == false it means that validateSpec will be assigned false, and build will not fail even in case of errors in provided swagger / openApi specification.

openapi-generator version

4.0.0-beta2

Command line used for generation

./gradlew openApiGenerate

Steps to reproduce

Run openApiGenerate for invalid swagger/openAPI specification, it should continue even after reporting that errors where found: There were issues with the specification, but validation has been explicitly disabled.

Suggest a fix

Please rewrite it as:

            skipValidateSpec.ifNotEmpty { value ->
                configurator.setSkipValidateSpec(value)
            }
Tasks
0
server returned results with length 1, expected length of 9

Linked items
0

Link issues together to show that they're related. Learn more.

Activity


Please register or sign in to reply
0 Assignees
None
Assign to
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
Due date
None
None
None
Time tracking
No estimate or time spent
Confidentiality
Not confidential
Not confidential

You are going to turn on confidentiality. Only project members with at least the Reporter role, the author, and assignees can view or be notified about this issue.

Lock issue
Unlocked
0
0 participants
Reference: