-
Notifications
You must be signed in to change notification settings - Fork 20
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
Validator: expanded JSON-LD type checks #27
Conversation
I agree with @acdha that we need an extra color (closer to green than red) to signify SHOULDs that are not implemented. Showing them as "errors" isn't quite right. |
Agree that there should be a warning color. But I don't think the logic of the provided tests is correct either. If the Accept header says that the client wants application/json+ld, we shouldn't be giving the server credit for returning the application/json media type and the context link header. The context link header should be a separate test for when the response is application/json, thus without an Accept header. At which point, the current jsonld test is okay. |
“If the Accept header says that the client wants application/json+ld, we shouldn't be giving the server credit for returning the application/json media type and the context link header” If that's the case, I think the spec should make it clear that this is not permissible:
|
👍 Will open an issue on the image API to clarify. At the moment it does read like the context header flows on from the previous discussion. |
As per the discussion on IIIF#27, this test now requires a server to answer a request with `Accept: application/ld+json` with a response which has `Content-Type: application/ld+json`.
@azaroth42 I've updated this pull request to remove the option to respond with One concern I have, which might reasonably be considered out of scope, is that it's not uncommon for large sites to behind CDNs or other proxies which scrub the Accept header. That's a perfect use-case for having the validator support a warning level but I wonder whether it might also be grounds to have the spec suggest that clients tolerate this. |
http://iiif.io/api/image/2.1/index.html#information-request: * When JSON-LD was not requested, the response MUST be `application/json` * When JSON-LD is requested, the response must either be `application/ld+json` or `application/json` with a Link header specifying the standard context
As per the discussion on IIIF#27, this test now requires a server to answer a request with `Accept: application/ld+json` with a response which has `Content-Type: application/ld+json`.
5fdbf04
to
8e67430
Compare
The validator is currently stricter than http://iiif.io/api/image/2.1/index.html#information-request and requires all responses to be
application/ld+json
.This branch splits the existing
jsonld
check into separate checks for both specified behaviours:Accept: application/ld+json
the response MUST beapplication/json
application/ld+json
or have both theapplication/json
Content-Type and a Link header specifying the standard contextThe second check is still slightly unsatisfactory because we don't appear to have a way to specify warnings as opposed to outright errors. The specification recommends that JSON responses have the Link header but it's not a hard requirement and it might be useful to acknowledge that this is tolerable but should be fixed if possible.