Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use JSON Schemas to validate type property existence requirements #131

Open
KendallWeihe opened this issue Apr 3, 2024 · 1 comment
Open

Comments

@KendallWeihe
Copy link
Contributor

Created as a result of the work of #109

We have standardized DID and VC type requirements as defined here and here. And part of that standardization is a requirement for the existence of some type properties. For example, a VC issuanceDate is always required to exist, but a VC expirationDate is not required to exist.

Let's use the JSON Schemas to enforce this requirement.


Design proposal

Two possible approaches, and we could choose to do both

  1. We could add functions specific to validating, which the consuming app is expected to call -- this would be useful given they already have the type instantiated and didn't use the json marshalling functionality
  2. We could write custom json unmarshalling/marshalling functions (ex how we're doing this in jwt/jwt.go here) -- this would be useful if they were unmarshalling/marshalling the data
@KendallWeihe
Copy link
Contributor Author

Some good inspiration on how this could be implemented from over in tbdex-go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant