You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.
Hey Ryan, Thanks for reporting this - you're 100% correct. I've had a look into possible solutions for this, but i'm struggling to find something that works well for all use cases.
Because of the large number of SAM/CFN templates that specify as a number, we need to support parsing from both number:
Then any SAM/CFN templates that specify the value as a JSON/YAML number (such as the first example above), will fail to parse: json: cannot unmarshal number into Go struct field Function_S3Location.Version of type string
The only solution I can think of would be to create an intermediate type with a custom JSON unmarshaller that can accept both number and string formats. Something like this StackOverflow solution.
This has a pretty big downside though - it means that when composing templates in Go code, you can no longer just do:
Instead for any place in the goformation API where a number is used (which can be specified as a string or number in JSON/YAML due to CFN's relaxed typing), we would need to do something like this:
... which would be a major change to the API of the library - although not necessarily a bad one, as it would allow us to move to using pointers instead of values, and therefore solve a number of open issues in this library to do with null values.
Unless you can think of a smarter way of handling this?
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
This code is wrong:
goformation/cloudformation/serverless/aws-serverless-function_s3location.go
Line 24 in d56929b
This is the official doc. It should be
string
, notint
.https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-property-function-functioncode.html#sam-function-functioncode-version
The text was updated successfully, but these errors were encountered: