Skip to content

Commit

Permalink
Allow numbers and booleans to be expressed as strings
Browse files Browse the repository at this point in the history
Signed-off-by: Nicko Guyer <nicko.guyer@kaleido.io>
  • Loading branch information
nguyer committed Jun 24, 2022
1 parent 7f6b2ea commit 8438aaa
Showing 1 changed file with 41 additions and 3 deletions.
44 changes: 41 additions & 3 deletions pkg/fftypes/ffi_param_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,30 @@ func (v *BaseFFIParamValidator) GetMetaSchema() *jsonschema.Schema {
}
}
},
"numberTypeOptions": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"number",
"string"
]
}
}
},
"booleanTypeOptions": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"boolean",
"string"
]
}
}
},
"ffiParam": {
"oneOf": [
{
Expand All @@ -68,9 +92,23 @@ func (v *BaseFFIParamValidator) GetMetaSchema() *jsonschema.Schema {
"properties": {
"oneOf": {
"type": "array",
"items": {
"$ref": "#/$defs/integerTypeOptions"
}
"oneOf": [
{
"items": {
"$ref": "#/$defs/integerTypeOptions"
}
},
{
"items": {
"$ref": "#/$defs/numberTypeOptions"
}
},
{
"items": {
"$ref": "#/$defs/booleanTypeOptions"
}
}
]
}
},
"required": [
Expand Down

0 comments on commit 8438aaa

Please sign in to comment.