Skip to content

Convert OAS property names to valid Terraform identifiers#59

Merged
austinvalle merged 2 commits into
mainfrom
av/property-names
Sep 26, 2023
Merged

Convert OAS property names to valid Terraform identifiers#59
austinvalle merged 2 commits into
mainfrom
av/property-names

Conversation

@austinvalle

Copy link
Copy Markdown
Member

Closes #58

This ensures that OAS property names are converted to a valid Terraform identifier if needed and documents the expectations/caveats in the DESIGN.md. This was a lot easier because of the refactoring done in #51 🙏🏻

Notes

  • I was going back and forth on removing hypens vs. replacing them with an underscore. I decided to remove them as an "unsupported" character for now, but mostly just because I wanted to keep the logic under 5 steps 😆
  • I added the duplicate attributes caveat to the DESIGN.md, I also plan to add a call to the codegen-spec validate function before serializing to ensure an error is raised for that 👍🏻

@austinvalle austinvalle requested a review from a team as a code owner September 25, 2023 22:28
@austinvalle austinvalle changed the title Convert OAS property names Convert OAS property names to valid Terraform identifiers Sep 25, 2023

@bendbennett bendbennett left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM 🚀

The only thing I'm wondering about is whether codegen-openapi and codgen-spec should have any knowledge of "Terraform identifiers"? Perhaps we can discuss further out of band?

@austinvalle

Copy link
Copy Markdown
Member Author

Chatted offline, for now we're going to introduce the name validation in codegen-spec as it'll be less noise to remove the validation later vs. adding it later

@austinvalle austinvalle merged commit ff438fa into main Sep 26, 2023
@austinvalle austinvalle deleted the av/property-names branch September 26, 2023 11:25
@github-actions

Copy link
Copy Markdown

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators May 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Normalize property names from OAS into valid Terraform attribute name

2 participants