fix: resolve OpenAPI spec issues causing APIM deployment failures - #31
Closed
devin-ai-integration[bot] wants to merge 1 commit into
Closed
fix: resolve OpenAPI spec issues causing APIM deployment failures#31devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
- Fix broken $ref paths in customers/customers.yaml (./shared -> ../shared)
- Uncomment 200 response for GET /bookings/{bookingId} endpoint
- Add missing path parameters (bookingId, notificationId) to notification endpoints
- Remove empty variables: {} from server entry in main.yaml
- Add pre-merge APIM compatibility validation workflow
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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 multiple issues in the upstream OpenAPI specification that cause Azure API Management (APIM) to reject the spec during import via the ApiOps deployment pipeline. Also adds a CI validation workflow so these issues are caught before merge going forward.
Spec fixes:
customers/customers.yaml: Fixed 4 broken$refpaths onGET /customers/{customerId}—./shared/standard-responses.yaml→../shared/standard-responses.yaml(wrong relative path;./shared/resolves tocustomers/shared/which doesn't exist)bookings/bookings.yaml: Uncommented the200response onGET /bookings/{bookingId}— APIM requires at least one2xxresponse per operationbookings/bookings.yaml: Added missing path parameter definitions (bookingId,notificationId) to three notification endpoints (GET /notifications,GET /notifications/{notificationId},PUT /notifications/{notificationId}) — APIM requires all{template}variables in the path to have corresponding parameter declarationsmain.yaml: Removed emptyvariables: {}from the first server entry (bundling artifact incompatible with APIM)New CI workflow (
.github/workflows/validate.yaml):Runs on PRs to
masterand pushes tomaster. Bundles the spec withredocly bundle, runsredocly lint(non-blocking due to pre-existing warnings), then runs a Python validation script that checks APIM-specific requirements: no external/broken$refs, all operations have a2xxresponse, all path template variables have parameter definitions, no empty servervariablesobjects.Context: These issues were discovered after the bundled spec was imported into the ApiOps repo and the deployment pipeline failed. Fixes were applied downstream in PRs #693657 and #693914 on the ApiOps repo; this PR fixes the root cause upstream so the issues don't recur on re-bundling.
Review & Testing Checklist for Human
200response schema for GetBooking — the uncommented$refpoints to../bookings/components/booking-response.yaml(which wrapsview-booking.yaml). Confirm this matches the actual API response shape.bookingIdandnotificationIdastype: string. Confirm this matches the actual API's parameter types.docker-compose upand check docs render correctly — openhttp://localhost:8080and verify the GetBooking endpoint now shows a 200 response, the notification endpoints show their path parameters, and the GetCustomer endpoint still renders without errors.redocly bundle main.yaml -o bundled.yaml --forceand verify the bundled output can be successfully imported into APIM (or re-run the ApiOps pipeline with updated artifacts).Notes
redocly lintstep usescontinue-on-error: truebecause there are ~40+ pre-existing warnings (mostly example format mismatches likedate-timeexamples without theTseparator). These are cosmetic and don't affect APIM import, but they would block CI if the lint step were strict. A follow-up could clean those up and removecontinue-on-error.Link to Devin session: https://app.devin.ai/sessions/c706e71f8d9c4a3d8b5f74e7f0c43709