feat(scripts): add Postman collection generation to project setup - #112
Merged
PAMulligan merged 1 commit intoJun 11, 2026
Merged
Conversation
setup-project.sh now generates postman/collection.json (Health, Auth, Resources folders, base_url/auth_token variables, collection-level pre-request script that injects the bearer token), a platform-aware postman/environment.json (port 3000 for Node, 8787 for Workers), and a project README with import and regeneration instructions. generate-openapi-docs.sh now tags the starter spec endpoints and, after exporting the spec, regenerates the Postman collection from it via openapi-to-postmanv2, then re-applies the base_url/auth_token variables and the auth pre-request script the converter cannot know about. Closes #59 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Summary
Implements #59 -- new projects ship with a ready-to-import Postman collection, and the docs script keeps the collection in sync with the OpenAPI spec.
setup-project.sh
Generates three new artifacts in every project (both platforms, dry-run aware):
postman/collection.json-- Postman Collection v2.1 with the required structure:GET {{base_url}}/health(with a status-200 test) andGET {{base_url}}/-- both work immediately against the starter appPOST {{base_url}}/auth/loginplaceholder whose test script capturestokenfrom a successful login into theauth_tokenenvironment variableAuthorization: Bearer {{auth_token}}on every request once the token is setbase_url/auth_tokenas fallbacks when no environment is selectedpostman/environment.json-- local environment withbase_url(platform-aware:http://localhost:3000for Node,http://localhost:8787for Workers) andauth_token(typesecretso Postman masks it)README.md-- project README with quickstart plus Postman import steps and the regeneration commandgenerate-openapi-docs.sh
Healthso folder-by-tags conversion mirrors the starter collection layoutpostman/collection.jsonfrom it viaopenapi-to-postmanv2(folderStrategy=Tags), then post-processes the output: renames the converter'''s{{baseUrl}}to Nerva'''s{{base_url}}, restores thebase_url/auth_tokenvariables, and re-applies the auth pre-request script the converter cannot know aboutVerification
bash -nand ShellCheck v0.11.0 (--severity=warning, matching CI) clean on both scriptssetup-project.sh(Node platform): both JSON files parse, folder/variable/script structure asserted with node, README fences and platform substitutions render correctlygenerate-openapi-docs.shinside the generated project: OpenAPI 3.1 spec converts successfully,{{baseUrl}}fully normalized, Health folder produced from tags, auth injection present in the regenerated collection--dry-runflowCloses #59
🤖 Generated with Claude Code