Skip to content

Preserve API overrides during spec publish by reusing publisher DTO - #862

Merged
guythetechie merged 2 commits into
Azure:mainfrom
ametelski:main
Jun 27, 2026
Merged

Preserve API overrides during spec publish by reusing publisher DTO#862
guythetechie merged 2 commits into
Azure:mainfrom
ametelski:main

Conversation

@ametelski

Copy link
Copy Markdown
Contributor

When publishing an API with a spec file, ApiOps performs two updates: first it PUTs the API DTO (including publisher overrides), then it PUTs the specification payload. The bug is that the spec PUT path was rebuilding its payload from a fresh APIM GET response, and that response can omit fields like translateRequiredQueryParameters. As a result, override values applied in the first PUT could be dropped in the second PUT, causing APIM to fall back to default behavior (e.g., required query params treated as path templates, leading to unexpected 404s instead of 400s).

The fix is to reuse the already-resolved publisher DTO as the base for spec publishing, then merge only spec-specific fields (format and value). This preserves override-controlled properties across both PUTs and keeps API behavior deterministic.

Closes #860

@ametelski

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

@guythetechie
guythetechie merged commit a153884 into Azure:main Jun 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] translateRequiredQueryParameters: "query" not honored by publisher

2 participants