dekts
March 13, 2020, 1:58pm
#1
I’m getting the error while I’m going to verify it from web browser (https://www.blockcerts.org/ )
I have added the additional fields in the manner of below example:
additional_per_recipient_fields = {"fields": [{"path": "$.evidence","value": "*|EVIDENCE|*","csv_column": "evidence"}]}
In above json I have added multiple fields and yes if the title is more then one word then I used it as:
additional_per_recipient_fields = {"fields": [{"path": "$.evidence_title","value": "*|EVIDENCE_TITLE|*","csv_column": "evidence_title"}]}
Now can you please help me why I’m getting the error called:
Hi @dekts ,
JSONLD normalization is a process where the document is parsed against a context definition.
It’s being thrown here: https://github.com/blockchain-certificates/cert-verifier-js/blob/master/src/inspectors/computeLocalHash.js#L88
Basically what this is telling you is that you are using fields that are not defined by the @context
key of your certificate.
You could try and define the keys that you are adding in your document in the same fashion as what Learning Machine does:
"@context": [
"https://w3id.org/openbadges/v2",
"https://w3id.org/blockcerts/v2",
{
"metadataJson": {
"@id": "https://schemas.learningmachine.com/2017/blockcerts/metadata",
"@type": "https://schemas.learningmachine.com/2017/types/text/json"
},
"displayHtml": {
"@id": "https://schemas.learningmachine.com/2017/blockcerts/displayHtml",
"@type": "https://schemas.learningmachine.com/2017/types/text/html"
},
"nonce": {
"@id": "https://schemas.learningmachine.com/2017/blockcerts/nonce",
"@type": "https://schema.org/Text"
},
"universalIdentifier": {
"@id": "https://schemas.learningmachine.com/2017/blockcerts/identifier",
"@type": "https://schema.org/Text"
}
}
]
I believe this should fix the issue for you
dekts
March 19, 2020, 4:52am
#3
Yes correct @lemoustachiste
I have defined the parameters in the additional_global_fields
Here is the example how I have added the parameteres which is added in the additional_per_recipient_fields
"fields": [
{
"path": "$.@context",
"value": [
"https://w3id.org/openbadges/v2",
"https://w3id.org/blockcerts/v2",
{
"displayHtml": {
"@id": "schema:description"
},
"xyz_name": {
"@id": "schema:description"
},
"abc_logo": {
"@id": "schema:description"
}
}
]
}
]
}
Many thanks @lemoustachiste
Cheers!