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

Fix lexv1 AlternativeIntentsSerializationError #4264

Closed
wants to merge 4 commits into from

Conversation

chrbsg
Copy link

@chrbsg chrbsg commented Jan 28, 2022

Deserialisation of the X-Amz-Lex-Alternative-Intents header fails because it
is a JSON array, but aws.JSONValue is a map[string]interface{}. Fix this by
treating X-Amz-Lex-Alternative-Intents as a base64 encoded string, which will
not be decoded and unmarshalled by the SDK. The caller of the SDK must manually
base64 decode and JSON unmarshal the field, in order to use the contents.

bug #4258

Deserialisation of the `X-Amz-Lex-Alternative-Intents` header fails because it
is a JSON array, but `aws.JSONValue` is a `map[string]interface{}`. Fix this by
treating `X-Amz-Lex-Alternative-Intents` as a base64 encoded string, which will
not be decoded and unmarshalled by the SDK. The caller of the SDK must manually
base64 decode and JSON unmarshal the field, in order to use the contents.
@chrbsg
Copy link
Author

chrbsg commented Jan 28, 2022

For changes to files under the /model/ folder, and manual edits to autogenerated code (e.g. /service/s3/api.go) please create an Issue instead of a PR for those type of changes.

I'm guessing this applies here...

@jasdel
Copy link
Contributor

jasdel commented Feb 3, 2022

Thanks for taking the time to create this PR @chrbsg. Since this PR modifies the SDK's API model/generated code we cannot take this Pr directly. But with that said, i created #4269. This new PR takes the idea of supressing the JSONValue traits for these API parameters. Taking a step further the PR also disables future support for JSONValue in the v1 SDK to prevent further issues.

@jasdel jasdel closed this Feb 3, 2022
aws-sdk-go-automation pushed a commit that referenced this pull request Feb 16, 2022
===

### Service Client Updates
* `service/budgets`: Updates service API and documentation
  * Adds support for auto-adjusting budgets, a new budget method alongside fixed and planned. Auto-adjusting budgets introduces new metadata to configure a budget limit baseline using a historical lookback average or current period forecast.
* `service/ce`: Updates service API
* `service/ec2`: Updates service API and documentation
  * Documentation updates for EC2.
* `service/glue`: Updates service API and documentation
  * Support for optimistic locking in UpdateTable
* `service/ssm`: Updates service documentation
  * Assorted ticket fixes and updates for AWS Systems Manager.

### SDK Features
* `codegen`: Updates the SDK's code generation to stop supporting new API modeled JSONValue parameters. The SDK's JSONValue type is only compatible with JSON documents with a top level JSON Object. JSON Lists, Strings, Scalars, are not compatible. This prevents JSON Value working with some APIs such as Amazon Lex Runtime Service's operations.
  * Related to [#4264](#4264) and [#4258](#4258)

### SDK Bugs
* `service/lexruntimeservice`: Introduces a breaking change for following parameters from a JSONValue to string type, because the SDKs JSONValue is not compatible with JSON documents of lists.
  * PostContentInput.ActiveContexts
  * PutContentOutput.AlternativeIntents
  * PutContentOutput.ActiveContexts
  * PutSessionOutput.ActiveContexts
  * Fixes [#4258](#4258)
aws-sdk-go-automation added a commit that referenced this pull request Feb 16, 2022
Release v1.43.0 (2022-02-16)
===

### Service Client Updates
* `service/budgets`: Updates service API and documentation
  * Adds support for auto-adjusting budgets, a new budget method alongside fixed and planned. Auto-adjusting budgets introduces new metadata to configure a budget limit baseline using a historical lookback average or current period forecast.
* `service/ce`: Updates service API
* `service/ec2`: Updates service API and documentation
  * Documentation updates for EC2.
* `service/glue`: Updates service API and documentation
  * Support for optimistic locking in UpdateTable
* `service/ssm`: Updates service documentation
  * Assorted ticket fixes and updates for AWS Systems Manager.

### SDK Features
* `codegen`: Updates the SDK's code generation to stop supporting new API modeled JSONValue parameters. The SDK's JSONValue type is only compatible with JSON documents with a top level JSON Object. JSON Lists, Strings, Scalars, are not compatible. This prevents JSON Value working with some APIs such as Amazon Lex Runtime Service's operations. 
  * Related to [#4264](#4264) and [#4258](#4258)

### SDK Bugs
* `service/lexruntimeservice`: Introduces a breaking change for following parameters from a JSONValue to string type, because the SDKs JSONValue is not compatible with JSON documents of lists.
  * PostContentInput.ActiveContexts
  * PutContentOutput.AlternativeIntents
  * PutContentOutput.ActiveContexts
  * PutSessionOutput.ActiveContexts
  * Fixes [#4258](#4258)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants