mirror of
https://github.com/rancher/norman.git
synced 2025-10-20 08:11:27 +00:00
when embedding optional element if schema isn't found ignore
This commit is contained in:
@@ -62,6 +62,9 @@ func (e *Embed) ModifySchema(schema *types.Schema, schemas *types.Schemas) error
|
||||
embeddedSchemaID := schema.ResourceFields[e.Field].Type
|
||||
embeddedSchema := schemas.Schema(&schema.Version, embeddedSchemaID)
|
||||
if embeddedSchema == nil {
|
||||
if e.Optional {
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("failed to find schema %s for embedding", embeddedSchemaID)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user