-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
private/mode/api: Codegen error code const values are incorrectly trimmed. #1856
Comments
Thanks for creating the issue for this bug @radeksimko. It looks like the SDK's model parser and code generation is stripping off the We should investigate if the SDK can change its code generation logic to correctly render the string value of the error code with the WAF prefix without a breaking change to the const variable name. There is a decent chance this error is impacting other service code gen cases as well. |
Fixes the SDK's code generation to not modify the error code text value when generating error code constants. This prevents generating error code values which are invalid and will never be sent by the service. e.g. ErrCodeInternalErrorException = "InternalErrorException" Should have the value of: ErrCodeInternalErrorException = "WAFInternalErrorException" Fix aws#1856
…y. (#1958) Fixes the SDK's code generation to not modify the error code text value when generating error code constants. This prevents generating error code values which are invalid and will never be sent by the service. e.g. ErrCodeInternalErrorException = "InternalErrorException" Should have the value of: ErrCodeInternalErrorException = "WAFInternalErrorException" Fix #1856
Version of AWS SDK for Go?
Latest (9ec5619)
Version of Go (
go version
)?go version go1.10 darwin/amd64
What issue did you see?
As documented in https://docs.aws.amazon.com/waf/latest/APIReference/API_GetRuleGroup.html https://docs.aws.amazon.com/waf/latest/APIReference/API_UpdateRule.html and elsewhere there is number of error codes generated incorrectly from JSON blueprints:
aws-sdk-go/models/apis/waf/2015-08-24/api-2.json
Lines 3272 to 3371 in 9ec5619
aws-sdk-go/service/waf/errors.go
Lines 5 to 188 in 9ec5619
All error codes seem to be missing
WAF
prefix.Users are currently forced to import
wafregional
package which generates those error codes correctly or hard-code strings instead.The text was updated successfully, but these errors were encountered: