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

Code generator should handle flattened ARM ID's better #1651

Open
matthchr opened this issue Jul 15, 2021 · 4 comments
Open

Code generator should handle flattened ARM ID's better #1651

matthchr opened this issue Jul 15, 2021 · 4 comments

Comments

@matthchr
Copy link
Member

Describe the current behavior
Today, there is a special flattenedPropertyHandler handler for properties that have been flattened, and a referencePropertyHandler for properties that are references. Unfortunately, if a property is both flattened and a reference, it ends up taking the flattenedPropertyHandler path which assumes that the property names on both sides line up. For reference properties they don't as one is xReference and one is xId (usually).

Describe the improvement
Today we have special one-off handling in the flattenedPropertyHandler to deal with this case, where it checks for the presence of astmodel.ARMReferenceTag and honors that rename instead. Instead, we should consider making a standard way to rename properties so that we don't need to duplicate this logic in two handlers. Additionally if more causes for renames come along, checking each specific one will be difficult whereas if we have a standard one in theory it will be easier.

We also need to add tests for these interaction cases as they can be quite tricky. Unfortunately right now flattening isn't easily testable with golden files.

@matthchr matthchr added the task label Jul 15, 2021
@matthchr matthchr added this to the codegen-beta milestone Jul 15, 2021
@theunrepentantgeek
Copy link
Member

We still need to do this.

@theunrepentantgeek
Copy link
Member

It's possible we no longer need this now #2323 has been merged. We need to check.

@matthchr
Copy link
Member Author

No we still need to do this I think. Not high priority though.

@matthchr
Copy link
Member Author

No change from above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants