Skip to content

When publishing SOAP APIs whose specification is imported from WSDL, every XSD schema artifact fails with a ValidationError, producing dozens of errors on otherwise healthy runs. #270

Description

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

  1. 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.
  2. Publish to another service instance.
  3. 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

close:fixedFixed by a previous PR or releasetype:bugSomething broken

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions