You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Certainly, the CustomAttributeType would be a great choice for more complex validations / types, but seems counter-intuitive / over-engineered for the simple case where we want to accept just any map?
I suppose this was mainly to demonstrate that any type could be used, even something simple like Record<string, string> or { [key: string]: unknown }, which sounds like what you're trying to accomplish. Does this fall short of what you might be expecting?
Describe the bug
When wanting to specify an attribute of type
map
, a full map-schema via theproperties
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 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
The text was updated successfully, but these errors were encountered: