concerto icon indicating copy to clipboard operation
concerto copied to clipboard

Support max length for array and map

Open dselman opened this issue 1 year ago • 1 comments

Feature Request 🛍️

Extend the metamodel to support validation facets for the length of an array and the number of keys in a map.

Use Case

Allows the model to define the maximum number of elements in array or map.

Possible Solution

  1. Update metamodel
  2. Update CTO grammar and parser
  3. Update AST printer
  4. Update validation

Context

Detailed Description

dselman avatar Oct 12 '23 15:10 dselman

For the max number of keys in a map, here's an example of the syntax I'm thinking of-

map m {
  o String
  o Integer
  -> maxKeys = 3
}

Do let me know if the syntax should be different.

apoorvsxna avatar Apr 18 '24 21:04 apoorvsxna