Skip to content

Media Types and HTTP #1118

@OR13

Description

@OR13

I am not sure where this goes, but this would help solve a lot of interoperability issues we have observed regarding http apis for verifiable credentials.

Currently, due to how open ended "Verifiable Presentation" are, I can see us potentially not needing a separate content type for them...

Case 0

const res = await axios.get('https://platform.example/credentials', {
  headers: {
    'Accept': 'application/vp+ld+json' // ask for a presentation
  }
});
{
  "@context": [
    "https://www.w3.org/ns/credentials/v2"
  ],
  "type": "VerifiablePresentation",
  "verifiableCredential": [  ... credentials of ANY media type ]
}

Case 1

const res = await axios.get('https://platform.example/credentials/urn:uuid:123', {
  headers: {
    'Accept': 'application/vc+ld+json' // ask for a single credential
  }
});
{
  "@context": [
    "https://www.w3.org/ns/credentials/v2"
  ],
  "id": "urn:uuid:123", or "https://platform.example/credentials/urn:uuid:123"
  "type": "VerifiableCredential",
  ...
}

Case 2

const res = await axios.get('https://platform.example/credentials', {
  headers: {
    'Accept': 'application/vc+ld+json' // ask for many credentials?
  }
});
{
  "@context": [
    "https://www.w3.org/ns/credentials/v2"
  ],
  "type": "VerifiablePresentation",
  "verifiableCredential": [  ... credentials of only media type `vc+ld+json` ? ] 
}

Several of the related cases seem like they might be invalid, it would be nice to developers to point out the valid and invalid cases...

See the following informative sections of the spec:

And the following normative sections of the spec:

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions