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(codegen): check javascript property validity for property access #3649

Merged
merged 3 commits into from
May 27, 2022

Conversation

kuhe
Copy link
Contributor

@kuhe kuhe commented May 27, 2022

Issue

Internal P64934837

Description

  • add function helper for property access to decide between .prop and ['prop'] access modes.
  • it's not exhaustively applied, but covers the issue that was exposed by the unreleased model.
  • no changes needed in smithy-typescript.

Testing

  • ran yarn generate-clients using the unreleased smithy model (not shown here)
  • confirmed unreleased model builds valid TS and compiles to dist.
  • confirmed this doesn't cause any existing client code changes.
  • added unit tests for new function

@kuhe kuhe added the pr/needs-review This PR needs a review from a Member. label May 27, 2022
@kuhe kuhe requested a review from a team as a code owner May 27, 2022 22:05
@kuhe kuhe self-assigned this May 27, 2022
@kuhe kuhe requested review from AllanZhengYP and trivikr May 27, 2022 22:18

import java.util.regex.Pattern;

public final class PropertyAccessor {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be moved to smithy-typescript since it is not SDK specific... later?

@kuhe kuhe merged commit 31e72ac into aws:main May 27, 2022
@kuhe kuhe deleted the fix/property-access branch May 27, 2022 23:40
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr/needs-review This PR needs a review from a Member.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants