Indicio-tech / pydid

Python library for validating, constructing, and representing DIDs and DID Documents
Apache License 2.0
11 stars 12 forks source link

Fallback "non-conformant doc" objects #40

Closed dbluhm closed 3 years ago

dbluhm commented 3 years ago

Throwing a validation error is not always the most desirable behavior when deseriailzing DID documents. This PR adds a non-conformant doc object as a fallback when all other validation fails. It attempts to make the resulting document as usable as possible without making assertions about what is or is not present in the document.

Use pydid.deserialize_document(value) to get this fallback behavior. Use pydid.deserialize_document(value, strict=True) to keep strict validation behavior.