-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
enhancementImprovements to existing features or smaller new featuresImprovements to existing features or smaller new featuresquestionFurther information is requestedFurther information is requested
Milestone
Description
Currently, the DictValidator only allows strings as dictionary keys.
Originally the reason for this was purely "we mostly want to use this with JSON and JSON doesn't support non-string keys anyway", but there are cases where non-string keys (e.g. integers) can be useful.
There are some open questions about this, though.
- It could(?) still make sense to have optional data type validation for keys, or even more specific/custom validation by specifying an arbitrary
Validatoraskey_validator. - If we allow key validators, it could be an option to have "light-weight" validation that only checks the type (so instead of specifying a Validator, just specify the type and the DictValidator will only do a
isinstancecheck. - Do we allow field validators for arbitrary key types too? (I don't see why not, but it could have some unexpected effects on testing, for example.)
- What should the default be? Allow any type, or keep the current behaviour (strings only) as the default?
Metadata
Metadata
Assignees
Labels
enhancementImprovements to existing features or smaller new featuresImprovements to existing features or smaller new featuresquestionFurther information is requestedFurther information is requested