Skip to content

Duplicate Key Error during parser/properties/enum #587

Closed
@AlexandreODelisle

Description

@AlexandreODelisle

Describe the bug
GitHub OpenAPI Descriptor parsing

It seems we can not parse the GitHub OpenAPI since in the SCIM emu we have twice the value ( add and Add )

    values = EnumProperty.values_from_list(value_list)
  File "/home/adelisle/.local/lib/python3.8/site-packages/openapi_python_client/parser/properties/enum_property.py", line 61, in values_from_list
    raise ValueError(f"Duplicate key {key} in Enum")
ValueError: Duplicate key ADD in Enum

To Reproduce
Steps to reproduce the behavior:
openapi-python-client generate --url https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/api.github.com/api.github.com.json\?_sm_au_\=iHVj504RWD4Fn7kPLVN2jKsTtN4QF

Expected behavior
I would have thought GitHub Open API would have been parsable.

OpenAPI Spec File
https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/api.github.com/api.github.com.json?_sm_au_=iHVj504RWD4Fn7kPLVN2jKsTtN4QF

You can lookup for "ADD"

Desktop (please complete the following information):

  • OS: WSL2 Ubuntu 20.04
  • Python Version: 3.8.10
  • openapi-python-client version 0.11.1

Additional context
Line forcing KEY in uppercase.

It might be the proper behavior, I am just wondering, why GitHub Spec is not parsable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐞bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions