OpenAPITools / OpenAPITools/openapi-generator

[BUG][openapi-generator-gradle-plugin] openApiGenerate-option validateSpec has no effect

Open
#9,815 0 comments 10 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Description

The task openApiGenerate validates the OpenApi declaration even if the option validateSpec is set to false.

openapi-generator version

5.1.1, master/head

OpenAPI declaration file content or url
  • openapi-generator/modules/openapi-generator-gradle-plugin/samples/local-spec/petstore-v3.0-invalid.yaml
Generation Details

Execution failed for task ':openApiGenerate'.

There were issues with the specification. The option can be disabled via validateSpec (Maven/Gradle) or --skip-validate-spec (CLI).
| Error count: 1, Warning count: 0
Errors:
-attribute info is missing

Steps to reproduce

Gradle build script:

plugins {
  id "org.openapi.generator" version "5.1.1"
}


openApiGenerate {
  validateSpec = false
  generatorName = "typescript-axios"
  inputSpec = "${project.projectDir}/petstore-v3.0-invalid.yaml".toString()
  outputDir = "$buildDir/generated".toString()
}

Related issues/PRs
Suggest a fix

"Quick fix": Move the alternative Option skipValidateSpec next to validateSpec in the description of options in Gradle plugin's README.adoc. Thus, users new to the plugin will see at once, that there is an alternative option that works.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Gradle task with petstore-v3.0-invalid.yaml and validateSpec = false, then inspect the openapi-generator-gradle-plugin implementation and its README.adoc option descriptions. Done means the task respects validateSpec = false, or the documentation clearly directs users to the working alternative if that behavior is intentional.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.