amazonka icon indicating copy to clipboard operation
amazonka copied to clipboard

Order of arguments of request smart constructors can change during regeneration

Open dudebout opened this issue 7 years ago • 3 comments

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...

dudebout avatar Jan 03 '18 17:01 dudebout

One approach might be for the code generator to generate newtype wrappers for every Text argument.

rcook avatar Feb 28 '18 15:02 rcook

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.

mbj avatar Jul 03 '18 21:07 mbj

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.

endgame avatar Apr 17 '24 07:04 endgame