Skip to content

Commit

Permalink
fix: generation of AppFlow properties without type
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenfonseca committed Dec 1, 2022
1 parent 658bf78 commit bfcd40f
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions generate/property.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,38 @@ func (p *Property) UnmarshalJSON(data []byte) error {
fmt.Printf("Warning: auto-fixing property that is marked as tag but has no tag ItemType for %s\n", p.Documentation)
}

if p.Type == "CustomProperties" && p.ItemType == "" {
p.PrimitiveType = "Json"
p.Type = ""
// WORKAROUND: On 2022-11-01, AWS::AppFlow::Flow published a property called 'CustomProperties' with no definition of the type.
// This workaround assumes that it should be a map, but we have no idea what it should really be.
fmt.Printf("Warning: auto-fixing property that has no definition for %s\n", p.Documentation)
}

if p.Type == "CredentialsMap" && p.ItemType == "" {
p.PrimitiveType = "Json"
p.Type = ""
// WORKAROUND: On 2022-11-01, AWS::AppFlow::ConnectorProfile published a property called 'CredentialsMap' with no definition of the type.
// This workaround assumes that it should be a map, but we have no idea what it should really be.
fmt.Printf("Warning: auto-fixing property that has no definition for %s\n", p.Documentation)
}

if p.Type == "TokenUrlCustomProperties" && p.ItemType == "" {
p.PrimitiveType = "Json"
p.Type = ""
// WORKAROUND: On 2022-11-01, AWS::AppFlow::ConnectorProfile published a property called 'TokenUrlCustomProperties' with no definition of the type.
// This workaround assumes that it should be a map, but we have no idea what it should really be.
fmt.Printf("Warning: auto-fixing property that has no definition for %s\n", p.Documentation)
}

if p.Type == "ProfileProperties" && p.ItemType == "" {
p.PrimitiveType = "Json"
p.Type = ""
// WORKAROUND: On 2022-11-01, AWS::AppFlow::ConnectorProfile published a property called 'ProfileProperties' with no definition of the type.
// This workaround assumes that it should be a map, but we have no idea what it should really be.
fmt.Printf("Warning: auto-fixing property that has no definition for %s\n", p.Documentation)
}

return nil

}
Expand Down

0 comments on commit bfcd40f

Please sign in to comment.