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(keywords): extend the list of restricted names, with a test #21

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ceejbot
Copy link

@ceejbot ceejbot commented Apr 3, 2024

I observed that the list of restricted words didn't cover some attractive words when I attempted to generate a Rust client for a schema that used keywords like async as field names.

  • Extended the list of names in is_restricted().
  • Added a short yaml schema that uses all of the restricted words as field names. Put this fixture to work in a test, to ensure no regressions.

The list is undoubtedly incomplete, but there is a very clear place to add new ones (thank you!) and now a test to validate it.

The whitespace changes in lib.rs are from my editor auto-applying cargo fmt to the file.

ceejbot added 2 commits April 2, 2024 18:21
I observed that the list of restricted words didn't cover some
attractive words when I attempted to generate a Rust client for
a schema that used keywords like `async` as field names.

- Extended the list of names in `is_restricted()`.
- Added a short yaml schema that uses all of the restricted words
  as field names. Put this fixture to work in a test, to ensure no
  regressions.

The list is undoubtedly incomplete, but there is a very clear place
to add new ones (thank you!) and now a test to validate it.
This is the right way to do it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant