openapi-generator: [BUG][Go][Bounty] Go client generator doesn't support deepObject in query
Bug Report Checklist
- Have you provided a full/minimal spec to reproduce the issue?
- 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
Go client generator doesn’t support deepObject in query.
openapi-generator version
v5.3.1
OpenAPI declaration file content or url
openapi: 3.0.0
info:
title: Example
description: Example of deepObject failure.
version: 1.0.0
paths:
/test:
get:
operationId: test
parameters:
- name: filter
in: query
style: deepObject
explode: true
schema:
type: object
properties:
search:
description: Filter.
type: string
responses:
'200':
description: Response.
Generation Details
$ docker run --rm -it \
-v "$(pwd)"/api.yaml:/specs/api.yaml \
openapitools/openapi-generator-cli:v5.3.1 generate -i /specs/api.yaml -g go -o /sdk/go
Steps to reproduce
- store example in api.yaml
- run example from “generation details”
expected result: exit code 0 and successful generated content
actual result:
Exception: null
at org.openapitools.codegen.DefaultGenerator.processOperation(DefaultGenerator.java:1175)
at org.openapitools.codegen.DefaultGenerator.processPaths(DefaultGenerator.java:1066)
at org.openapitools.codegen.DefaultGenerator.generateApis(DefaultGenerator.java:566)
at org.openapitools.codegen.DefaultGenerator.generate(DefaultGenerator.java:907)
at org.openapitools.codegen.cmd.Generate.execute(Generate.java:441)
at org.openapitools.codegen.cmd.OpenApiGeneratorCommand.run(OpenApiGeneratorCommand.java:32)
at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:66)
Caused by: java.lang.NullPointerException
Related issues/PRs
Suggest a fix
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 18 (6 by maintainers)
Commits related to this issue
- issue #11401 - Go client generator doesn't support deepObject in query — committed to parvit/openapi-generator by parvit 2 years ago
- issue #11401 - Go client generator doesn't support deepObject in query — committed to parvit/openapi-generator by parvit 2 years ago
- Issue 11401 - report correctly the parameters with the deep object specification (#13909) * issue #11401 - Go client generator doesn't support deepObject in query * samples generation * fix gen... — committed to OpenAPITools/openapi-generator by parvit 2 years ago
Fixed via https://github.com/OpenAPITools/openapi-generator/pull/13909. Thanks @parvit for the PR.
@altitude Can you please pull the latest master to give it a try and send @parvit the bug bounty if the fix is good? Thanks.
Hi all, i’ve created a PR for this feature, please review it.