amazonka
amazonka copied to clipboard
Order of arguments of request smart constructors can change during regeneration
For example, the Name
and SourceRegion
arguments were swapped in copyImage between 1.5.0 and 1.4.5.
I could trace that specific change to the following change in botocore.
It is unfortunate that in case of argument reordering the Haskell bindings are less safe than the corresponding python ones. I am not quite sure what we can do about it though. In the copyImage case, using the Region type would have helped...
One approach might be for the code generator to generate newtype
wrappers for every Text
argument.
One approach might be for the code generator to generate newtype wrappers for every Text argument.
I'd love that approach. Over time the newtime wrappers could even get some smart constructors validating argument specific properties, such as not empty etc.
A big part of the problem is that we're using HashMap
all over the place. #872 will largely fix this, once we start being able to track declaration order in the generator. But that's a while off.