Skip to content
This repository was archived by the owner on Jul 10, 2025. It is now read-only.
This repository was archived by the owner on Jul 10, 2025. It is now read-only.

Add support for runtime fetching of context fiels #386

@PascalSprenger

Description

@PascalSprenger

Hello, I am absolutely unsure if this is a bug or if I am using it incorrectly.

I would like to create verifiable credentials via didkit-cli.
If I use an official context as a source, everything works.
Here is my working examples from the tutorial:

			String vcData = String.format(‘’
										            {
					    ‘@context’: 
					    ‘https://www.w3.org/2018/credentials/v1’
					    ‘id’: ‘urn:uuid:12345678-abcd-1234-ef00-123456789abc’,
					    ‘type’: [‘VerifiableCredential’],
					    ‘issuer’: ‘%s’,
					    ‘issuanceDate’: ‘%s’,
					    ‘credentialSubject’: {
					    	‘id’: ‘did:example:abcdef’
					    }
					}‘’", issuerDID, DateTimeFormatter.ISO_INSTANT.format(Instant.now()),claimsJson.toString());

However, if I now try to host the identical context (copy/paste) from https://www.w3.org/2018/credentials/v1 myself via Xampp local, I always get the following error:

Error: thread ‘main’ panicked at C:\Users\xxx\.cargo\registry\src\index.crates.io-6f17d22bba15001f\didkit-cli-0.3.2\src\credential.rs:80:14:
Error: called `Result::unwrap()` on an `Err` value: LDP(ToRdfError(Expand(ContextProcessing(Meta(ContextLoadingFailed(LoadingDocumentFailed(UnknownContext(‘http://localhost/vc2.jsonld’)))), Span { start: 42, end: 71 })))))

Do you have any idea what this could be? I have now tried several different schemas and always get this error.

If I pass a custom context directly via:

					    {
					    ‘dateOfBirth’: ‘http://localhost/definitions/birthDate.html’ 
					    }

so without hosting it, it seems to work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions