Skip to content

Duplicate declarations in generated types #256

Closed

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.

Activity

  1. popsu commented on Nov 20, 2020

    @popsu
    Author

    Seems like this is duplicate of #254

  2. migueleliasweb commented on Aug 26, 2021

    @migueleliasweb
    Contributor

    Possibly a duplicate of #386

  3. migueleliasweb commented on Aug 29, 2021

    @migueleliasweb
    Contributor

    @popsu Any luck getting around this problem? I'm suffering from the exact same issue =(

  4. added a commit that references this issue on Aug 29, 2021
    c0d4b93
  5. ghost closed this as completedin #436on Oct 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions