-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix ref unmarshal into BoolOrArrayOfString
If a $ref has an object that declares `required` properties, helm-schema will return the error ``` json: cannot unmarshal array into Go struct field Schema.properties.required of type schema.BoolOrArrayOfString ``` Example: ``` { "bar": { "type": "object", "description": "from ref", "properties": { "baz": { "type": "string", "description": "from ref" } }, "required": [ "baz" ] } } ``` Another option is setting `required` to `false`. Both cases cause the above error. The fix is to implement UnmarshalJSON on BoolOrArrayOfString.
- Loading branch information
Showing
4 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,9 @@ | |
# @schema | ||
# Not from ref | ||
foo: bar | ||
# @schema | ||
# $ref: ref_input.json#/bar | ||
# @schema | ||
# Not from ref | ||
bar: | ||
baz: qux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters