fix: strip schemaId/typeName from operation PATCH during reconciliation#111
Open
EMaher wants to merge 4 commits into
Open
fix: strip schemaId/typeName from operation PATCH during reconciliation#111EMaher wants to merge 4 commits into
EMaher wants to merge 4 commits into
Conversation
After spec import, APIM assigns its own auto-generated schema IDs to operation request/response representations. The reconciliation PATCH was sending the source instance's schema IDs, which don't exist on the target. APIM silently drops schemaId/typeName when the referenced schema doesn't exist, causing the compare phase to report missing fields. By stripping these fields from the PATCH body, APIM retains the schema references it assigned during its own spec import. The compare script already normalizes auto-generated hex IDs, so both sides match. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Author
|
@copilot - Make comments in comments in the changes more terse. Safe the decision/information to necessary squad members. |
Contributor
Contributor
Author
|
@copilot - but you did not update any squad files! |
Contributor
petehauge
approved these changes
Jun 6, 2026
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 the integration test failure in the "Round-Trip Phase 6 (Compare)" step where
createItemoperation onsrc-rest-openapireports:Root Cause
After spec import, APIM assigns its own auto-generated schema IDs to operation request/response representations. The
reconcileOperationsAfterSpecImportPATCH was sending the source instance's schema IDs (extracted from source APIM), which don't exist on the target instance. APIM silently dropsschemaId/typeNamewhen the referenced schema doesn't exist, resulting in the target having no schema references at all.Fix
Strip
schemaIdandtypeNamefrom representation objects inrequestandresponsesbefore sending the reconciliation PATCH. This lets APIM retain the schema references it assigned during its own spec import. The compare script already normalizes auto-generated hex IDs to{{auto-id}}, so both source and target will match.Related Issue(s)
Fixes workflow run: https://github.com/Azure/apiops-cli/actions/runs/27042790153/job/79822373426