OpenAPITools / OpenAPITools/openapi-generator

[REQ] Parameter for Maven Plugin to fail if spec validation issues warning

Open
#2,790 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Is your feature request related to a problem? Please describe.

I'd like to instruct the Maven Plugin to result with a BUILD FAILURE in case the spec validation and/or code generation issues a warning.

For instance, I have a yaml file that lacks the operationId for one API path. The Maven Plugin issues the warning:
[WARNING] Empty operationId found for path:

Still the code generation works and the build exists with BUILD SUCCESS, because the operationId is not a mandatory field in the Open API specification.

As my use cases requires to be strict about the specs, I would favor that the build fails in such a case.

Describe the solution you'd like

I would like to have a parameter for the Maven Plugin named like failOnWarning. The default should be false, so that the build works in case of warnings.

Describe alternatives you've considered

Haven't found any workaround yet.

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 locating the Maven Plugin configuration and the code that handles spec-validation or code-generation warnings. Run the existing Maven Plugin tests before making changes. Done means a failOnWarning parameter defaults to false and makes the build fail when enabled and a warning is issued.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, openapi
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 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.