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
{{ message }}
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.
{"code":6011,"message":"parse vc : compact JSON-LD document: loading remote context failed: Dereferencing a URL did not result in a valid JSON-LD context: https://www.w3.org/2018/credentials/examples/v1"}
We have updated the way how JSON-LD contexts are handled by the framework - now contexts are not fetched from the remote sources by default. This is mainly because of performance considerations and for having more control over what external calls are made by the framework.
There is a core set of contexts that the framework embeds, and https://www.w3.org/2018/credentials/examples/v1 is not there.
Depending on how you are using the framework, there are several ways how you can add support for additional contexts.
If you have access to the framework instance, you can initialize it with the custom loader - either the one with needed contexts or the one that enables remote fetching:
Check this example on how to create a custom loader with extra contexts and initialize the framework with it
For enabling remote fetching (contexts, that are not in a core set, will be resolved from the network), you can use the following code when creating a custom loader:
What I'm trying to do
Sign verifiable credential.
Expected result
Signed verifiable credential.
Actual result
{"code":6011,"message":"parse vc : compact JSON-LD document: loading remote context failed: Dereferencing a URL did not result in a valid JSON-LD context: https://www.w3.org/2018/credentials/examples/v1"}
Sample code / test case
curl -k -X POST "https://localhost:8082/verifiable/signcredential" -H "accept:application/json" -H "Content-Type:application/json" -d "{\"created\":\"2021-05-05T10:22:25.999Z\",\"credential\":{\"@context\":[\"https://www.w3.org/2018/credentials/v1\",\"https://www.w3.org/2018/credentials/examples/v1\"],\"credentialSubject\":{\"id\":\"sample-credential-subject-id\"},\"id\":\"http://example.edu/credentials/1872\",\"issuanceDate\":\"2010-01-01T19:23:24Z\",\"issuer\":{\"id\":\"did:example:09s12ec712ebc6f1c671ebfeb1f\",\"name\":\"ExampleUniversity\"},\"referenceNumber\":83294847,\"type\":[\"VerifiableCredential\",\"UniversityDegreeCredential\"]},\"did\":\"did:key:z6Mkf3mSeHmehoXVdXQt1uNimKxD9RqFXHS6EgbVaDx4B5Z5\",\"signatureType\":\"Ed25519Signature2018\"}"
Note: this was working in previous versions (working on commit 2a52bb7).
The text was updated successfully, but these errors were encountered: