-
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
Loosen Operation Existence during Model Loading #4804
Loosen Operation Existence during Model Loading #4804
Conversation
@@ -173,6 +173,7 @@ func (a *API) APISmokeTestsGoCode() string { | |||
var smokeTestTmpl = template.Must(template.New(`smokeTestTmpl`).Parse(` | |||
{{- range $i, $testCase := $.TestCases }} | |||
{{- $op := index $.API.Operations $testCase.OpName }} | |||
{{- if $op }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not familiar with go templates, but this path should only get triggered if $op
is truthy (in this case, not nil
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would appear correct according to https://pkg.go.dev/text/template#hdr-Actions
@@ -173,6 +173,7 @@ func (a *API) APISmokeTestsGoCode() string { | |||
var smokeTestTmpl = template.Must(template.New(`smokeTestTmpl`).Parse(` | |||
{{- range $i, $testCase := $.TestCases }} | |||
{{- $op := index $.API.Operations $testCase.OpName }} | |||
{{- if $op }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would appear correct according to https://pkg.go.dev/text/template#hdr-Actions
906c507
to
ff97bd3
Compare
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.N/A.
If there is an existing bug or feature this PR is answers please reference it here.
N/A.
aws-sdk-go
doesn't support document types, so they are removed from the API JSON models upstream (and anything that references it, i.e. structures and even operations).Paginators do not have the same upstream removal process, so there could be "orphaned" operations. This change loosens restrictions when loading paginators, waiters, and smoke tests when an operation cannot be found in the API JSON model.
Loosen operation existence during model loading so generation won't fail when operations don't exist in the model: