-
Notifications
You must be signed in to change notification settings - Fork 0
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
Amplify Client generator creating array type for string #506
Comments
Hey,👋 thanks for raising this! I'm going to transfer this over to our data repository for better assistance 🙂 |
Hello, Here is the additional requested information:
Finally, some additional information that I think would be helpful, is that the following works locally, but the TypeScript compiler complains, making it unable to be deployed to amplify.
The compiler believes that all types should be string[], even though this is not the case. Thank you for your help, |
Hi @kannu-19 👋 can you run the following command and let us know what version of npm update @aws-amplify/data-schema |
Environment information
Describe the bug
Cx is experiencing issues related to the schema and type handling in his application setup, specifically with how TypeScript interprets the transactionId property in the TransactionMetadata model[schema given below]
The array is being converted into a string with square brackets (showing as "[transaction-id]"), but the desired format should be just "transaction-id" without the brackets. Cx is confused if this is appears to be an issue with how the TypeScript client is being generated.
Reproduction steps
==============
Customer current schema :
Backend
In amplify_outputs.json:
"transactionId": {
"name": "transactionId",
"isArray": false,
"type": "String",
"isRequired": true,
"attributes": []
}
Frontend
==============
Approches we tried to resolve it:
Is the issue with the client generator?
The text was updated successfully, but these errors were encountered: