-
Notifications
You must be signed in to change notification settings - Fork 824
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
fix(amplify-codegen-appsync-model-plugin): Support Embeddable Types for iOS #4545
Conversation
...es/amplify-codegen-appsync-model-plugin/src/__tests__/visitors/appsync-swift-visitor.test.ts
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #4545 +/- ##
==========================================
- Coverage 61.57% 61.17% -0.41%
==========================================
Files 333 333
Lines 14550 14652 +102
Branches 2764 2935 +171
==========================================
+ Hits 8959 8963 +4
- Misses 5164 5245 +81
- Partials 427 444 +17
Continue to review full report at Codecov.
|
This pull request introduces 1 alert when merging b9be43b into 2c04c28 - view on LGTM.com new alerts:
|
@@ -269,19 +279,17 @@ export class AppSyncSwiftVisitor extends AppSyncModelVisitor { | |||
|
|||
private getSwiftModelTypeName(field: CodeGenField) { | |||
if (this.isEnumType(field)) { | |||
const name = this.getEnumName(field.type); | |||
return field.isList ? `[${name}].self` : `${name}.self`; | |||
return `${this.getEnumName(field.type)}.self`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
confirm enum collections
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ran codegen + provisioned API with schema using array of an enum. API calls look good, as long as it is an enum, it will be embedded inside .embedded(type)
or .embeddedCollection(of:)
when it is an array, without needing square brackets (as removed here)
This pull request introduces 1 alert when merging da1150f into 2c04c28 - view on LGTM.com new alerts:
|
in circleCI workflow
|
@@ -269,19 +279,17 @@ export class AppSyncSwiftVisitor extends AppSyncModelVisitor { | |||
|
|||
private getSwiftModelTypeName(field: CodeGenField) { | |||
if (this.isEnumType(field)) { | |||
const name = this.getEnumName(field.type); | |||
return field.isList ? `[${name}].self` : `${name}.self`; | |||
return `${this.getEnumName(field.type)}.self`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you
packages/amplify-codegen-appsync-model-plugin/src/visitors/appsync-swift-visitor.ts
Outdated
Show resolved
Hide resolved
packages/amplify-codegen-appsync-model-plugin/src/visitors/appsync-swift-visitor.ts
Outdated
Show resolved
Hide resolved
…sync-swift-visitor.ts Co-authored-by: Yathi <511386+yuth@users.noreply.github.com>
…sync-swift-visitor.ts Co-authored-by: Yathi <511386+yuth@users.noreply.github.com>
thanks for reviewing @yuth ! |
packages/amplify-codegen-appsync-model-plugin/src/visitors/appsync-swift-visitor.ts
Outdated
Show resolved
Hide resolved
…sync-swift-visitor.ts
…or iOS (aws-amplify#4545) - embedded types no longer return encased in square bracket - generate schemas for non models - fix Location Schema test - updated swift presets to generate for all models, including the embedded non-models - Update packages/amplify-codegen-appsync-model-plugin/src/preset.ts - remove unsured hasDirective - rename to Embeddable - Update packages/amplify-codegen-appsync-model-plugin/src/visitors/appsync-swift-visitor.ts Co-authored-by: Yathi <511386+yuth@users.noreply.github.com>
This pull request 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 |
Issue #, if available:
Description of changes:
customType
toembedded(type)
andembeddedCollection(of)
amplify codegen models
to generate Extensions for embedded typesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.