Skip to content

Bug: Operation reconciliation after spec import fails due to stale schema refs in parameters #144

Closed

Description

Description

When publishing APIs with spec import to a fresh APIM instance, operation reconciliation (PATCH) fails with "Operation references schema that does not exist" for operations that have schemaId/typeName in their query parameters, headers, or template parameters.

Root Cause

The stripRepresentationSchemaRefs function in api-publisher.ts only strips schemaId and typeName from request.representations and responses[].representations, but APIM also stores schema references in:

  • request.queryParameters[].schemaId / .typeName
  • request.headers[].schemaId / .typeName
  • templateParameters[].schemaId / .typeName
  • responses[].headers[].schemaId / .typeName

When APIM imports a spec, it generates new schema IDs. The old IDs from the source instance no longer exist, so the PATCH is rejected.

Impact

Any API with typed query/path/header parameters will trigger WARN-level failures during publish to a different APIM instance. The API itself imports fine, but operation metadata (description, displayName) is not reconciled.

Affected APIs (from test run)

  • demo-conference-api: GetSpeakers, GetSessions, GetTopics, SubmitSession (query params with schema 67a3ac149273231fc454805e)
  • openaidemo: ImageGenerations_Create, embeddings_create, Transcriptions_Create, Translations_Create, ChatCompletions_Create, Completions_Create (path/query params with schema 67a3ac1664dd4817a03bec51)

Fix

Extend stripRepresentationSchemaRefs to also strip from queryParameters, headers, templateParameters, and responses[].headers.

Note: This fix has already been implemented on the fix/publish-overrides branch and will be included in the PR for #99.

Activity

  1. added a commit that references this issue on Jun 11, 2026
    43865b3
  2. added
    BugSomething broken
    and removed on Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething broken

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions