Open-Attestation / open-attestation

Meta framework for providing digital provenance and integrity to documents.
https://openattestation.com
Apache License 2.0
54 stars 18 forks source link

Can't sign opencerts demo document #68

Closed Nebulis closed 4 years ago

Nebulis commented 4 years ago
❯ npx ts-node --project ./tsconfig.json src/index.ts batch ./examples/some-certs ./examples/wrapped-certs
npx: installed 8 in 1.714s
✖  error     Document /home/nebulis/IdeaProjects/open-attestation-cli/examples/some-certs/document.json is not valid against open-attestation schema
✖  error     The required property "issuers[0].tokenRegistry" is missing
✖  error     The required property "issuers[0].identityProof" is missing
✖  error     The required property "issuers[0].documentStore" is missing
✖  error     The required property "issuers[0].identityProof" is missing
✖  error     An unexpected additional property with key "url" was found in object issuers[0]
✖  error     An unexpected additional property with key "certificateStore" was found in object issuers[0]
✖  error     An unexpected additional property with key "url" was found in object issuers[0]
✖  error     An unexpected additional property with key "certificateStore" was found in object issuers[0]
✖  error     An unexpected additional property with key "url" was found in object issuers[0]
✖  error     There is 1 unprocessed error
ℹ  info      You can enable logging by adding DEBUG=open-attestation-cli:* to your command
ℹ  info      More info on debug: https://www.npmjs.com/package/debug
Nebulis commented 4 years ago

It's because tokenRegistry, documentStore and certificateStore doesn't allow additional properties but they should

=> https://github.com/Open-Attestation/open-attestation/blob/master/src/schema/2.0/schema.json#L21

Nebulis commented 4 years ago

Can add the following

      "not": {
        "anyOf": [
          {
            "required": ["documentStore"]
          },
          {
            "required": ["certificateStore"]
          }
        ]
      },
      "additionalProperties": true

But it makes errors very hard to read

john-dot-oa commented 4 years ago

:tada: This issue has been resolved in version 3.1.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: