Skip to content

Commit dcb9fd6

Browse files
authored
Adding functionality to assign whole object to a field (#451)
Issue #, if available: This PR is created to support the code-generation for `FunctionEventInvokeConfig` feature in lambda-controller. [PR#92](aws-controllers-k8s/lambda-controller#92) Description of changes: This PR adds functionality to assign whole object to a field, instead of assigning a particular parameter of it. To clarify it further, in the below code, we created a new field `LayerStatuses` which stores the value of `Configuration.Layers` parameter taken from `GetFunction` operation. ``` LayerStatuses: from: operation: GetFunction path: Configuration.Layers ``` In our case we needed to add `FunctionEventInvokeConfig` as an inline property to `Function` resource, for which we needed to assign the whole object returned by `PutFunctionEventInvokeConfig` operation to field `FunctionEventInvokeConfig`. To make this work we added a new condition for it by passing `path` value as `.` , shown below: ``` FunctionEventInvokeConfig: from: operation: PutFunctionEventInvokeConfig path: . ``` By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 6542e04 commit dcb9fd6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/model/sdk_api.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,9 @@ func (a *SDKAPI) GetInputShapeRef(
220220
if !ok {
221221
return nil, false
222222
}
223+
if path == "." {
224+
return &op.InputRef, true
225+
}
223226
return getMemberByPath(op.InputRef.Shape, path)
224227
}
225228

0 commit comments

Comments
 (0)