I have some rather inflexible consumers of an API I wrote that require nested collections to be of length two with specified key names. Not a difficult task, however I wonder if something already exists so I can look over the implementation and possibly
produce something the first time that is future proof and maybe more correct?
One possibility I thought of was allowing for query parameters where I could specify what key contained what value: http://server/path/id?desiredPropNameA=existingPropNameA&desiredPropNameB=existingPropNameB
This would return what the consumer wants:
{ {"desiredNameA": "existingPropNameA-Value", "desiredNameB": "existingPropNameB-Value"} }