Describe the bug
When wanting to specify an attribute of type map, a full map-schema via the properties setting is required, effectively locking down what kind of maps can be stored for that attribute. There are use-cases however, where an attribute is desired to be a map, yet the contents of that map may vary. Similar to OpenAPI specs, we could envision to allow setting additionalProperties: true, in which case the value would be validated as a valid object but not enforce a schema within the object.
Currently this needs to be worked around like this with custom validation:
data: {
type: 'any',
required: false,
validate: (value) => !value || isNonEmptyObject(value),
},
ElectroDB Version
3.0.1
Describe the bug
When wanting to specify an attribute of type
map, a full map-schema via thepropertiessetting is required, effectively locking down what kind of maps can be stored for that attribute. There are use-cases however, where an attribute is desired to be a map, yet the contents of that map may vary. Similar to OpenAPI specs, we could envision to allow settingadditionalProperties: true, in which case the value would be validated as a valid object but not enforce a schema within the object.Currently this needs to be worked around like this with custom validation:
ElectroDB Version
3.0.1