publish-postman: wrap tags under APIs folder, alphabetize, fix V2 example option#325
Merged
Merged
Conversation
…ion name Three independent improvements to OpenAPI → Postman conversion: 1. Top-level restructure: wrap tag-derived folders in a single "APIs" folder; keep the converter-generated "Webhooks" folder peer-level. openapi-to-postmanv2 always emits webhooks under a hardcoded "Webhooks" folder regardless of per-webhook tags, so partitioning by name is stable. 2. Alphabetize APIs folder case-insensitively. cXML slots into the C's, SWML follows Subscribers — proper dictionary order instead of ASCII byte order. Per-tag request order and Webhooks contents unchanged. 3. Fix example resolution: replace V1 option names that the V2 CLI silently ignored. openapi-to-postmanv2 v6.0.1 defaults to the V2 module, which only reads the unified parametersResolution option. The previous config passed V1-only names through -c <file>, which bypasses the CLI's V1→V2 backfill, so V2 fell back to its default 'Schema' faker. Switch to parametersResolution: Example so operation-level and parameter examples flow through correctly.
Contributor
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
Three independent improvements to the OpenAPI → Postman conversion pipeline. Each is isolated to either the workflow jq pass or the converter options file — no spec changes, no behavioral risk to anything outside Postman publishing.
1. Wrap tag folders under a top-level
APIsfolderTop-level collection layout becomes:
The
Webhooksfolder is hardcoded by openapi-to-postmanv2 (libV2/.../generateFolderForOpenAPI.js:6) — every webhook lands there regardless of how it's tagged in the spec, because_generateWebhookEndpointsruns separately from_generateTreeFromTagsand doesn't consultfolderStrategy. Partitioning by the literal name"Webhooks"is therefore stable.2. Alphabetize APIs folder, case-insensitively
sort_by(.name | ascii_downcase)putscXML *nearCall Flows(instead of dropping to the bottom of the list under ASCII byte order where lowercasec> uppercaseW), andSWML *afterSubscribersper dictionary convention.Per-tag request order is not sorted (left to the converter's path/method order). The
Webhooksfolder contents are also unchanged.3. Fix
parametersResolutionoption name (V1 → V2)openapi-to-postmanv2@6.0.1defaults to the V2 module (bin/openapi2postmanv2.js:136), which only reads the unifiedparametersResolutionoption. The previous config passed V1-only names (requestParametersResolution,exampleParametersResolution) through-c <file>— and the CLI's V1→V2 backfill (lines 54-56) only runs for-O key=valueargs, not for config files. So V2 silently fell back to its defaultSchemafaker, ignoring the spec's@exampledecorators.Result: operation-level
requestBody.content.<mime>.examplesblocks now populate the Postman request body correctly, instead of returning faker placeholders like<string>.Verification
Tested against both watched specs locally with
openapi-to-postmanv2@6.0.1:APIs(59 children, alphabetized) +Webhooks(4 children); real example values for operations with namedexamples:blocksAPIs(21 children) +Webhooks(5 children)Postman SDK (
postman-collection@4) parses both payloads cleanly — no schema regressions.Out of scope
@exampledecorators still don't surface for nested properties — the bundled 2018-era json-schema-faker only reads singularexample:, not the pluralexamples:array form that OpenAPI 3.1 / TypeSpec emits. Separate problem with no clean fix in the current converter; documented in the team Slack thread.oneOfrequest body variants still render only the first variant — this is hardcoded inlibV2/.../schemaUtils.js:612(compositeSchema[0]) with no option to control it. PR #768's matched-key multi-example support was deliberately reverted upstream inv5.8.0by PR #925. Separate decision pending.Files
.github/workflows/publish-postman.yml— extended jq pipeline (partition + sort + wrap) in the existing 'strip IDs and wrap for PUT' step. Conversion step, link-rewrite step, and PUT step untouched.scripts/postman/convert-options.json— replaced two V1-only options with the unified V2 option.How to verify after merge
The next push to
mainthat changes eitherfern/apis/signalwire-rest/openapi.yamlorfern/apis/compatibility/openapi.yamlwill publish the new layout. Or triggerworkflow_dispatchwithforce_all: trueto republish immediately.