AnswerDotAI / AnswerDotAI/ghapi

Small fix needed to enable GHES

Open
#120 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
685
Forks
70
Avg merge
1m
Merged PRs (30d)
2

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

- [**enterprise-admin**.suspend_user](https://docs.github.com/enterprise-server@3.3/rest/reference/enterprise-admin#suspend-a-user)(username, reason): *Suspend a user*

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.