Codegen adds duplicate localUri and mimeType fields to S3ObjectInput
Describe the bug
Prior to complex object support being baked into the CLI, customers had to add the objects manually, so some schemas include definitions like:
type S3Object {
bucket: String!
region: String!
key: String!
}
input S3ObjectInput {
bucket: String!
region: String!
key: String!
localUri: String!
mimeType: String!
}
Running amplify codegen against that schema in an iOS project produces an S3ObjectInput struct with duplicate declarations of localUri and mimeType:
public struct S3ObjectInput: GraphQLMapConvertible {
public var graphQLMap: GraphQLMap
public init(bucket: String, region: String, key: String, localUri: String, mimeType: String, localUri: String, mimeType: String) {
graphQLMap = ["bucket": bucket, "region": region, "key": key, "localUri": localUri, "mimeType": mimeType, "localUri": localUri, "mimeType": mimeType]
}
...
Expected behavior
Codegen should inspect the S3ObjectInput fields for the existence of localUri and mimeType, and not add them if they are already there.
Desktop (please complete the following information):
- OS: MacOS 10.14.6
- Browser: N/A
- Version: N/A
- Amplify version: 1.8.5
@palpatim
Thanks for reporting this, this is a bug, we will send out a fix soon.
Additional information:
API.swift file is created after the amplify push, but its contents are almost empty other than the one line "import AWSAppSync" at the tope. Contents are filled only after explicitly executing amplify codegen.
This is still happening, Sept 1, 2019.
This is still happening Feb 18th 2021
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.
Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels for those types of questions.