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
Unfortunately, they decided to implement it using the content type application/vnd.api+json.
Currently, the resolver code in this project is only ever treating application/json as a first-class citizen; after changing the spec to have a content type of application/vnd.api+json, the number of entries that appear in the query section reduce signficantly. Please start treating application/vnd.api+json and application/json as synonyms.
query{
courseLocationListResponse (courseCode:"2N22",providerCode:"B20", year:"2020"){
jsonapi{
version
}
}
}
The response we get is the following:
{
"errors": [
{
"message": "Operation GET /recruitment_cycles/{year}/providers/{provider_code}/courses/{course_code}/locations should have a content-type 'application/json' but has 'application/vnd.api+json' instead",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"courseLocationListResponse"
]
}
],
"data": {
"courseLocationListResponse": null
}
}
Expected behavior
I'd expect the app to understand that application/json and application/vnd.api+json are compatible, and return the correct results.
Screenshots
N/A.
Additional context
Changing the spec.json file to use ''application/vnd.api+json" instead of "application/json" causes erratic behaviour, as the API does not understand this mime type.
Describe the bug
We're trying to expose a UK gov API with the following spec:
https://api.publish-teacher-training-courses.service.gov.uk/api-docs/public_v1/api_spec.json
Unfortunately, they decided to implement it using the content type application/vnd.api+json.
Currently, the resolver code in this project is only ever treating application/json as a first-class citizen; after changing the spec to have a content type of application/vnd.api+json, the number of entries that appear in the query section reduce signficantly. Please start treating application/vnd.api+json and application/json as synonyms.
To Reproduce
Steps to reproduce the behavior:
The response we get is the following:
Expected behavior
I'd expect the app to understand that application/json and application/vnd.api+json are compatible, and return the correct results.
Screenshots
N/A.
Additional context
Changing the spec.json file to use ''application/vnd.api+json" instead of "application/json" causes erratic behaviour, as the API does not understand this mime type.
The issue is likely to be resolved by loosening the if statement here to also treat ''application/vnd.api+json" in the same way:
https://github.com/IBM/openapi-to-graphql/blob/master/packages/openapi-to-graphql/src/resolver_builder.ts#L809
The text was updated successfully, but these errors were encountered: