awslabs / awslabs/aws-sdk-rust

Documentation specifies defaults but they are not actually used

Open
#1,114 1 comment 1 reaction 0 assignees View on GitHub
bug documentation p2
Dominant language
Rust
Stars
3.3k
Forks
290
Avg merge
1d 12h
Merged PRs (30d)
3

Description

### Describe the bug

Documentation explicitly specifies that the following fields have defaults:
![image](https://github.com/awslabs/aws-sdk-rust/assets/9094255/e6437f99-113f-4518-9c30-2ad6a76a44c4)

But they are actually not applied. If the builder doesn't explicitly specify them, they will instead be explicitly be set to `None`
![image](https://github.com/awslabs/aws-sdk-rust/assets/9094255/8858a112-ec12-4ac0-aad5-9d69057836ac)

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:
```rust
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

```text
1.18.0
```

Contributor guide

Open the contributing guide

Research direction

Start with the linked InvokeModelFluentBuilder and InvokeModelInput documentation and reproduce the request without explicitly setting accept or content_type. Trace where those fields become None and compare that behavior with the documented defaults. Done means the defaults are applied when the builder fields are omitted and the request no longer fails with the reported validation error.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.