Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG][Go] Unused "bytes" import in v7.2.0 #17575

Closed
5 of 6 tasks
dyurovskykh-tivo opened this issue Jan 10, 2024 · 1 comment · Fixed by #17775
Closed
5 of 6 tasks

[BUG][Go] Unused "bytes" import in v7.2.0 #17575

dyurovskykh-tivo opened this issue Jan 10, 2024 · 1 comment · Fixed by #17775

Comments

@dyurovskykh-tivo
Copy link

dyurovskykh-tivo commented Jan 10, 2024

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

#17267 moved import of bytes from a specific file model_simple.mustache to generator code that is applied to all files, including model_oneof.mustache that does not use bytes. And this leads to the following error:

schema/generated/some-config/model_object_model.go:14:2: "bytes" imported and not used
openapi-generator version
  • 7.2.0
  • latest
OpenAPI declaration file content or url
openapi: 3.0.0
info:
  title: Test
  version: 1.0.0
paths: {}
components:
  schemas:
    NestedObject1:
      required:
        - field1
      properties:
        field1:
          description: Specifies an action name to be used with the Android Intent class.
          type: string
    NestedObject2:
      required:
        - field2
      properties:
        field2:
          description: Specifies an action name to be used with the Android Intent class.
          type: string
    Object:
      oneOf:
        - $ref: '#/components/schemas/NestedObject1'
        - $ref: '#/components/schemas/NestedObject2'
Generation Details

docker run --rm -u 1001:1001 -v "${PWD}:/local" openapitools/openapi-generator-cli:v7.2.0 generate -i /local/test.yaml -g go -o /local/out/go

Steps to reproduce

Run generator and try to build the generated code.

Related issues/PRs

#17267

Suggest a fix

Partial revert of #17267, in particular, code change suggested in #17267 (comment)

@dyurovskykh-tivo dyurovskykh-tivo changed the title [BUG][Go] Unused "bytes v7.2.0 [BUG][Go] Unused "bytes" import in v7.2.0 Jan 10, 2024
@dyurovskykh-tivo
Copy link
Author

@wing328 @ctreatma
Please, check this bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant