Mismatched CodePipeline CloudWatch fields
- 主要语言
- Go
- 星标
- 3.8k
- 派生
- 578
- 平均合并
- 8 小时 18 分钟
- 30 天内合并 PR
- 1
描述
Hi all, thanks for your support on this library. I was recently trying to replace our homemade structs for CodePipeline events with the ones defined in this package but I'm running into the following errors unmarshalling the `version` fields in `CodePipelineEventDetail` and `CodePipelineEventDetail`:
```Go
json: cannot unmarshal number 2.0 into Go struct field CodePipelineEventDetail.detail.version of type int64: errorString null
json: cannot unmarshal string into Go struct field CodePipelineEventDetailType.detail.type.version of type int64: errorString null
```
The unmarshalling works when `CodePipelineEventDetail.detail.version` is a `float64` and `CodePipelineEventDetailType.detail.type.version` is a string (using our own structs). Would y'all mind taking another look at the types for the two `versions` fields?
Based on the comments for each of them, it sounds like there's some mismatch in the schema/documentation:
https://github.com/aws/aws-lambda-go/blob/96ab249f3eb7644ebc3bb7a190d268184fdd9f4e/events/codepipeline_cloudwatch.go#L82-L83
https://github.com/aws/aws-lambda-go/blob/96ab249f3eb7644ebc3bb7a190d268184fdd9f4e/events/codepipeline_cloudwatch.go#L105-L106
Thanks!
贡献指南
调研方向
从 events/codepipeline_cloudwatch.go 中引用行的 CodePipelineEventDetail 和 CodePipelineEventDetailType 的 version 字段开始。将这些声明与报告的 JSON unmarshalling 错误和注释进行比较,然后确认具有代表性的数值和字符串 version 值可以使用修正后的类型成功解码。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- go
- 领域
- backend
- Issue 类型
- 缺陷
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100