Skip to content

Commit

Permalink
Merge pull request #22 from kaleido-io/metaschema-improvements
Browse files Browse the repository at this point in the history
Allow numbers and booleans to be expressed as strings
  • Loading branch information
peterbroadhurst authored Jun 24, 2022
2 parents 7f6b2ea + 8438aaa commit afee4a3
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 afee4a3

Please sign in to comment.