Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with new aws-ec2 generated bindings #94

Open
akama opened this issue Jan 29, 2021 · 3 comments
Open

Error with new aws-ec2 generated bindings #94

akama opened this issue Jan 29, 2021 · 3 comments
Labels

Comments

@akama
Copy link
Contributor

akama commented Jan 29, 2021

I was upgrading one of my projects that uses this project and attempted to update it to use the new ec2 bindings that were generated in 4c69f5e that were generated with the files from but there appears to be an issue with them.

It looks like a difference in the the generated Types.*. to_query function. In the older version , the initial character of the keys were lowercase but the new version 4c69f5e has it as uppercase. This causes keys to not be recognized as valid by AWS and the request to be rejected. I quickly checked the schema for 2015-04-15 vs 2016-11-15 and it doesn't look like a difference in there.

I think the next steps are to look at the code that was changed in the code generation in between these two generations but I haven't had time to do so and I wanted to document this error so other people could be aware. The old bindings still work well so I've just pinned those for the moment. When I get sometime in the next couple weeks, I'll attempt to spend more time on this.

@tmcgilchrist
Copy link
Collaborator

Thanks for reporting this issue @UnrealAkama very much appreciated.

Could you post a minimal sample of code that demonstrates this issue?
There's a basic test https://github.com/inhabitedtype/ocaml-aws/blob/master/libraries/ec2/lib_test/aws_ec2_test.ml that I ran after regenerating bindings. Clearly that doesn't cover the error you are seeing.

@akama
Copy link
Contributor Author

akama commented Feb 2, 2021

Oh that's good news actually, I though this might be everything but maybe it's limited to specific calls. The first call that I ran into that didn't work is Types.BlockDeviceMapping. The easiest way to confirm is to add the section below to the run instance request in https://github.com/inhabitedtype/ocaml-aws/blob/master/libraries/ec2/lib_test/aws_ec2_test.ml#L98.

                  ~block_device_mappings:[
                    Types.BlockDeviceMapping.make
                    ~device_name:"/dev/sdf"
                    ~ebs:(Types.EbsBlockDevice.make
                    ~volume_size:10
                    ~delete_on_termination:true ())
                  ()

You should get an error like HttpError(400 - AwsError): [UnknownParameter: The parameter deviceName is not recognized]

I did run into another couple errors once I manually patched that type to confirm the error but I didn't take as good of notes 😦 as to those types. I'll see if I can recreate the test setup and get those types as well in the next little bit.

@tmcgilchrist
Copy link
Collaborator

I've seen issues with other services (that aren't officially added yet) where the deserialisation fails because the key name doesn't exactly match. The json service definitions can be quite case ignorant when using names for fields and structures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants