Skip to content
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-cli-core): extend js-yaml.JSON_SCHEMA to inherit json type conversions when parsing .yml cfn templates #7909

Merged

Conversation

Bentheburrito
Copy link
Contributor

Description of changes

Instead of creating a js-yaml schema that only contains conversions for cloudformation intrinsic
functions, we extend the built-in JSON-SCHEMA to inherit type conversions for bools, ints,
floats, etc.

See https://github.com/nodeca/js-yaml#load-string---options-

Issue #, if available

fix #7819

Description of how you validated changes

  • Parsed yaml cloudformation templates with boolean, number, and float values, and observed correct types in the returned object
  • yarn test
  • yarn lint

Checklist

  • PR description included
  • yarn test passes

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

…e conversions

Instead of creating a js-yaml schema that only contains conversions for cloudformation intrinsic
functions, we should extend the built-in JSON-SCHEMA to inherit type conversions for bools, ints,
floats, etc.

fix aws-amplify#7819
@Bentheburrito Bentheburrito requested a review from a team as a code owner August 6, 2021 19:45
@cjihrig
Copy link
Contributor

cjihrig commented Aug 7, 2021

Can you add some regression tests.

@Bentheburrito
Copy link
Contributor Author

Yeah, for sure!

@cjihrig cjihrig self-assigned this Aug 11, 2021
@cjihrig cjihrig merged commit fe5c1ec into aws-amplify:master Aug 25, 2021
jhockett pushed a commit that referenced this pull request Aug 25, 2021
…e conversions when parsing .yml cfn templates (#7909)

* fix(amplify-cli-core): extend js-yaml.JSON_SCHEMA to inherit json type conversions

Instead of creating a js-yaml schema that only contains conversions for cloudformation intrinsic
functions, we should extend the built-in JSON-SCHEMA to inherit type conversions for bools, ints,
floats, etc.

fix #7819

* test(amplify-cli-core): add regression tests
@github-actions github-actions bot added the referenced-in-release Issues referenced in a published release changelog label Sep 2, 2021
@github-actions
Copy link

github-actions bot commented Sep 2, 2021

👋 Hi, this pull request was referenced in the v5.4.0 release!

Check out the release notes here https://github.com/aws-amplify/amplify-cli/releases/tag/v5.4.0.

marcvberg pushed a commit to marcvberg/amplify-cli that referenced this pull request Oct 13, 2021
…e conversions when parsing .yml cfn templates (aws-amplify#7909)

* fix(amplify-cli-core): extend js-yaml.JSON_SCHEMA to inherit json type conversions

Instead of creating a js-yaml schema that only contains conversions for cloudformation intrinsic
functions, we should extend the built-in JSON-SCHEMA to inherit type conversions for bools, ints,
floats, etc.

fix aws-amplify#7819

* test(amplify-cli-core): add regression tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
referenced-in-release Issues referenced in a published release changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Amplify CLI is converting cloudformation yaml types (bool + numbers) to strings
2 participants