jsonld.js icon indicating copy to clipboard operation
jsonld.js copied to clipboard

Framing objects from the input document returns empty object

Open haardikk21 opened this issue 4 years ago • 0 comments

With the following signed verifiable credential

{
  "@context": [
    "https://www.w3.org/2018/credentials/v1",
    "https://www.w3.org/2018/credentials/examples/v1",
    "https://w3c-ccg.github.io/lds-bbsbls2020/contexts"
  ],
  "id": "http://example.gov/credentials/3732",
  "type": [
    "VerifiableCredential",
    "UniversityDegreeCredential"
  ],
  "issuanceDate": "2020-03-10T04:24:12.164Z",
  "expirationDate": "2020-03-10T04:24:12.164Z",
  "issuer": "did:example:489398593",
  "credentialSubject": {
    "id": "did:example:489398593",
    "degree": {
      "type": "BachelorDegree",
      "name": "Bachelor of Science and Arts"
    }
  },
  "proof": {
    "type": "BbsBlsSignature2020",
    "created": "2020-07-14T15:03:52Z",
    "verificationMethod": "did:example:489398593#test",
    "proofPurpose": "assertionMethod",
    "signature": "rrlFDwLIbrhNJpuWIheCnuxTqXjrHlwu8NnDvuKe0tE8P59Hv3pO/4us/1X1ZadBCDEhBNCG88y1b0JZYuwGpEuCALtXlwnb51XM0sf8Pfo7xdrmEHygWCZz9KCHfUEWmeoZHf2MdsOHoMYrl6ZMKw=="
  }
}

and using the following JSON-LD frame

{
  "@context": [
    "https://www.w3.org/2018/credentials/v1",
    "https://www.w3.org/2018/credentials/examples/v1",
    "https://w3c-ccg.github.io/lds-bbsbls2020/contexts",
  ],
  id: "http://example.gov/credentials/3732",
  "@explicit": true,
  type: ["VerifiableCredential", "UniversityDegreeCredential"],
  credentialSubject: {
    degree: {}
  },
}

trying to derive the result returns degree: {}

The exact example works fine in the JSON-LD playground here

but the library doesn't return the object

REPL to recreate error - https://repl.it/@HardikKumar/BBS-Signatures-Object-Derivation#index.js

haardikk21 avatar Jul 14 '20 15:07 haardikk21