You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
disclaimer: I am neither an openapi nor an openapi-generator expert, and I'm interacting with github enterprise instance at my company, not 100% sure if the issue I'm facing really is a spec inaccuracy, but I thought this would be a good first step to ask before deciding to file the issue somewhere else)
use it like this (change auth/call args as applicable):
import github_openapi_client as github_client
import github_openapi_client.apis.tags.pulls_api as pulls_api
configuration = github_client.Configuration(
host="XYZ",
# possibly other auth options
)
api_client = github_client.ApiClient(configuration)
test_client = pulls_api.PullsApi(api_client)
pull = test_client.pulls_get({
"owner": "org_name",
"repo": "repo_name",
"pull_number": 111111111
})
assert pull is not None
run the code.
expected: the code executes fine.
actual: parsing the response from server fails with:
E github_openapi_client.exceptions.ApiValueError: Invalid content_type returned. Content_type='application/json; charset=utf-8' was returned when only {'application/json'} are defined for status_code=200
(if I modify the schema json to change all instances of application json to one containing charsets, eg, via: sed -i '' 's/"application\/json"/"application\/json; charset=utf-8"/g' openapi_clients/ghes-3.6_with_charsets.json) the error goes away
I do recieve a different one, that's a separate issue though :)
The text was updated successfully, but these errors were encountered:
Schema Inaccuracy
disclaimer: I am neither an openapi nor an openapi-generator expert, and I'm interacting with github enterprise instance at my company, not 100% sure if the issue I'm facing really is a spec inaccuracy, but I thought this would be a good first step to ask before deciding to file the issue somewhere else)
An openapi-generator client generated from from https://github.com/github/rest-api-description/tree/main/descriptions/ghes-3.6 cannot accept any response from the server due to content type mismatch.
Expected
Schema declares all responses to be sent with "application/json" content type, e.g:
but (on the instance I'm testing) they're sent with:
application/json; charset=utf-8
which is not accepted by the client I'm using (more details in reproduction steps)
Reproduction Steps
use it like this (change auth/call args as applicable):
run the code.
expected: the code executes fine.
actual: parsing the response from server fails with:
(if I modify the schema json to change all instances of application json to one containing charsets, eg, via:
sed -i '' 's/"application\/json"/"application\/json; charset=utf-8"/g' openapi_clients/ghes-3.6_with_charsets.json
) the error goes awayI do recieve a different one, that's a separate issue though :)
The text was updated successfully, but these errors were encountered: