Fix/wsdl xsd schemas and dryrun label - #272
Merged
Alexander Zaslonov (azaslonov) merged 4 commits intoSep 12, 2026
Merged
Alexander Zaslonov (azaslonov) merged 4 commits into
Alexander Zaslonov (azaslonov) merged 4 commits into
Conversation
buildResourceLabel() always formatted labels from armPathSuffix, which has
more placeholders than a parent-level association descriptor (e.g. GatewayApi
discovered from gateways/{gateway}/apis.json with one name-part) can fill.
The resulting throw escaped from logger.info inside the dry-run loop and
aborted the entire publish with a fatal error.
Fall back to the artifactDirectory template when the descriptor has fewer
name-parts than armPathSuffix placeholders.
APIM recreates XSD schemas itself when a WSDL spec is imported, but the isAutoGeneratedId() filter only matches 24-char hex IDs while the WSDL importer names XSD schemas with GUIDs. The CLI therefore re-published them as explicit schemas and APIM rejected every PUT with ValidationError (25 errors across 7 SOAP APIs in a real-world export). Exclude schemas whose contentType is application/vnd.ms-azure-apim.xsd+xml from childPuts when the specification is being imported. Content-type filtering is safer than widening the auto-generated ID pattern to GUIDs, since user-defined schemas may legitimately use GUID names.
Copilot started reviewing on behalf of
Aleksey Zheltov (Alexey-Zheltov)
September 8, 2026 11:34
View session
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
XSD filtering currently removes explicitly managed schemas from non-WSDL API imports.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Fixes WSDL schema publishing failures and dry-run crashes for gateway API associations.
Changes:
- Filters generated XSD schemas after specification imports.
- Adds fallback labels for incomplete association descriptors.
File summaries
| File | Description |
|---|---|
src/services/api-publisher.ts |
Filters XSD schemas, but must limit exclusion to WSDL imports and add regression coverage. |
src/lib/resource-uri.ts |
Prevents incomplete association labels from crashing; direct fallback-path coverage is recommended. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…ted tests Address PR review feedback: - Only exclude XSD-content-type schemas when the imported spec format is wsdl; other importers (OpenAPI, Swagger, WADL) do not recreate them, so explicitly managed XSD schemas are retained there. - Add regression tests: GatewayApi label fallback for one-part descriptors (gateways/my-gateway) and two-part expansion; XSD/GUID schema skipped on WSDL import but retained on OpenAPI import.
Copilot started reviewing on behalf of
Aleksey Zheltov (Alexey-Zheltov)
September 8, 2026 11:45
View session
Copilot started reviewing on behalf of
Alexander Zaslonov (azaslonov)
September 12, 2026 00:38
View session
Copilot started reviewing on behalf of
Alexander Zaslonov (azaslonov)
September 12, 2026 00:46
View session
Alexander Zaslonov (azaslonov)
approved these changes
Sep 12, 2026
Tuan Nguyen (atuannguyen1101)
approved these changes
Sep 12, 2026
Aleksey Zheltov (Alexey-Zheltov)
deleted the
fix/wsdl-xsd-schemas-and-dryrun-label
branch
September 14, 2026 15:40
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
Fixes two publish bugs found while round-tripping a real-world APIM export containing SOAP (WSDL) APIs and gateway API associations:
Dry-run fatal crash on gateway API associations —
buildResourceLabel()formatted log labels fromarmPathSuffix(gateways/{0}/apis/{1}), which throws for parent-level association descriptors that carry only the gateway name. The throw escaped from the dry-run loop and aborted the whole publish. Now falls back to theartifactDirectorytemplate when the descriptor has fewer name-parts than the ARM template requires.ValidationError on every WSDL-importer-generated XSD schema — the WSDL importer names XSD schemas with GUIDs, but
isAutoGeneratedId()only matches 24-char hex IDs, so the CLI re-published these schemas after spec import and APIM rejected each PUT. Now schemas withcontentType: application/vnd.ms-azure-apim.xsd+xmlare excluded fromchildPutswhen the specification is imported.Related Issue(s)
Closes #270
Closes #269
Verification
npx vitest run— 1464 passed (the only failing file,tests/unit/cli/index.test.ts, is a known 9p-mount environment issue, unrelated)tsc --noEmitcleanNotes for Reviewers
Code review required per repo policy for
src/changes (.squad/ceremonies.md).Content-type filtering was chosen over widening the auto-generated ID regex to GUIDs because user-defined schemas may legitimately use GUID names.