Small fix needed to enable GHES

Open Beginner friendly
#120 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
openapi, python
Domain
api

Research direction

Inspect 90_build_lib.ipynb and the build_lib.py generation path that produces metadata.py and the documentation. Reproduce the GHES 3.3 entry for enterprise-admin.suspend_user, then verify that the generated Python method and docs use an underscore instead of a hyphen and that the API call is usable.

Written by the indexing model from the issue text.

Description

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

Dominant language
Python
Stars
687
Forks
69
Avg merge
1m
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from AnswerDotAI/ghapi

All issues in AnswerDotAI/ghapi

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.