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

Fix: copilot seat details schema fixed #68

Merged
merged 3 commits into from
Dec 19, 2023

Conversation

jecluis
Copy link
Contributor

@jecluis jecluis commented Dec 18, 2023

While parsing OpenAPI spec for 2022-11-28:

  codegen/parser/utils.py", line 105, in merge_dict
    del old[key]
        ~~~^^^^^
  KeyError: 'enum'

Signed-off-by: Joao Eduardo Luis <joao@1e3ms.io>

P.S.: This was hit while running python -m codegen on the current master branch (620e08f), which was surprising. I'm not ruling out this might be a problem with my environment, but I suspect this might be a corner case somewhere with the schema.

While parsing OpenAPI spec for 2022-11-28:

  codegen/parser/utils.py", line 105, in merge_dict
    del old[key]
        ~~~^^^^^
  KeyError: 'enum'

Signed-off-by: Joao Eduardo Luis <joao@1e3ms.io>
@yanyongyu
Copy link
Owner

This is caused by schema update made by GitHub. This should be fixed in the schema override part in the pyproject.toml file.

@jecluis
Copy link
Contributor Author

jecluis commented Dec 18, 2023

This is caused by schema update made by GitHub. This should be fixed in the schema override part in the pyproject.toml file.

I suspected that could be the case as well. Any idea which schema bit is triggering this? Happy to open a PR to address it.

Also, feel free to close this one if not the right path to address the problem :)

@yanyongyu
Copy link
Owner

It seems this is caused by

githubkit/pyproject.toml

Lines 226 to 231 in 620e08f

# copilot-seat-details/assignee is not valid
"/components/schemas/copilot-seat-details/properties/assignee" = { enum = "<unset>", oneOf = [
{ "$ref" = "#/components/schemas/simple-user" },
{ "$ref" = "#/components/schemas/team" },
{ "$ref" = "#/components/schemas/organization" },
] }

@yanyongyu yanyongyu added bug Something isn't working schema schema related Rest API labels Dec 19, 2023
@yanyongyu yanyongyu changed the title 🐛 fix: key does not exist on del in merge_dict Fix: copilot seat details schema fixed Dec 19, 2023
Copy link
Owner

@yanyongyu yanyongyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems codegen is successful now 👍🏻 (My gh codespace OOM again and again)

@yanyongyu yanyongyu merged commit 348fa20 into yanyongyu:master Dec 19, 2023
2 checks passed
@jecluis
Copy link
Contributor Author

jecluis commented Dec 19, 2023

@yanyongyu thank you for all your work on this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Rest API schema schema related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants