Add folder description to the generated postman.json#98
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Postman v2 collection generator to include folder descriptions in the generated postman.json, sourcing them from OpenAPI tag descriptions (or a default when missing).
Changes:
- Add a
PostmanRequestFoldermodel and switch tag-grouping to use it as the map key (name + description). - Update the Postman mustache template to render folder
nameanddescription. - Update/extend tests and test fixtures; remove TestNG dependency in favor of JUnit assertions.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/com/adyen/codegen/postman/PostmanV2Generator.java | Builds folder name/description and groups operations by a PostmanRequestFolder key |
| src/main/java/com/adyen/codegen/postman/model/PostmanRequestFolder.java | New model representing folder metadata (name/description) |
| src/main/resources/postman-v2/postman.mustache | Renders folder description into the generated Postman collection JSON |
| src/test/java/com/adyen/codegen/postman/PostmanV2GeneratorTest.java | Adds assertions for folder description and updates grouping tests for new map key type |
| src/test/java/com/adyen/codegen/postman/TestUtils.java | Switches assertions to JUnit |
| src/test/resources/Basic.yaml | Updates tag description used by generation test |
| pom.xml | Removes TestNG dependency |
💡 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.
| // get from spec | ||
| tagName = codegenOperation.tags.get(0).getName(); | ||
| tagDescription = codegenOperation.tags.get(0).getDescription(); | ||
| if(tagDescription == null) { | ||
| tagDescription = tagName + " tag"; | ||
| } | ||
| } | ||
| folder.setName(tagName); | ||
| folder.setDescription(tagDescription); |
There was a problem hiding this comment.
The folder description is taken from codegenOperation.tags.get(0).getDescription() and then written into JSON via the template. To avoid invalid JSON when the description contains quotes/newlines, it should be formatted/escaped similarly to preprocessOpenAPI’s use of formatDescription (or another JSON-escaping approach) before storing it on the folder object.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
|
@gcatanese I've opened a new pull request, #99, to work on those changes. Once the pull request is ready, I'll request review from you. |
Update generator to include the folder description. This is the tag description from the OpenAPI spec, or a default value when the tag description is not available.