aws-sdk-rust icon indicating copy to clipboard operation
aws-sdk-rust copied to clipboard

Documentation specifies defaults but they are not actually used

Open Ten0 opened this issue 1 year ago • 1 comments
trafficstars

Describe the bug

Documentation explicitly specifies that the following fields have defaults: image

But they are actually not applied. If the builder doesn't explicitly specify them, they will instead be explicitly be set to None image

This makes the request fail with error:

ValidationException: The provided Content Type is invalid or not supported for this model

Setting those explicitly on InvokeModelFluentBuilder avoids the error:

builder
    .accept("application/json")
    .content_type("application/json")

Links

https://docs.rs/aws-sdk-bedrockruntime/1.18.0/aws_sdk_bedrockruntime/operation/invoke_model/builders/struct.InvokeModelFluentBuilder.html https://docs.rs/aws-sdk-bedrockruntime/1.18.0/aws_sdk_bedrockruntime/operation/invoke_model/struct.InvokeModelInput.html

Version

1.18.0

Ten0 avatar Mar 25 '24 22:03 Ten0

Hi @Ten0, thank you for reporting this! This is a bug in a Smithy model for bedrockruntime (from which aws_sdk_bedrockruntime is code generated), where the doc (which also comes from the model) mentions defaults but they are not actually used as fallback; the requests fail if nothing is specified for accept and content_type.

@jmklix Could you help bring this up with bedrockruntime so that the team is aware?

ysaito1001 avatar Mar 26 '24 22:03 ysaito1001