Skip to content

[BUG] openapiGeneratorIgnoreList  #20039

@michael-upton97

Description

@michael-upton97

-#### Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • I did not provide a spec as the code generation is successful, but the ignoring functionality is not.
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
openapi-generator version

org.openapitools:openapi-generator-gradle-plugin:7.9.0

Generation Details

openapiGeneratorIgnoreList = ["README.md"]

inputSpec = MY_INPUT_DIR
outputDir = MY_OUTPUT_DIR
invokerPackage = MY_PACKAGE
apiPackage = MY_PACKAGE.api
modelPackage = MY_PACKAGE.model

generatorName = "java"
configOptions = [
sourceFolder : "src/main",
library : "resttemplate",
openApiNullable : "false",
performBeanValidation : "true",
useBeanValidation : "true",
generateConstructorWithAllArgs: "true"
]
typeMappings = [
number : "Long"
]
importMappings = [
Long : "java.lang.Long"
]

Steps to reproduce

https://github.com/openapitools/openapi-generator/blob/master/docs/customization.md#ignore-file-format:~:text=openapiGeneatorIgnoreList

I can't get the described functionality above to work for me during code generation.
No matter how I configure openapiGeneratorIgnoreList, the logic does not prevent generation of the given files, or even update the .openapi-generator-ignore file. Please note I have been able to recreate this behavior in two projects, and with version 7.9.0 and 7.2.0 (immediately after this feature was introduced).
I have attempted the following
openapiGeneratorIgnoreList = ["README.md"]
openapiGeneratorIgnoreList = ["README.md".toString()]
openapiGeneratorIgnoreList = ["/README.md"]
openapiGeneratorIgnoreList = ["/README.md".toString()]
openapiGeneratorIgnoreList = ["/README.md"]
openapiGeneratorIgnoreList = ["
/README.md".toString()]
openapiGeneratorIgnoreList = ["**"]

Additionally the documentation seems to have a typo in it, and suggests a spelling of "openapiGeneatorIgnoreList" which is not recognized by IntelliJ, nor can I see it in the source code

Related issues/PRs

#15047
#17889

Suggest a fix

I cannot determine why this is not working in the source code. Perhaps someone could try and recreate it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions