You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
Using --input-spec-root-directory fails with exception.
PS F:\src\app> java -jar .\openapi-generator-cli.jar generate --input-spec-root-directory .\app\specs -g csharp -o generated
[main] INFO o.o.codegen.config.MergedSpecBuilder - In spec root directory .\app\specs found specs [swagger.yaml]
[main] INFO o.o.codegen.config.MergedSpecBuilder - Reading spec: .\app\specs\swagger.yaml
Merge input spec would be used - .\app\specs\_merged_spec.yaml
[main] WARN io.swagger.v3.parser.OpenAPIV3Parser - Exception while resolving:
java.lang.NullPointerException: Cannot invoke "io.swagger.v3.oas.models.parameters.Parameter.getSchema()" because "parameter" is null
at io.swagger.v3.parser.processors.ExternalRefProcessor.lambda$processRefToExternalPathItem$0(ExternalRefProcessor.java:358)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:196)
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1709)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:570)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:636)
at io.swagger.v3.parser.processors.ExternalRefProcessor.processRefToExternalPathItem(ExternalRefProcessor.java:359)
at io.swagger.v3.parser.processors.PathsProcessor.processReferencePath(PathsProcessor.java:325)
at io.swagger.v3.parser.processors.PathsProcessor.processPaths(PathsProcessor.java:65)
at io.swagger.v3.parser.OpenAPIResolver.resolve(OpenAPIResolver.java:72)
at io.swagger.v3.parser.OpenAPIResolver.resolve(OpenAPIResolver.java:59)
at io.swagger.v3.parser.OpenAPIV3Parser.resolve(OpenAPIV3Parser.java:240)
at io.swagger.v3.parser.OpenAPIV3Parser.readContents(OpenAPIV3Parser.java:183)
at io.swagger.v3.parser.OpenAPIV3Parser.readLocation(OpenAPIV3Parser.java:97)
at io.swagger.parser.OpenAPIParser.readLocation(OpenAPIParser.java:16)
at org.openapitools.codegen.config.CodegenConfigurator.toContext(CodegenConfigurator.java:686)
at org.openapitools.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:744)
at org.openapitools.codegen.cmd.Generate.execute(Generate.java:527)
at org.openapitools.codegen.cmd.OpenApiGeneratorCommand.run(OpenApiGeneratorCommand.java:32)
at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:66)
Exception in thread "main" org.openapitools.codegen.SpecValidationException: 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:
-Cannot invoke "io.swagger.v3.oas.models.parameters.Parameter.getSchema()" because "parameter" is null
at org.openapitools.codegen.config.CodegenConfigurator.toContext(CodegenConfigurator.java:717)
at org.openapitools.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:744)
at org.openapitools.codegen.cmd.Generate.execute(Generate.java:527)
at org.openapitools.codegen.cmd.OpenApiGeneratorCommand.run(OpenApiGeneratorCommand.java:32)
at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:66)
Bug Report Checklist
Tested with https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/7.11.0-SNAPSHOT/openapi-generator-cli-7.11.0-20241218.082146-58.jar
Description
Using --input-spec-root-directory fails with exception.
openapi-generator version
Tested with https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/7.11.0-SNAPSHOT/openapi-generator-cli-7.11.0-20241218.082146-58.jar
and 7.10.0
OpenAPI declaration file content or url
https://github.com/networknt/model-config/blob/master/rest/swagger/petstore/2.0.0/swagger.yaml
Generation Details
Windows 11
Steps to reproduce
--input-spec-root-directory
with any generatorSame issue with json spec.
Related issues/PRs
Suggest a fix
The text was updated successfully, but these errors were encountered: