amplify-category-api icon indicating copy to clipboard operation
amplify-category-api copied to clipboard

fix: handle Enums correctly on Typescript data schema generation

Open tejas2008 opened this issue 1 year ago • 0 comments

Description of changes

  • Update Schema generator package to add handling of enums globally
  • Inside the model use ref() to define those enums
  • Added unit test to handle various combination of enum possibilities for Postgresql and mysql

This change would only affect an existing customer only if they re import the schema which is highly unlikely so we have determined this change to be a non breaking change.

CDK / CloudFormation Parameters Changed

Issue #, if available

https://github.com/aws-amplify/amplify-category-api/issues/2596

Description of how you validated changes

  • Updated a current test snapshot
  • Added more unit tests to validate proper enum handling generating snapshots and passing tests.

Checklist

  • [x] PR description included
  • [x] yarn test passes
  • [x] Tests are changed or added

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

tejas2008 avatar Sep 12 '24 17:09 tejas2008