We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently in a Concerto model, it is not possible to define a field as being a set - a collection of unique values.
Allow a model author to define a field as being a set, and at validation time enforce uniqueness on the values in stored in that set.
Imagine a model that backs a multiple choice question in a survey, such as "Which of these fruits do you like?".
The fruits could be modelled as an enumeration:
enum Fruit { o APPLE o PEAR o BANANA o MANGO }
Today, all you can do is model the list of fruits you like as a list:
concept Survey { o Fruit[] fruits }
But there is nothing in the model to say that you only want to allow unique fruit values in the list, so you could have:
{ "$class": "Survey", "fruits": [ "APPLE", "APPLE", "APPLE", "APPLE" ] }
A few syntax options spring to mind:
Set
concept Survey { o Set<Fruit> fruits }
concept Survey { o Fruit[] fruits unique }
I would suggest that whatever we do, we restrict the type of values in a set to primitive types and enumerations.
The text was updated successfully, but these errors were encountered:
I like it, this feature would pair nicely with #447
Sorry, something went wrong.
There is a language design for this feature at https://github.com/accordproject/concerto/wiki/Aggregate-Types-Design-(Working-Draft)
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 10 days.
No branches or pull requests
Currently in a Concerto model, it is not possible to define a field as being a set - a collection of unique values.
Feature Request ๐๏ธ
Allow a model author to define a field as being a set, and at validation time enforce uniqueness on the values in stored in that set.
Use Case
Imagine a model that backs a multiple choice question in a survey, such as "Which of these fruits do you like?".
The fruits could be modelled as an enumeration:
Today, all you can do is model the list of fruits you like as a list:
But there is nothing in the model to say that you only want to allow unique fruit values in the list, so you could have:
Possible Solution
A few syntax options spring to mind:
Set
type:I would suggest that whatever we do, we restrict the type of values in a set to primitive types and enumerations.
Context
Detailed Description
The text was updated successfully, but these errors were encountered: