Skip to content

[BUG][Go][Bounty] Go client generator doesn't support deepObject in query #11401

@kamilsk

Description

@kamilsk

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
  1. store example in api.yaml
  2. 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

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