-
Notifications
You must be signed in to change notification settings - Fork 39
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
feat(schema.go): add support for params of object type in ConvertValue #251
Conversation
Signed-off-by: Vaughn Dice <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have existing tests around the validate call for object properties with json schema definitions? Like the replica count property in the original example, if the input was a string instead of an integer, or it violated the maximum, would bundle.validate fail with a good error?
Also have we confirmed what this parameter ends up looking like when it's finally injected into the bundle at runtime? There is a related porter issue about consuming object parameters. I think it would help if we checked how well object parameters are supported from definition through consumption in the bundle to sus out any further changes needed.
This library indeed has existing unit tests in this area: https://github.com/cnabio/cnab-go/blob/main/bundle/definition/validation_test.go These are a bit more abstract in that they build inline JSON Schemas and test them against provided values (using the
I haven't dug in deeply, but I have tested these changes with a sample Porter bundle like https://github.com/vdice/porter-bundles/blob/master/params/porter.yaml, which will catch instances when a parameter value is invalid per the inline definition schema, etc. The Not sure I've adequately answered any/all of the above. Let me know! |
That is exactly the info I was looking for, thanks! I really just wanted to make sure that we had tests in place ✅ and have seen this work in Porter ✅ . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
object
in ConvertValue(Original issue from Porter: getporter/porter#1459)