Skip to content

Commit ff8a108

Browse files
authored
Return OpTypeList for singular plurals (#269)
Issue #, if available: N/A, [heuristic](https://github.com/aws-controllers-k8s/code-generator/blob/89b0a106fea6268609fd666270518145099646f7/pkg/model/op.go#L110-L118) is returning `ReadOne` operation for `DescribeDhcpOptions` when it is a `ReadMany` call Description of changes: * returns `OpTypeList` instead of `OpTypeGet` for "singular plural" in `"Describe"` processing * removes duplicate code * updates comments on singular-plural description to be clearer and present in all affected areas By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 89b0a10 commit ff8a108

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Diff for: pkg/model/op.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ func GetOpTypeAndResourceNameFromOpID(
111111
resName := strings.TrimPrefix(opID, "Describe")
112112
if pluralize.IsPlural(resName) {
113113
if resourceExistsInConfig(resName, cfg) {
114-
return OpTypeGet, resName
114+
return OpTypeList, resName
115115
}
116116
return OpTypeList, pluralize.Singular(resName)
117117
}

Diff for: pkg/model/op_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ func TestGetOpTypeAndResourceNameFromOpID_PluralSingular(t *testing.T) {
144144
},
145145
{
146146
"DescribeDhcpOptions",
147-
model.OpTypeGet,
147+
model.OpTypeList,
148148
"DhcpOptions",
149149
},
150150
{

0 commit comments

Comments
 (0)