fastai / ghapi

A delightful and complete interface to GitHub's amazing API
https://ghapi.fast.ai/
Apache License 2.0
527 stars 57 forks source link

Small fix needed to enable GHES #120

Open pberthonneau opened 2 years ago

pberthonneau commented 2 years ago

Hi

I have been generating the lib and doc with the Open API description for GHES 3.3. All is fine except a small thing impacting pure GHES enterprise capabilities:

build_lib.py generates the metadata.py with for example

 ('/users/{username}/suspended', 'put', 'enterprise-admin/suspend-user', 'Suspend a user', 'enterprise-server@3.3/rest/reference/enterprise-admin#suspend-a-user', [], [['reason', str]], ''),

which is converted in doc as

The problem is with the minus in enterprise-admin. In Python a method cannot have a minus in its name. When I replace with enterprise_admin everything is fine and I can call the API.

Then I think a specific replacement of - by _ should be added to https://github.com/fastai/ghapi/blob/master/90_build_lib.ipynb