question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Cannot suppress "[WARNING] Output directory does not exist, or is inaccessible. No file (.openapi-generator-ignore) will be evaluated." message.

See original GitHub issue

Bug Report Checklist

  • [n/a] Have you provided a full/minimal spec to reproduce the issue?
  • [n/a] Have you validated the input using an OpenAPI validator
  • [openapi-generator-maven-plugin:4.0.2] What’s the version of OpenAPI Generator used?
  • [yes] Have you search for related issues/PRs?
  • [See Description] What’s the actual output vs expected output?
Description

Everything in my application works i.e. the expected OpenAPI docs are working/visible… But I don’t know how to suppress the warning message (shown below) logged during my Maven builds that use the openapi-generator-maven-plugin:4.0.2:generate Maven goal:

[WARNING] Output directory does not exist, or is inaccessible. No file (.openapi-generator-ignore) will be evaluated.

I flailed around putting a .openapi-generator-ignore file in my project root, etc. to no avail. It looks like it wants the Maven target directory but I cannot tell from that message. The target directory won’t exist if the project has been cleaned.

Why this is labeled as a Bug:

1.) The warning appears redundant as everything works. Spurious warnings keep Maven users from using Maven’s fail-on-warning capability. 2.) The code should anticipate situations where the output directory does not exist. 3.) The warning message does not say what directory is missing, frustrating any debugging attempt.

Code Location:
LOGGER.warn("Output directory does not exist, or is inaccessible. No file (.openapi-generator-ignore) will be evaluated.");
openapi-generator version

Maven Plugin: openapi-generator-maven-plugin:4.0.2

Maven Plugin Verbose Output: [WARNING] logged on eighth line.

[INFO] --- openapi-generator-maven-plugin:4.0.2:generate (default) @ myapp ---
[INFO] 
VERBOSE MODE: ON. Additional debug options are injected
 - [debugOpenAPI] prints the OpenAPI specification as interpreted by the codegen
 - [debugModels] prints models passed to the template engine
 - [debugOperations] prints operations passed to the template engine
 - [debugSupportingFiles] prints additional data passed to the template engine
[WARNING] Output directory does not exist, or is inaccessible. No file (.openapi-generator-ignore) will be evaluated.
[INFO] OpenAPI Generator: spring (server)
[INFO] Generator 'spring' is considered stable.
{
  "openapi" : "3.0.1",
  "info" : {
    "title" : "MyApp",
    "version" : "0.0.1"
  },
  "servers" : [ {
    "url" : "http://localhost:8080",
    "description" : "Development server"
  }, {
    "url" : "https://localhost:8080",
    "description" : "Development server with TLS Profile"
  } ],
  "security" : [ {
    "jwt" : [ ]
  } ],
  "paths" : { },
  "components" : {
    "schemas" : { },
    "securitySchemes" : {
      "jwt" : {
        "type" : "http",
        "description" : "JWT Authentication",
        "scheme" : "bearer",
        "bearerFormat" : "JWT"
      }
    }
  }
}
[INFO] ----------------------------------
[INFO] Environment variable JAVA_POST_PROCESS_FILE not defined so the Java code may not be properly formatted. To define it, try 'export JAVA_POST_PROCESS_FILE="/usr/local/bin/clang-format -i"' (Linux/Mac)
[INFO] NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI).
[INFO] Invoker Package Name, originally not set, is now derived from api package name: com.myorg.myapp.web
[INFO] ############ Model info ############
[ ]
[INFO] ############ Operation info ############
[ ]
[INFO] ############ Supporting file info ############
{
  "appVersion" : "0.0.1",
  "generatorClass" : "org.openapitools.codegen.languages.SpringCodegen",
  "supportJava6" : false,
  "groupId" : "org.openapitools",
  "invokerPackage" : "com.myorg.myapp.web",
  "apiFolder" : "com/myorg/myapp/web/api",
  "developerEmail" : "team@openapitools.org",
  "authMethods" : [ {
    "name" : "jwt",
    "type" : "http",
    "scheme" : "bearer",
    "hasMore" : false,
    "isBasic" : true,
    "isOAuth" : false,
    "isApiKey" : false,
    "isBasicBasic" : false,
    "isBasicBearer" : true,
    "bearerFormat" : "JWT",
    "vendorExtensions" : { },
    "isKeyInQuery" : false,
    "isKeyInHeader" : false,
    "isKeyInCookie" : false,
    "isCode" : false,
    "isPassword" : false,
    "isApplication" : false,
    "isImplicit" : false
  } ],
  "generateModelDocs" : true,
  "generateModelTests" : true,
  "generateApiTests" : true,
  "generateModels" : true,
  "serializableModel" : false,
  "inputSpec" : "/home/user/dev/MyApp/src/main/resources/swagger/api.yml",
  "host" : "localhost",
  "artifactUrl" : "https://github.com/openapitools/openapi-generator",
  "developerOrganization" : "OpenAPITools.org",
  "delegatePattern" : true,
  "models" : [ ],
  "hasBearerMethods" : true,
  "fullJavaUtil" : false,
  "lambdaRemoveLineBreak" : { },
  "openapi-yaml" : "openapi: 3.0.1\ninfo:\n  title: MyApp\n  version: 0.0.1\nservers:\n- description: Development server\n  url: http://localhost:8080\n- description: Development server with TLS Profile\n  url: https://localhost:8080\nsecurity:\n- jwt: []\npaths: {}\ncomponents:\n  schemas: {}\n  securitySchemes:\n    jwt:\n      bearerFormat: JWT\n      description: JWT Authentication\n      scheme: bearer\n      type: http\n",
  "configPackage" : "org.openapitools.configuration",
  "basePackage" : "org.openapitools",
  "appDescription" : "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)",
  "contextPath" : "",
  "hasAuthMethods" : true,
  "javaUtilPrefix" : "",
  "licenseName" : "Unlicense",
  "releaseNote" : "Minor update",
  "version" : "0.0.1",
  "apiInfo" : {
    "apis" : [ ]
  },
  "modelDocPath" : "docs/",
  "withXml" : false,
  "lambdaEscapeDoubleQuote" : { },
  "scmDeveloperConnection" : "scm:git:git@github.com:openapitools/openapi-generator.git",
  "useNullForUnknownEnumValue" : false,
  "licenseUrl" : "http://unlicense.org",
  "isDelegate" : "true",
  "jsr310" : "true",
  "generatedYear" : "2019",
  "modelPackage" : "com.myorg.myapp.web.api.model",
  "openAPI" : {
    "openapi" : "3.0.1",
    "info" : {
      "title" : "MyApp",
      "version" : "0.0.1"
    },
    "servers" : [ {
      "url" : "http://localhost:8080",
      "description" : "Development server"
    }, {
      "url" : "https://localhost:8080",
      "description" : "Development server with TLS Profile"
    } ],
    "security" : [ {
      "jwt" : [ ]
    } ],
    "paths" : { },
    "components" : {
      "schemas" : { },
      "securitySchemes" : {
        "jwt" : {
          "type" : "http",
          "description" : "JWT Authentication",
          "scheme" : "bearer",
          "bearerFormat" : "JWT"
        }
      }
    }
  },
  "scheme" : "http",
  "sourceFolder" : "src/main/java",
  "javaVersion" : "1.8",
  "apiDocPath" : "docs/",
  "generateApis" : true,
  "title" : "my-app",
  "serverPort" : "8080",
  "basePathWithoutHost" : "",
  "useSpringfox" : true,
  "developerOrganizationUrl" : "http://openapitools.org",
  "jackson" : true,
  "servers" : [ {
    "url" : "http://localhost:8080",
    "description" : "Development server",
    "variables" : [ ]
  }, {
    "url" : "https://localhost:8080",
    "description" : "Development server with TLS Profile",
    "variables" : [ ]
  } ],
  "java8" : "true",
  "jdk8" : true,
  "useBeanValidation" : true,
  "artifactId" : "openapi-spring",
  "artifactDescription" : "OpenAPI Java",
  "hideGenerationTimestamp" : false,
  "disableHtmlEscaping" : false,
  "developerName" : "OpenAPI-Generator Contributors",
  "scmConnection" : "scm:git:git@github.com:openapitools/openapi-generator.git",
  "configOptions" : [ {
    "modelPackage" : "com.myorg.myapp.web.api.model"
  }, {
    "title" : "myapp"
  }, {
    "apiPackage" : "com.myorg.myapp.web.api"
  }, {
    "delegatePattern" : "true"
  } ],
  "unescapedAppDescription" : "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)",
  "templatingEngine" : "mustache",
  "artifactVersion" : "0.0.1",
  "appName" : "MyApp",
  "generateApiDocs" : true,
  "generatorVersion" : "4.0.2",
  "performBeanValidation" : false,
  "apiPackage" : "com.myorg.myapp.web.api",
  "scmUrl" : "https://github.com/openapitools/openapi-generator",
  "hasServers" : true,
  "basePath" : "http://localhost:8080",
  "gitRepoId" : "GIT_REPO_ID",
  "booleanGetterPrefix" : "get",
  "generatedDate" : "2019-11-27T12:45:14.624-07:00[America/Denver]",
  "appDescriptionWithNewLines" : "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)",
  "gitUserId" : "GIT_USER_ID"
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:10
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
florentbocommented, Jan 27, 2021

I don’t see the warning anymore in version 5.0.0. If somebody can confirm this, we can close the issue.

I am using the 5.0.0 version and the warning is still present

2reactions
martinfoersterlingcommented, Mar 2, 2020

The code suggests that this warning occurs when the directory where an ignore could be doesn’t exist. It’s not even a warning about a missing ignore file. If the latter happens, it’s just an INFO message.

Please remove the warning entirely or make it INFO.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to skip generation of ".openapi-generator" folder when ...
It turns out that this file is generated at the maven-plugin level and is hard-coded to be generated. See source code. There is...
Read more >
How can I suppress warning that "Conversion to Swift 5 is ...
After upgrading to Xcode 13.2 I receive a warning that "Conversion to Swift 5 is available". If I click the warning then a...
Read more >
Warning Options (Using the GNU Compiler Collection (GCC))
3.8 Options to Request or Suppress Warnings. Warnings are diagnostic messages that report constructions that are not inherently erroneous but that are risky ......
Read more >
FAQ: Extending - OpenAPI Generator
OpenAPI Generator has a built-in ignore file processor. ... .openapi-generator-ignore in the root of the output directory with the contents:.
Read more >
4.8. Options to Request or Suppress Warnings - MIT
Warnings are diagnostic messages that report constructions which are not inherently erroneous but which are risky or suggest there may have been an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found