Bug Report Checklist
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
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)
Bug Report Checklist
Description
#17267 moved import of
bytesfrom a specific file model_simple.mustache to generator code that is applied to all files, including model_oneof.mustache that does not usebytes. And this leads to the following error:openapi-generator version
OpenAPI declaration file content or url
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/goSteps 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)