diff options
Diffstat (limited to 'lib/configuration/read_conf.ml')
| -rw-r--r-- | lib/configuration/read_conf.ml | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/configuration/read_conf.ml b/lib/configuration/read_conf.ml index 14ee0b7..67703da 100644 --- a/lib/configuration/read_conf.ml +++ b/lib/configuration/read_conf.ml @@ -92,7 +92,16 @@ module Make (S : Decoders.Decode.S) = struct S.succeed Model.Field.{ rule; message } let field (env : env) : Model.field S.decoder = - let* name = S.field "name" identifier + let* name = + S.field "name" + (S.and_then + (fun name -> + if Model.Identifier.equal name Model.Identifier.id then + S.fail + "the name \"id\" is reserved: it is the primary key of every \ + row" + else S.succeed name) + identifier) and* label = S.field "label" textI18n and* type' = S.field "type" (field_type env) and* required = S.field_opt_or ~default:false "required" S.bool |
