schemars
schemars copied to clipboard
Map schemas do not specify the key type
In the current implementation at https://github.com/GREsau/schemars/blob/386e3d7f5ac601795fb4e247291bbef31512ded3/schemars/src/json_schema_impls/maps.rs only the V type is used, but K type is ignored.
For example, HashMap<u32, String> gets a schema {'type': 'object', 'additionalProperties': {'type': 'string'}}, and u32 type is not reflected in it.
Downstream issue discussion is at https://github.com/deltachat/deltachat-core-rust/pull/4602#issuecomment-1664907971