Conversation
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 2 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Member
|
Thanks for the contribution to improve the Rust generators |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #25014.
sanitizeIdentifiernow warns only when the final name differs from the cased original name, so a hyphenated or dotted name that only changes case no longer logs "PetRecord cannot be used as a model name. Renamed to PetRecord". Real renames still log, e.g. reserved words, leading digits and special characters (ApplicationJson ... Renamed to ApplicationSlashJson). ThenameWasModifiedflag went away because the comparison replaces it.On GitHub's REST description (github/rest-api-description@3cef12e8) the rust generator goes from 4 min 39 s and a 1.0 GB log (6,961,556 warnings) to 5.0 s and 2 MB (3,259 warnings), with identical generated files. The new
testSanitizeIdentifierWarnsOnlyOnRenamefails on master.PR checklist
./mvnw clean packageand./bin/generate-samples.sh ./bin/configs/rust-*.yaml; this only changes logging, so no samples change.Summary by cubic
Fixes #25014 by logging a sanitization warning only when the final name differs from the cased original. Case-only changes (e.g.
pet-name→PetName) no longer log a false rename, while real renames like reserved words or special characters still do. On GitHub's REST description this cuts the Rust generator from 4m39s and a 1.0GB log to 5s and 2MB, with identical output. The newtestSanitizeIdentifierWarnsOnlyOnRenamefails on master and filters out log events from tests running in parallel.Written for commit f759ab0. Summary will update on new commits.