Skip to content

[BUG][GO] Invalid property type for free form object #3277

@shaxbee

Description

@shaxbee

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • What's the version of OpenAPI Generator used?
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?map[string]interface{}
Description

Free form object property yields map[string]map[string]interface{} where it should be map[string]interface{}

openapi-generator version

4.0.1

OpenAPI declaration file content or url
components:
  schemas:
    Response:
      type: object
      properties:
        payload:
          type: object
          additionalProperties: {}
Command line used for generation
openapi-generator-cli generate -i ../api.yaml -g go -o . -DpackageName=api -DwithGoCodegenComment
Steps to reproduce

Generate go client using given schema.

Suggest a fix

Tried changing getTypeDeclaration in AbstractGoCodegen.java to use ModelUtils.isFreeFormObject to no avail.
Also attempted changing template with no success.

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