diff --git a/types/mapper/access.go b/types/mapper/access.go index 2ecbd55b..e1140048 100644 --- a/types/mapper/access.go +++ b/types/mapper/access.go @@ -7,7 +7,8 @@ import ( ) type Access struct { - Fields map[string]string + Fields map[string]string + Optional bool } func (e Access) FromInternal(data map[string]interface{}) { @@ -20,6 +21,9 @@ func (e Access) ToInternal(data map[string]interface{}) error { func (e Access) ModifySchema(schema *types.Schema, schemas *types.Schemas) error { for name, access := range e.Fields { if err := ValidateField(name, schema); err != nil { + if e.Optional { + continue + } return err }