Skip to content

Drupal REST syntax has changed, claw-jsonld could be altered #571

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
whikloj opened this issue Mar 24, 2017 · 2 comments
Closed

Drupal REST syntax has changed, claw-jsonld could be altered #571

whikloj opened this issue Mar 24, 2017 · 2 comments

Comments

@whikloj
Copy link
Member

whikloj commented Mar 24, 2017

In working on #527 I have done a lot of PATCHing and it appears that this syntax (https://www.drupal.org/docs/8/core/modules/rest/4-patch-for-updating-content-entities) is not correct and this syntax (https://www.drupal.org/docs/8/core/modules/rest/javascript-and-drupal-8-restful-web-services) is.

I was looking at the nodes stuff, because it was the stuff that worked for FedoraResources out of the box.

Now working to denormalize Json-LD the denormalize function is looking for '_links' at the root level.
https://github.com/Islandora-CLAW/claw-jsonld/blob/8.x-1.x/src/Normalizer/ContentEntityNormalizer.php#L162

ie.

{
  @graph : {....},
  "_links" : { "type" : { "href" : "http://localhost:8000/rest/type/fedora_resource/rdf_source"}}
}

This could be changed to

{
  @graph : {...},
  "type":[{"target_id":"rdf_source"}]
}

I think they did this because you POST to an endpoint with the entity in it and otherwise you PATCH to the actual entity URL.

@whikloj
Copy link
Member Author

whikloj commented Mar 24, 2017

Actually we are going to use a header to pass this information, so the function will need to be altered, but not yet.

@whikloj
Copy link
Member Author

whikloj commented Mar 24, 2017

I'll do this as part of #527

@whikloj whikloj closed this as completed Mar 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant