feat(09-06): keep relation required flags off unbound columns

- Schema JSON still reports required relations for the client
- Save validation only adds required for scalar writable fields
This commit is contained in:
Jakub Zych
2026-09-24 20:19:29 +02:00
parent c63146accb
commit 0caa86ec0b

View File

@@ -644,7 +644,9 @@ func mergedRules(cc *CompiledController, model any) map[string]string {
return out return out
} }
for _, field := range cc.Form.Fields { for _, field := range cc.Form.Fields {
if field.Required { // Relation fields are not writable columns. required stays on the
// schema for the client, but it cannot be checked by Fill.
if field.Required && scalarFormField(field.Type) {
out[field.Name] = mergeRequired(out[field.Name]) out[field.Name] = mergeRequired(out[field.Name])
} }
} }