Command that triggered the bug
apiops publish
Expected behavior
WSDL-importer-generated XSD schemas are skipped during publish (APIM recreates them from the imported WSDL); publish completes with no errors and the schema count on the target matches the source.
Actual behavior
Error
ERROR PUT apischema/<soap-api>/<schema-guid>: Async operation failed for
apis/<soap-api>/schemas/<schema-guid>:
[ValidationError] One or more fields contain incorrect values:
Only XSD schemas fail (contentType: application/vnd.ms-azure-apim.xsd+xml); OpenAPI component schemas publish fine.
Root Cause
When a WSDL is imported (?import=true&format=wsdl), APIM auto-recreates the XSD schemas itself, so the CLI must not re-PUT them. planApiPublication() (src/services/api-publisher.ts) excludes auto-generated schemas using isAutoGeneratedId(), but that helper only matches 24-char lowercase hex IDs (^[0-9a-f]{24}$). The WSDL importer names XSD schemas with GUIDs (e.g. 4b6fe4d6-dbad-4db0-a6d6-58958e74850d), so they slip through the filter as "explicit" schemas, get re-published after the spec import, and APIM rejects the PUTs.
Steps to Reproduce
- Extract a service containing a SOAP (WSDL) API — the extract produces
apis/<api>/schemas/<guid>/schemaInformation.json files with contentType: application/vnd.ms-azure-apim.xsd+xml.
- Publish to another service instance.
- Every XSD schema PUT fails with
ValidationError.
Suggested Fix
In planApiPublication(), when importSpecification is true, exclude schemas whose artifact properties.contentType is application/vnd.ms-azure-apim.xsd+xml. Filtering by content type is safer than widening isAutoGeneratedId() to GUIDs, since user-defined schemas may legitimately use GUID names.
Verified fix: after excluding XSD schemas, publish completes with 0 errors and the target APIM contains the exact same schema counts per API as the source (recreated by the WSDL import).
apiops CLI version
1.0.1
Environment details
- apiops-cli 1.0.1
- Node.js 22.16.0
- VSCode: devcontainer
CI/CD environment
None
Is this bug blocking you?
Yes
Command that triggered the bug
apiops publish
Expected behavior
WSDL-importer-generated XSD schemas are skipped during publish (APIM recreates them from the imported WSDL); publish completes with no errors and the schema count on the target matches the source.
Actual behavior
Error
Only XSD schemas fail (
contentType: application/vnd.ms-azure-apim.xsd+xml); OpenAPI component schemas publish fine.Root Cause
When a WSDL is imported (
?import=true&format=wsdl), APIM auto-recreates the XSD schemas itself, so the CLI must not re-PUT them.planApiPublication()(src/services/api-publisher.ts) excludes auto-generated schemas usingisAutoGeneratedId(), but that helper only matches 24-char lowercase hex IDs (^[0-9a-f]{24}$). The WSDL importer names XSD schemas with GUIDs (e.g.4b6fe4d6-dbad-4db0-a6d6-58958e74850d), so they slip through the filter as "explicit" schemas, get re-published after the spec import, and APIM rejects the PUTs.Steps to Reproduce
apis/<api>/schemas/<guid>/schemaInformation.jsonfiles withcontentType: application/vnd.ms-azure-apim.xsd+xml.ValidationError.Suggested Fix
In
planApiPublication(), whenimportSpecificationis true, exclude schemas whose artifactproperties.contentTypeisapplication/vnd.ms-azure-apim.xsd+xml. Filtering by content type is safer than wideningisAutoGeneratedId()to GUIDs, since user-defined schemas may legitimately use GUID names.Verified fix: after excluding XSD schemas, publish completes with 0 errors and the target APIM contains the exact same schema counts per API as the source (recreated by the WSDL import).
apiops CLI version
1.0.1
Environment details
CI/CD environment
None
Is this bug blocking you?
Yes