cnabio / cnab-go

A Go implementation of CNAB Core 1.0
MIT License
69 stars 37 forks source link

ref(*): add schema validation #188

Closed vdice closed 4 years ago

vdice commented 4 years ago

Closes https://github.com/cnabio/cnab-go/issues/194

radu-matei commented 4 years ago

I don't have a strong preference here - but would it make sense to have a top-level schema package?

Clearly this would be a breaking change for tools using the current utils package, so we should keep this in mind.

vdice commented 4 years ago

What do y'all think of the current approach? Added a Makefile target to fetch needed schemas of a given version. The library then embeds these (via packr) for validation at runtime. I originally intended to .gitignore the schemas fetched from remote but then assumed they actually needed to be committed to source for downstream/consumers of this library... is that accurate?

vdice commented 4 years ago

@silvin-lubecki @radu-matei this is ready for re-review. PTAL when convenient. Thanks!

vdice commented 4 years ago

@jlegrone @radu-matei @silvin-lubecki PTAL when convenient. Will be good to get this merged to iterate on, especially for forthcoming changes per the Claim spec.

vdice commented 4 years ago

(Oops, most recent commit (https://github.com/cnabio/cnab-go/pull/188/commits/4cafa5fe968ec49510d9a0b1d8c50d8d7000081d) was leftover implementation per @jlegrone 's suggestions.)