- πΊπΈUnited States m.stenta
We have automated tests now ( π Add basic test coverage Active ) so it would be good to include a test to demonstrate this issue and prevent regressions.
After updated modules about Json:API, explorer not working anymore.
After some search, I fixed the first visible error with the patch in this issue : TypeError: Argument 1 passed to JsonApiSchemaController π TypeError: Argument 1 passed to Drupal\jsonapi_schema\Controller\JsonApiSchemaController::Drupal\jsonapi_schema\Controller\{closure}() must be an instance of Drupal\jsonapi\ResourceType\ResourceType RTBC
But after applied the patch, explorer still not working. I see in the production website (not already push the update module) the explorer call one time the /jsonapi/schema url. And after update I see more than 300 calls for schemas.
The main difference is in "targetSchema" attribute :
before
"type": "object",
"links": [
{
"href": "{instanceHref}",
"rel": "related",
"title": "Platform entities",
"targetMediaType": "application/vnd.api+json",
"targetSchema": "https://xxxx/jsonapi/platform/platform/collection/schema",
"templatePointers": {
"instanceHref": "/links/platform--platform/href"
},
"templateRequired": [
"instanceHref"
]
},
...
And after update
"type": "object",
"links": [
{
"href": "{instanceHref}",
"rel": "related",
"title": "Platform entities",
"targetMediaType": "application/vnd.api+json",
"targetSchema": {
"$ref": "https://xxxx/jsonapi/platform/platform/collection/schema"
},
"templatePointers": {
"instanceHref": "/links/platform--platform/href"
},
"templateRequired": [
"instanceHref"
]
},
...
I propose you an patch quick-fix to prevent this issue.
But, with more background whole feature/project the patch isn't the correct solution.
Needs work
Code
The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
We have automated tests now ( π Add basic test coverage Active ) so it would be good to include a test to demonstrate this issue and prevent regressions.