cnabio / cnab-go

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

fix(bundle/definition): add custom validator for contentEncoding #118

Closed vdice closed 5 years ago

vdice commented 5 years ago

This represents a fix to ensure definitions with a non-empty contentEncoding property pass validation by adding a custom validator for continued use of the jsonschema library cnab-go currently uses. It's specific to contentEncoding but illustrates a potential path forward for further "custom" validators (either for properties in the default JSON Schema but not stock in the jsonschema library or for truly custom properties/validators down the line.)

See https://github.com/deislabs/cnab-go/issues/117 for background on general issue and https://github.com/deislabs/porter/pull/579 for feature that uses the changes here to pass validation.