-
-
Notifications
You must be signed in to change notification settings - Fork 358
feat: add get-campaigns docs #351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -1707,6 +1707,92 @@ | |||||||||
| } | ||||||||||
| }, | ||||||||||
| "/v1/campaigns": { | ||||||||||
| "get": { | ||||||||||
| "parameters": [ | ||||||||||
| { | ||||||||||
| "schema": { "type": "string", "default": "1", "example": "1" }, | ||||||||||
| "required": false, | ||||||||||
| "name": "page", | ||||||||||
| "in": "query", | ||||||||||
| "description": "Page number for pagination (default: 1)" | ||||||||||
| }, | ||||||||||
| { | ||||||||||
| "schema": { | ||||||||||
| "type": "string", | ||||||||||
| "enum": [ | ||||||||||
| "DRAFT", | ||||||||||
| "SCHEDULED", | ||||||||||
| "IN_PROGRESS", | ||||||||||
| "PAUSED", | ||||||||||
| "COMPLETED", | ||||||||||
| "CANCELLED" | ||||||||||
| ], | ||||||||||
| "example": "DRAFT" | ||||||||||
| }, | ||||||||||
| "required": false, | ||||||||||
| "name": "status", | ||||||||||
| "in": "query", | ||||||||||
| "description": "Filter campaigns by status" | ||||||||||
| }, | ||||||||||
| { | ||||||||||
| "schema": { "type": "string", "example": "newsletter" }, | ||||||||||
| "required": false, | ||||||||||
| "name": "search", | ||||||||||
| "in": "query", | ||||||||||
| "description": "Search campaigns by name or subject" | ||||||||||
| } | ||||||||||
| ], | ||||||||||
| "responses": { | ||||||||||
| "200": { | ||||||||||
| "description": "Get list of campaigns", | ||||||||||
| "content": { | ||||||||||
| "application/json": { | ||||||||||
| "schema": { | ||||||||||
| "type": "object", | ||||||||||
| "properties": { | ||||||||||
| "campaigns": { | ||||||||||
| "type": "array", | ||||||||||
| "items": { | ||||||||||
| "type": "object", | ||||||||||
| "properties": { | ||||||||||
| "id": { "type": "string" }, | ||||||||||
| "name": { "type": "string" }, | ||||||||||
| "from": { "type": "string" }, | ||||||||||
| "subject": { "type": "string" }, | ||||||||||
| "createdAt": { "type": "string", "format": "date-time" }, | ||||||||||
| "updatedAt": { "type": "string", "format": "date-time" }, | ||||||||||
| "status": { "type": "string" }, | ||||||||||
| "scheduledAt": { "type": "string", "nullable": true, "format": "date-time" }, | ||||||||||
| "total": { "type": "integer" }, | ||||||||||
|
Comment on lines
+1764
to
+1766
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Enum missing for status In the 200 response schema, each campaign’s
Suggested change
|
||||||||||
| "sent": { "type": "integer" }, | ||||||||||
| "delivered": { "type": "integer" }, | ||||||||||
| "unsubscribed": { "type": "integer" } | ||||||||||
| }, | ||||||||||
| "required": [ | ||||||||||
| "id", | ||||||||||
| "name", | ||||||||||
| "from", | ||||||||||
| "subject", | ||||||||||
| "createdAt", | ||||||||||
| "updatedAt", | ||||||||||
| "status", | ||||||||||
| "scheduledAt", | ||||||||||
| "total", | ||||||||||
| "sent", | ||||||||||
| "delivered", | ||||||||||
| "unsubscribed" | ||||||||||
| ] | ||||||||||
| } | ||||||||||
| }, | ||||||||||
| "totalPage": { "type": "integer" } | ||||||||||
| }, | ||||||||||
| "required": ["campaigns", "totalPage"] | ||||||||||
| } | ||||||||||
| } | ||||||||||
| } | ||||||||||
| } | ||||||||||
| } | ||||||||||
| }, | ||||||||||
| "post": { | ||||||||||
| "requestBody": { | ||||||||||
| "required": true, | ||||||||||
|
|
||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong type for
pagepageis documented as a string ({"type":"string","default":"1"}), but it represents a page number. This will generate incorrect client types and allows non-numeric values. It should be an integer (optionally withminimum: 1) and defaults/examples should be numeric.