awslabs / awslabs/aws-sdk-rust
Documentation specifies defaults but they are not actually used
- 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:

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

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