Escape special characters in folder description before writing to postman.json#99
Open
Copilot wants to merge 2 commits into
Open
Escape special characters in folder description before writing to postman.json#99Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
Co-authored-by: gcatanese <1771700+gcatanese@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Address feedback on adding folder description to postman.json
Escape special characters in folder description before writing to postman.json
Mar 6, 2026
There was a problem hiding this comment.
Pull request overview
This PR aims to prevent invalid JSON in the generated postman.json when OpenAPI tag descriptions contain special characters (notably quotes and newlines), by escaping the folder description before it’s rendered into the Postman collection template.
Changes:
- Apply
formatDescription(...)to tag descriptions inPostmanV2Generator.addToMapbefore creatingPostmanRequestFolder. - Add a unit test asserting that quotes and newlines are escaped in the stored folder key/description.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/main/java/com/adyen/codegen/postman/PostmanV2Generator.java |
Escapes tag description before storing it on PostmanRequestFolder for tag-based folder generation. |
src/test/java/com/adyen/codegen/postman/PostmanV2GeneratorTest.java |
Adds coverage to ensure folder descriptions escape quotes and newlines when added via addToMap. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Comment on lines
+287
to
290
| } else { | ||
| tagDescription = formatDescription(tagDescription); | ||
| } | ||
| } |
Comment on lines
286
to
289
| tagDescription = tagName + " tag"; | ||
| } else { | ||
| tagDescription = formatDescription(tagDescription); | ||
| } |
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.
Tag descriptions containing quotes or newlines would produce invalid JSON in the generated
postman.jsonsince they were written into the template unescaped.Changes
PostmanV2Generator.addToMap: ApplyformatDescriptionto the tag description before storing it onPostmanRequestFolder, escaping"→\"and newlines →\ntestAddToMapEscapesFolderDescriptioncovering descriptions with embedded quotes and newlines✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.