Open-Attestation / open-attestation

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

Wrapping a document as OA V3.0 seems to give a V2.0 document #222

Closed morgatron closed 2 years ago

morgatron commented 2 years ago

According to the main readme:

wrappedDocuments = wrapDocuments([document, { ...document, id: "different id" }], { version: "open-attestation/3.0" }); // will ensure document is valid regarding open-attestation 3.0 schema

However this appears to return a V2 document. I was expecting a V3 document- but perhaps I am missing something? Using version 6.4.1

Also, the link to the V3.0 scheme (https://raw.githubusercontent.com/Open-Attestation/open-attestation/master/src/schema/3.0/schema.json) is broken

cavacado commented 2 years ago

Hi thanks for opening this issue. Please do take note that although wrapping v3 documents is working, the api underneath may break or change without warning, if you plan to go into production, it will be at your own risk.

the exposed function call is this function instead __unsafe__use__it__at__your__own__risks__wrapDocuments look at this line of code for reference: https://github.com/Open-Attestation/open-attestation/blob/master/src/index.ts#L31

On the other point, we will update our documentation at our end but the new link to v3.0 schema is this: https://schema.openattestation.com/3.0/schema.json

morgatron commented 2 years ago

Thanks very much for the rapid clarification.

Would it make sense to also update the wrapDocuments example in README.md, either updating the example to use the __unsafe... function, or taking out the V3.0 part?

cavacado commented 2 years ago

yup that make sense, would you be so kind to open a PR to rectify the documentation mistakes? Ow, we will eventually update it, but not our highest priority now.