mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-09-10 15:39:25 +00:00
don't make params schema required if all properties are optional
This commit is contained in:
@@ -43,8 +43,10 @@ func GetModulesSchema() *jsonschema.Schema {
|
|||||||
}
|
}
|
||||||
if mod.ParamsSchema != nil {
|
if mod.ParamsSchema != nil {
|
||||||
moduleSchema.Properties["params"] = mod.ParamsSchema
|
moduleSchema.Properties["params"] = mod.ParamsSchema
|
||||||
|
if len(mod.ParamsSchema.Required) > 0 {
|
||||||
moduleSchema.Required = append(moduleSchema.Required, "params")
|
moduleSchema.Required = append(moduleSchema.Required, "params")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
moduleDefinitionSchemas = append(moduleDefinitionSchemas, moduleSchema)
|
moduleDefinitionSchemas = append(moduleDefinitionSchemas, moduleSchema)
|
||||||
}
|
}
|
||||||
schema.Items = &jsonschema.Schema{
|
schema.Items = &jsonschema.Schema{
|
||||||
|
|||||||
@@ -39,8 +39,10 @@ func GetProcessorsSchema() *jsonschema.Schema {
|
|||||||
}
|
}
|
||||||
if proc.ParamsSchema != nil {
|
if proc.ParamsSchema != nil {
|
||||||
processorSchema.Properties["params"] = proc.ParamsSchema
|
processorSchema.Properties["params"] = proc.ParamsSchema
|
||||||
|
if len(proc.ParamsSchema.Required) > 0 {
|
||||||
processorSchema.Required = append(processorSchema.Required, "params")
|
processorSchema.Required = append(processorSchema.Required, "params")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
processorDefinitionSchemas = append(processorDefinitionSchemas, processorSchema)
|
processorDefinitionSchemas = append(processorDefinitionSchemas, processorSchema)
|
||||||
}
|
}
|
||||||
schema.Items = &jsonschema.Schema{
|
schema.Items = &jsonschema.Schema{
|
||||||
|
|||||||
Reference in New Issue
Block a user