chore(docs): auto-update Admin-API swagger#53
Conversation
📝 WalkthroughWalkthroughThis PR extends the AMRIT admin API specification with facility hierarchy management, ASHA supervisor mappings, and facility/item lookup endpoints. New ChangesOpenAPI Admin Specification Update
🎯 4 (Complex) | ⏱️ ~45 minutes
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
docs/swagger/admin-api.json (2)
1382-1660:⚠️ Potential issue | 🟠 Major | 🏗️ Heavy liftReplace opaque
stringschemas with concrete JSON schemas for new ASHA mapping endpoints
Indocs/swagger/admin-api.json(lines 1382–1660), these 7 operations set bothrequestBody.content.application/json.schemaandresponses.200.content.application/json.schemato{"type":"string"}(e.g.,/userFacilityMapping/getFacilityByMappingID,/userFacilityMapping/getAshasByFacility, and all/userFacilityMapping/ashaSupervisorMapping/*operations). Update them to proper JSON object/array schemas (preferably via$ref) so client generation/validation reflects the real payloads.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/swagger/admin-api.json` around lines 1382 - 1660, The OpenAPI operations use opaque {"type":"string"} schemas; replace those with concrete JSON object/array schemas (prefer $ref entries) for both requestBody.content.application/json.schema and responses.200.content.application/json.schema for operationIds getFacilityByMappingID, getAshasByFacility, updateAshaSupervisorMappingAtomically, saveAshaSupervisorMapping, restoreAshaSupervisorMapping, getSupervisorMappingByFacility, and deleteAshaSupervisorMapping; add appropriate component schema definitions (e.g., FacilityByMappingRequest / FacilityResponse, AshasByFacilityRequest / AshaListResponse, AshaSupervisorMappingRequest / AshaSupervisorMappingResponse or AshaSupervisorMappingArray) and update each operation to point to those $ref schemas so generated clients/validators get correct object/array types.
1662-1699:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winNormalize
200response content media types toapplication/json(remove*/*)
docs/swagger/admin-api.jsonstill usesresponses["200"].content["*/*"]forPOST /uptsu/submit/cdss(around line 1692) andPOST /uptsu/saveFacility(around line 1733), unlike adjacent updates that specifyapplication/json.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/swagger/admin-api.json` around lines 1662 - 1699, The 200 response for POST /uptsu/submit/cdss uses a wildcard media type "*/*"; update responses["200"].content to use "application/json" instead of "*/*" and keep the existing schema (type: string) so tools expect JSON; adjust the same pattern for the related endpoint (operationId saveCdssDetails and also check POST /uptsu/saveFacility) to match the adjacent responses that use "application/json".
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/swagger/admin-api.json`:
- Around line 1467-1468: The summary strings contain internal references like
"Fix 7" that should be removed and replaced with user-facing descriptions;
update the "summary" value for the operation with operationId
"updateAshaSupervisorMappingAtomically" to a concise description of behavior
(e.g., "Atomically replace old ASHA supervisor mappings with new mappings") and
similarly find and update any other summaries that include "Fix 8 + Fix 19" to
plain user-facing wording; ensure only the public-facing summary text is changed
and operationId values remain untouched.
- Around line 11068-11105: The POST operation for path
"/getItemMappingsByFacility" (operationId getItemMappingsByFacility) is missing
a summary; add a short summary property to the operation object (e.g. "summary":
"Retrieve item-facility mappings") so Swagger UI shows a human-friendly
description instead of falling back to operationId—place the summary at the same
level as tags and operationId inside the operation definition.
---
Outside diff comments:
In `@docs/swagger/admin-api.json`:
- Around line 1382-1660: The OpenAPI operations use opaque {"type":"string"}
schemas; replace those with concrete JSON object/array schemas (prefer $ref
entries) for both requestBody.content.application/json.schema and
responses.200.content.application/json.schema for operationIds
getFacilityByMappingID, getAshasByFacility,
updateAshaSupervisorMappingAtomically, saveAshaSupervisorMapping,
restoreAshaSupervisorMapping, getSupervisorMappingByFacility, and
deleteAshaSupervisorMapping; add appropriate component schema definitions (e.g.,
FacilityByMappingRequest / FacilityResponse, AshasByFacilityRequest /
AshaListResponse, AshaSupervisorMappingRequest / AshaSupervisorMappingResponse
or AshaSupervisorMappingArray) and update each operation to point to those $ref
schemas so generated clients/validators get correct object/array types.
- Around line 1662-1699: The 200 response for POST /uptsu/submit/cdss uses a
wildcard media type "*/*"; update responses["200"].content to use
"application/json" instead of "*/*" and keep the existing schema (type: string)
so tools expect JSON; adjust the same pattern for the related endpoint
(operationId saveCdssDetails and also check POST /uptsu/saveFacility) to match
the adjacent responses that use "application/json".
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: c0411d09-7ef0-4f79-8931-63653e891abd
📒 Files selected for processing (1)
docs/swagger/admin-api.json
| "summary": "Atomically delete old and save new ASHA supervisor mappings (Fix 7)", | ||
| "operationId": "updateAshaSupervisorMappingAtomically", |
There was a problem hiding this comment.
Remove internal fix references from public summaries.
Fix 7 and Fix 8 + Fix 19 will surface in Swagger UI and generated docs, but they do not tell API consumers anything about behavior. Please replace them with user-facing wording only.
Also applies to: 13979-13980
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/swagger/admin-api.json` around lines 1467 - 1468, The summary strings
contain internal references like "Fix 7" that should be removed and replaced
with user-facing descriptions; update the "summary" value for the operation with
operationId "updateAshaSupervisorMappingAtomically" to a concise description of
behavior (e.g., "Atomically replace old ASHA supervisor mappings with new
mappings") and similarly find and update any other summaries that include "Fix 8
+ Fix 19" to plain user-facing wording; ensure only the public-facing summary
text is changed and operationId values remain untouched.
| "/getItemMappingsByFacility": { | ||
| "post": { | ||
| "tags": [ | ||
| "m-item-facility-mapping-controller" | ||
| ], | ||
| "operationId": "getItemMappingsByFacility", | ||
| "parameters": [ | ||
| { | ||
| "name": "Authorization", | ||
| "in": "header", | ||
| "schema": { | ||
| "type": "string" | ||
| } | ||
| } | ||
| ], | ||
| "requestBody": { | ||
| "content": { | ||
| "application/json": { | ||
| "schema": { | ||
| "type": "string" | ||
| } | ||
| } | ||
| }, | ||
| "required": true | ||
| }, | ||
| "responses": { | ||
| "200": { | ||
| "description": "OK", | ||
| "content": { | ||
| "application/json": { | ||
| "schema": { | ||
| "type": "string" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Add a summary for this new operation.
This endpoint is missing summary, so Swagger UI will fall back to operationId. Add a short description to keep the new lookup endpoints documented consistently.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/swagger/admin-api.json` around lines 11068 - 11105, The POST operation
for path "/getItemMappingsByFacility" (operationId getItemMappingsByFacility) is
missing a summary; add a short summary property to the operation object (e.g.
"summary": "Retrieve item-facility mappings") so Swagger UI shows a
human-friendly description instead of falling back to operationId—place the
summary at the same level as tags and operationId inside the operation
definition.
This PR automatically updates Admin-API Swagger JSON
from the latest main branch build.
Summary by CodeRabbit