Skip to content

Add folder description to the generated postman.json#98

Open
gcatanese wants to merge 5 commits into
mainfrom
add-folder-description
Open

Add folder description to the generated postman.json#98
gcatanese wants to merge 5 commits into
mainfrom
add-folder-description

Conversation

@gcatanese
Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 PostmanRequestFolder model and switch tag-grouping to use it as the map key (name + description).
  • Update the Postman mustache template to render folder name and description.
  • 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.

Comment thread src/test/java/com/adyen/codegen/postman/PostmanV2GeneratorTest.java Outdated
Comment thread src/main/resources/postman-v2/postman.mustache
Comment thread src/main/java/com/adyen/codegen/postman/PostmanV2Generator.java
Comment on lines +283 to +291
// 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);
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

Comment thread src/main/java/com/adyen/codegen/postman/model/PostmanRequestFolder.java Outdated
Comment thread src/main/java/com/adyen/codegen/postman/model/PostmanRequestFolder.java Outdated
Comment thread src/test/resources/Basic.yaml Outdated
Copy link
Copy Markdown

Copilot AI commented Mar 6, 2026

@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.

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.

4 participants