-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
Feature: Support GitHub REST API versioning #9
Comments
The versioning of rest-api can be hard to support until the github/rest-api-description support it. Changing the rest api version will cause model definitions and client methods to change. |
At least provide a way to specify the X-GitHub-Api-Version header via a config that will be used for the rest requests or hard-code it to the version that githubkit currently supports. https://docs.github.com/en/rest/overview/api-versions?apiVersion=2022-11-28 |
githubkit currently does not specify a rest api version and github will use the default version. But githubkit now generates the model using the latest schema instead of |
If you would fix the api version that is used to generate the model and then access with the github rest api, your released versions of your library are resilient to any change that is made on github side. Now, the latest version 0.9.8 is generated using the current schema 2022-11-28. When github bumps the version to a new one, githubkit will try to access the latest api with a model that matches 2022-11-28. which will eventually fail. If you match the model with the actual api version and add the corresponding X-GitHub-Api-Version header for each request, any released version of the library will continue to work (unless GitHub decides to drop the version completely ofc). |
Due to #11, the core logic of codegen may change. For now, i would like to add the version tag to codegen and output the version header in client request. |
See also https://docs.github.com/en/rest/overview/api-versions
@yanyongyu it can be a thing that GitHub versions its API endpoints :)
The text was updated successfully, but these errors were encountered: