-
Notifications
You must be signed in to change notification settings - Fork 247
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
Go: object type not recognized #2880
Comments
So this works without the pointer type, but I believe this is a bug. This compiles and runs. cf.NewCfnFunction(stack, jsii.String("myCDKFunction"), &cf.CfnFunctionProps{
Name: jsii.String("myCfnFunctionCdk"),
FunctionCode: jsii.String("myFunctionCode"),
AutoPublish: jsii.Bool(true),
FunctionConfig: cf.CfnFunction_FunctionConfigProperty{
Comment: jsii.String("testcdk"),
Runtime: jsii.String("cloudfront-js-1.0"),
},
}) The generated type of type CfnFunctionProps struct {
Name *string `json:"name"`
AutoPublish interface{} `json:"autoPublish"`
FunctionCode *string `json:"functionCode"`
FunctionConfig interface{} `json:"functionConfig"`
FunctionMetadata interface{} `json:"functionMetadata"`
} I believe the |
According to the documentation, the That being said, the serialiser should probably be able to work it out whether a pointer is used or not in this particular case (since the value is a struct). It might fall in an crack in the current logic. |
When a struct pointer was passed in an `interface{}` position, the converter would trip and register a new opaque instance of `Object` instead of correctly serializing a struct. This is because hte pointer is double-indirected (the `interface{}` is a reference to the `&struct`, which is a reference to the `struct`). This change adds a condition to detect such cases (`interface{}` abstracts another pointer), and properly serialize that. Fixes #2880
When a struct pointer was passed in an `interface{}` position, the converter would trip and register a new opaque instance of `Object` instead of correctly serializing a struct. This is because hte pointer is double-indirected (the `interface{}` is a reference to the `&struct`, which is a reference to the `struct`). This change adds a condition to detect such cases (`interface{}` abstracts another pointer), and properly serialize that. Fixes #2880 --- By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license]. [Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0
|
🐛 Bug Report
Affected Languages
Go
General Information
What is the problem?
See aws/aws-cdk#15007.
Attempting to create a
CfnFunction_FunctionConfigProperty
results in a malformed object that doesn't pass required field checks.The following should work, but complains that the comment and runtime properties aren't set:
Verbose Log
JSII_DEBUG output
To me, the interesting bit appears to be that -- unlike the other objects -- the FunctionConfig is created without any fqn info or args.
Compared to the Function itself:
The text was updated successfully, but these errors were encountered: