From 0caa86ec0b6d255dd22a55ee5923a40d3a821977 Mon Sep 17 00:00:00 2001 From: Jakub Zych Date: Thu, 24 Sep 2026 20:19:29 +0200 Subject: [PATCH] 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 --- cabana/crud.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cabana/crud.go b/cabana/crud.go index 09b3d03..c5a2fa0 100644 --- a/cabana/crud.go +++ b/cabana/crud.go @@ -644,7 +644,9 @@ func mergedRules(cc *CompiledController, model any) map[string]string { return out } 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]) } }