OpenAPITools / OpenAPITools/openapi-generator
NullPointerException when generating Bungie.net OpenAPI spec
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Description
When trying to generate clients for the Bungie.net OpenAPI spec, I get a NullPointerException:
Exception in thread "main" java.lang.NullPointerException
at org.openapitools.codegen.DefaultGenerator.processOperation(DefaultGenerator.java:939)
at org.openapitools.codegen.DefaultGenerator.processPaths(DefaultGenerator.java:910)
at org.openapitools.codegen.DefaultGenerator.generateApis(DefaultGenerator.java:488)
at org.openapitools.codegen.DefaultGenerator.generate(DefaultGenerator.java:868)
at org.openapitools.codegen.cmd.Generate.run(Generate.java:349)
at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:62)
openapi-generator version
3.3.4-SNAPSHOT (master @ c656194f22f9624ee861abe57964758ae7e7bd39)
OpenAPI declaration file content or url
https://raw.githubusercontent.com/Bungie-net/api/master/openapi.json
Command line used for generation
java -jar openapi-generator-cli.jar generate \
--generator-name php \
--config /local/openapi-config.php.json \
--input-spec https://raw.githubusercontent.com/Bungie-net/api/master/openapi.json \
--output /local/bungie-sdk-php \
-DapiTests=false \
-DmodelTests=false \
--verbose
openapi-config.php.json:
{
"packageName": "bungie-sdk-php",
"composerVendorName": "yogarine",
"composerProjectName": "bungie-sdk-php",
"artifactVersion": "2.3.2",
"invokerPackage" : "Bungie",
"modelPackage": "Model",
"apiPackage": "API",
"variableNamingConvention": "camelCase",
"srcBasePath": "src",
"gitUserId": "Yogarine",
"gitRepoId": "bungie-sdk-php",
"validateSpec": false
}
Steps to reproduce
Build with the above command.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the PHP generation command with the Bungie.net openapi.json URL, then inspect DefaultGenerator.java around processOperation (line 939) and processPaths (line 910). Done means the same command completes without the reported NullPointerException and generates the client output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, openapi, php
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100