Fleece icon indicating copy to clipboard operation
Fleece copied to clipboard

Add overload for KeyValuePair

Open gusty opened this issue 5 years ago • 1 comments

I think right now the only possibility to parse/encode pairs is through Dictionaries and Objects. A KeyValuePair would allow to have full control over property/value in cases where we want something else, ie: a MultiMap, a Map where the key is not a string (though we can work it out in another issue) or simply a tuple that it's not encoded as a linear array of 2 elements.

gusty avatar Nov 03 '20 08:11 gusty

It would make sense to allow some types as keys, as long as they have a natural string representation. For example, numbers.

I'm the case when you don't have a natural string representation you could add a reference instance using the scheme found in for instance the Swagger spec: https://swagger.io/specification/ Search for "$ref". The question then is what kind of reference schemes there are (and how it would make sense to support them)?

wallymathieu avatar Nov 03 '20 14:11 wallymathieu