Closed
Description
Implement a new property type - enum (enumeration).
Example model definition:
{
"name": "Person",
"properties": {
"sex": {
"type": "enum",
"values": ["male", "female", "other"]
}
}
}
Example remoting argument definition:
{
accepts: {
arg: 'sex', type: 'enum', values: ['male', 'female', 'other'],
http: { source: 'query' }
}
}
Implementation details:
- support both "string" and "number" as a backing datatype
- strong-remoting should validate and coerce enumeration types
- loopback-datasource-juggler should validate property values of enum type
- connectors should map enum type to appropriate database counterpart
- SQL connectors - see https://github.com/strongloop-internal/scrum-loopback/issues/603
- MongoDB - see https://github.com/strongloop-internal/scrum-loopback/issues/604
- loopback-swagger should emit correct json-schema descriptor for enum properties
- autodiscovery