mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-08-12 01:43:40 +00:00
Merge pull request #166 from jwetzell/fix/params-schema-required
don't make params schema required if all properties are optional
This commit is contained in:
@@ -43,7 +43,9 @@ func GetModulesSchema() *jsonschema.Schema {
|
||||
}
|
||||
if mod.ParamsSchema != nil {
|
||||
moduleSchema.Properties["params"] = mod.ParamsSchema
|
||||
moduleSchema.Required = append(moduleSchema.Required, "params")
|
||||
if len(mod.ParamsSchema.Required) > 0 {
|
||||
moduleSchema.Required = append(moduleSchema.Required, "params")
|
||||
}
|
||||
}
|
||||
moduleDefinitionSchemas = append(moduleDefinitionSchemas, moduleSchema)
|
||||
}
|
||||
|
||||
@@ -39,7 +39,9 @@ func GetProcessorsSchema() *jsonschema.Schema {
|
||||
}
|
||||
if proc.ParamsSchema != nil {
|
||||
processorSchema.Properties["params"] = proc.ParamsSchema
|
||||
processorSchema.Required = append(processorSchema.Required, "params")
|
||||
if len(proc.ParamsSchema.Required) > 0 {
|
||||
processorSchema.Required = append(processorSchema.Required, "params")
|
||||
}
|
||||
}
|
||||
processorDefinitionSchemas = append(processorDefinitionSchemas, processorSchema)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user