docs: fix OpenAPI spec accuracy and warnings
## Changes
### Route Corrections
- Remove non-existent `/auth/refresh` endpoint
- Add missing `/auth/users/{userId}/password` PUT endpoint
- Fix `/notifications` GET -> `/notifications/team` GET (correct path)
### OpenAPI 3.1.0 Compliance
- Fix `nullable` warnings by using `type: ["string", "null"]` syntax
- Updated Incident schema nullable fields (endTime, message, statusCode, etc.)
- Updated QueueJob schema nullable fields (processedOn, finishedOn)
- Updated Check schema nullable field (ackAt)
### Verified Against Codebase
- Audited all 76 API endpoints across 12 route files
- Confirmed DELETE /checks/team and DELETE /checks/{monitorId} exist
- All routes now match actual codebase implementation
## Validation
- Passes `swagger-cli validate`
- Only remaining warnings are cosmetic `example` deprecations
This commit is contained in:
1 parent
3b0326457f
commit
ab25531758
1 file changed
+101
-95
+101
-95
@@ -162,51 +162,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/auth/refresh": {
|
|
||||||
"post": {
|
|
||||||
"tags": ["auth"],
|
|
||||||
"summary": "Refresh access token",
|
|
||||||
"description": "Generate new access token using refresh token",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "x-refresh-token",
|
|
||||||
"in": "header",
|
|
||||||
"description": "Refresh token",
|
|
||||||
"required": true,
|
|
||||||
"schema": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "authorization",
|
|
||||||
"in": "header",
|
|
||||||
"description": "Bearer token (old access token)",
|
|
||||||
"required": true,
|
|
||||||
"schema": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "Token refreshed successfully",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/components/schemas/AuthResponse"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"401": {
|
|
||||||
"$ref": "#/components/responses/Unauthorized"
|
|
||||||
},
|
|
||||||
"500": {
|
|
||||||
"$ref": "#/components/responses/InternalServerError"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/auth/user/{userId}": {
|
"/auth/user/{userId}": {
|
||||||
"put": {
|
"put": {
|
||||||
"tags": ["auth"],
|
"tags": ["auth"],
|
||||||
@@ -1362,6 +1317,39 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/notifications": {
|
"/notifications": {
|
||||||
|
"post": {
|
||||||
|
"tags": ["notifications"],
|
||||||
|
"summary": "Create notification",
|
||||||
|
"description": "Create a new notification integration",
|
||||||
|
"requestBody": {
|
||||||
|
"required": true,
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/CreateNotificationRequest"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"responses": {
|
||||||
|
"201": {
|
||||||
|
"description": "Notification created successfully"
|
||||||
|
},
|
||||||
|
"422": {
|
||||||
|
"$ref": "#/components/responses/ValidationError"
|
||||||
|
},
|
||||||
|
"500": {
|
||||||
|
"$ref": "#/components/responses/InternalServerError"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"bearerAuth": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/notifications/team": {
|
||||||
"get": {
|
"get": {
|
||||||
"tags": ["notifications"],
|
"tags": ["notifications"],
|
||||||
"summary": "Get team notifications",
|
"summary": "Get team notifications",
|
||||||
@@ -1401,37 +1389,6 @@
|
|||||||
"bearerAuth": []
|
"bearerAuth": []
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
|
||||||
"post": {
|
|
||||||
"tags": ["notifications"],
|
|
||||||
"summary": "Create notification",
|
|
||||||
"description": "Create a new notification integration",
|
|
||||||
"requestBody": {
|
|
||||||
"required": true,
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/components/schemas/CreateNotificationRequest"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"responses": {
|
|
||||||
"201": {
|
|
||||||
"description": "Notification created successfully"
|
|
||||||
},
|
|
||||||
"422": {
|
|
||||||
"$ref": "#/components/responses/ValidationError"
|
|
||||||
},
|
|
||||||
"500": {
|
|
||||||
"$ref": "#/components/responses/InternalServerError"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"security": [
|
|
||||||
{
|
|
||||||
"bearerAuth": []
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/notifications/{id}": {
|
"/notifications/{id}": {
|
||||||
@@ -1822,6 +1779,64 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/auth/users/{userId}/password": {
|
||||||
|
"put": {
|
||||||
|
"tags": ["auth"],
|
||||||
|
"summary": "Update user password by ID",
|
||||||
|
"description": "Update a specific user's password by ID (superadmin only)",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "userId",
|
||||||
|
"in": "path",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"requestBody": {
|
||||||
|
"required": true,
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"type": "object",
|
||||||
|
"required": ["password"],
|
||||||
|
"properties": {
|
||||||
|
"password": {
|
||||||
|
"type": "string",
|
||||||
|
"format": "password",
|
||||||
|
"minLength": 8,
|
||||||
|
"description": "New password for the user"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"$ref": "#/components/responses/Success"
|
||||||
|
},
|
||||||
|
"404": {
|
||||||
|
"$ref": "#/components/responses/NotFound"
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"$ref": "#/components/responses/Forbidden"
|
||||||
|
},
|
||||||
|
"422": {
|
||||||
|
"$ref": "#/components/responses/ValidationError"
|
||||||
|
},
|
||||||
|
"500": {
|
||||||
|
"$ref": "#/components/responses/InternalServerError"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"bearerAuth": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
"/invite": {
|
"/invite": {
|
||||||
"post": {
|
"post": {
|
||||||
"tags": ["invite"],
|
"tags": ["invite"],
|
||||||
@@ -4096,9 +4111,8 @@
|
|||||||
"description": "When the incident started"
|
"description": "When the incident started"
|
||||||
},
|
},
|
||||||
"endTime": {
|
"endTime": {
|
||||||
"type": "string",
|
"type": ["string", "null"],
|
||||||
"format": "date-time",
|
"format": "date-time",
|
||||||
"nullable": true,
|
|
||||||
"description": "When the incident was resolved (null if ongoing)"
|
"description": "When the incident was resolved (null if ongoing)"
|
||||||
},
|
},
|
||||||
"status": {
|
"status": {
|
||||||
@@ -4106,29 +4120,24 @@
|
|||||||
"description": "Incident status (true = ongoing, false = resolved)"
|
"description": "Incident status (true = ongoing, false = resolved)"
|
||||||
},
|
},
|
||||||
"message": {
|
"message": {
|
||||||
"type": "string",
|
"type": ["string", "null"],
|
||||||
"nullable": true,
|
|
||||||
"description": "Error message or description"
|
"description": "Error message or description"
|
||||||
},
|
},
|
||||||
"statusCode": {
|
"statusCode": {
|
||||||
"type": "integer",
|
"type": ["integer", "null"],
|
||||||
"nullable": true,
|
|
||||||
"description": "HTTP status code if applicable"
|
"description": "HTTP status code if applicable"
|
||||||
},
|
},
|
||||||
"resolutionType": {
|
"resolutionType": {
|
||||||
"type": "string",
|
"type": ["string", "null"],
|
||||||
"enum": ["automatic", "manual"],
|
"enum": ["automatic", "manual", null],
|
||||||
"nullable": true,
|
|
||||||
"description": "How the incident was resolved"
|
"description": "How the incident was resolved"
|
||||||
},
|
},
|
||||||
"resolvedBy": {
|
"resolvedBy": {
|
||||||
"type": "string",
|
"type": ["string", "null"],
|
||||||
"nullable": true,
|
|
||||||
"description": "User ID who resolved the incident (for manual resolution)"
|
"description": "User ID who resolved the incident (for manual resolution)"
|
||||||
},
|
},
|
||||||
"comment": {
|
"comment": {
|
||||||
"type": "string",
|
"type": ["string", "null"],
|
||||||
"nullable": true,
|
|
||||||
"description": "Resolution comment"
|
"description": "Resolution comment"
|
||||||
},
|
},
|
||||||
"checks": {
|
"checks": {
|
||||||
@@ -4220,15 +4229,13 @@
|
|||||||
"description": "When the job was created"
|
"description": "When the job was created"
|
||||||
},
|
},
|
||||||
"processedOn": {
|
"processedOn": {
|
||||||
"type": "string",
|
"type": ["string", "null"],
|
||||||
"format": "date-time",
|
"format": "date-time",
|
||||||
"nullable": true,
|
|
||||||
"description": "When the job started processing"
|
"description": "When the job started processing"
|
||||||
},
|
},
|
||||||
"finishedOn": {
|
"finishedOn": {
|
||||||
"type": "string",
|
"type": ["string", "null"],
|
||||||
"format": "date-time",
|
"format": "date-time",
|
||||||
"nullable": true,
|
|
||||||
"description": "When the job finished"
|
"description": "When the job finished"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4358,9 +4365,8 @@
|
|||||||
"description": "Whether the check has been acknowledged"
|
"description": "Whether the check has been acknowledged"
|
||||||
},
|
},
|
||||||
"ackAt": {
|
"ackAt": {
|
||||||
"type": "string",
|
"type": ["string", "null"],
|
||||||
"format": "date-time",
|
"format": "date-time",
|
||||||
"nullable": true,
|
|
||||||
"description": "When the check was acknowledged"
|
"description": "When the check was acknowledged"
|
||||||
},
|
},
|
||||||
"expiry": {
|
"expiry": {
|
||||||
|
|||||||
Reference in new issue
Block a user