Skip to content

fix(keywords): extend the list of restricted names, with a test#21

Open
ceejbot wants to merge 2 commits into
kurtbuilds:masterfrom
ceejbot:ceej/this-is-a-branch
Open

fix(keywords): extend the list of restricted names, with a test#21
ceejbot wants to merge 2 commits into
kurtbuilds:masterfrom
ceejbot:ceej/this-is-a-branch

Conversation

@ceejbot
Copy link
Copy Markdown

@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