Skip to content
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

should JSON-LD @context from payload get ignored? #14

Closed
elf-pavlik opened this issue Sep 14, 2017 · 2 comments
Closed

should JSON-LD @context from payload get ignored? #14

elf-pavlik opened this issue Sep 14, 2017 · 2 comments

Comments

@elf-pavlik
Copy link
Member

elf-pavlik commented Sep 14, 2017

When JsonLdHypermediaProcessor flattens the payload it should probably always use context provided to the client by the developer using the client and never the one from the payload returned from the server.

Developer using a client has to have full control over JSON-LD context used to flatten paylad to use aliases from that context in the code. Context in the payload (response from the server) should stay considered as not under control of the developer using client and the code should not make any assumptions about that context and only rely on context directly provided to the client by the developer.

Possibly related to what @alien-mcl mentioned in #11 (comment)

Ahh. It was some time ago, but I think this was to force either framing or flattening to enforce those urls. For some reason these were incorrectly processed.

@alien-mcl
Copy link
Member

It is not ignored - in default behavior JsonLdHypermediaProcessor uses original response as it's result. It still uses it's own context to frame that response (effectively copying it) so it can obtain hypermedia, which are then added as an extension of the original payload (hypermedia property).
The original resource is untouched leaving full power to the developer.

@elf-pavlik
Copy link
Member Author

It still uses it's own context to frame that response (effectively copying it) so it can obtain hypermedia, which are then added as an extension of the original payload (hypermedia property).

Makes sense, since client uses its build in context to frame content for hypermedia property value, for that part context from the payload gets ignored.

The original resource is untouched leaving full power to the developer.

👍 let's discuss in other issues and PR if client should provide some interfaces to work with the payload beyond attaching hyperedia interface to it. Then this issue of not assuming in the code anything about JSON-LD context from the payload will come up again.

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

2 participants