Skip to content

Duplicate declarations in generated types #256

@popsu

Description

@popsu

Hi,

I'm getting duplicate declarations of types in the generated code. I'm using this YAML file.

Code to reproduce:

curl "https://raw.githubusercontent.com/radiantearth/stac-api-spec/47eaaee5b22bc9fde796972c0206f964407fed09/STAC.yaml" >STAC.yaml
oapi-codegen -generate types STAC.yaml > types.gen.go

In the generated code I get duplicate declarations:
Screenshot from 2020-11-20 17-09-08

Seems like the duplicate declarations are all from #/components/parameters, #/componenters/responses and #/components/schemas from the YAML file when there is name collision. For example there is bbox in #/components/parameters and #/components/schemas and they both get generated as Bbox type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions