Repository navigation
feat(validate): warn on spec names that contain a line break - #313
Merged
Merged
Conversation
Code generators print spec names into comments and string literals of the generated source. A line feed in a name ends a // comment there, and the rest of the name compiles as code. No Swagger 2.0 name needs a line break, so validateDubiousNames adds a DubiousNameWarning, located by JSON pointer, for any name holding \n or \r: path templates, operationIds, tags, parameter names, response header names, the keys of the top-level parameters and responses, definition and property names, discriminators, auth scheme keys and apiKey names. Descriptions, examples, enum and default values may span lines and are not checked. Findings are warnings: a spec that was valid stays valid. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #313 +/- ##
=======================================
Coverage 96.97% 96.97%
=======================================
Files 34 35 +1
Lines 3797 3868 +71
=======================================
+ Hits 3682 3751 +69
- Misses 111 113 +2
Partials 4 4 ☔ View full report in Codecov by Harness. |
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.
Code generators print spec names into comments and string literals of the generated source. A line feed in a name ends a // comment there, and the rest of the name compiles as code. No Swagger 2.0 name needs a line break, so validateDubiousNames adds a DubiousNameWarning, located by JSON pointer, for any name holding \n or \r: path templates, operationIds, tags, parameter names, response header names, the keys of the top-level parameters and responses, definition and property names, discriminators, auth scheme keys and apiKey names.
Descriptions, examples, enum and default values may span lines and are not checked. Findings are warnings: a spec that was valid stays valid.
Change type
Please select: 🆕 New feature or enhancement|🔧 Bug fix'|📃 Documentation update
Short description
Fixes
Full description
Checklist