gentics / mesh-incubator

Project which is home for planned enhancements for Gentics Mesh
3 stars 0 forks source link

Add extra constraints for field values #112

Open Jotschi opened 7 years ago

Jotschi commented 7 years ago

It should be possible to add custom constraints for field values.

Add a constraints property to field schemas which contains the constraint parameters.

Types

Number field constraint

{
  "name" : "size",
  "label" : "Size",
  "constraints": {
     "min": 10,
     "max": 100,
     "match": [ 20, 30, 40 ]
  },
  "type" : "number"
}

String field constraint

{
  "name" : "title",
  "label" : "Title",
  "constraints": {
     "min": 10,
     "max": 255,
     "match": [ "Title A", "Title B", "Title C" ],
  },
  "type" : "number"
}

TODOs

Questions