Skip to content

Commit

Permalink
Chore: Update API documentation regarding date/time searches & timezones
Browse files Browse the repository at this point in the history
  • Loading branch information
axllent committed Apr 14, 2024
1 parent 9e527ad commit 8da8a1a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
11 changes: 8 additions & 3 deletions server/apiv1/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func Search(w http.ResponseWriter, r *http.Request) {
//
// # Search messages
//
// Returns the latest messages matching a search.
// Returns messages matching [a search](https://mailpit.axllent.org/docs/usage/search-filters/), sorted by received date (descending).
//
// Produces:
// - application/json
Expand All @@ -111,7 +111,7 @@ func Search(w http.ResponseWriter, r *http.Request) {
// default: 50
// + name: tz
// in: query
// description: Timezone for `before:` & `after:` queries, eg: "Pacific/Auckland"
// description: [Timezone identifier](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) used specifically for `before:` & `after:` searches (eg: "Pacific/Auckland").
// required: false
// type: string
//
Expand Down Expand Up @@ -155,7 +155,7 @@ func DeleteSearch(w http.ResponseWriter, r *http.Request) {
//
// # Delete messages by search
//
// Delete all messages matching a search.
// Delete all messages matching [a search](https://mailpit.axllent.org/docs/usage/search-filters/).
//
// Produces:
// - application/json
Expand All @@ -168,6 +168,11 @@ func DeleteSearch(w http.ResponseWriter, r *http.Request) {
// description: Search query
// required: true
// type: string
// + name: tz
// in: query
// description: [Timezone identifier](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) used specifically for `before:` & `after:` searches (eg: "Pacific/Auckland").
// required: false
// type: string
//
// Responses:
// 200: OKResponse
Expand Down
12 changes: 9 additions & 3 deletions server/ui/api/v1/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@
},
"/api/v1/search": {
"get": {
"description": "Returns the latest messages matching a search.",
"description": "Returns messages matching [a search](https://mailpit.axllent.org/docs/usage/search-filters/), sorted by received date (descending).",
"produces": [
"application/json"
],
Expand Down Expand Up @@ -553,7 +553,7 @@
},
{
"type": "string",
"description": "Timezone for `before:` \u0026 `after:` queries, eg: \"Pacific/Auckland\"",
"description": "[Timezone identifier](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) used specifically for `before:` \u0026 `after:` searches (eg: \"Pacific/Auckland\").",
"name": "tz",
"in": "query"
}
Expand All @@ -568,7 +568,7 @@
}
},
"delete": {
"description": "Delete all messages matching a search.",
"description": "Delete all messages matching [a search](https://mailpit.axllent.org/docs/usage/search-filters/).",
"produces": [
"application/json"
],
Expand All @@ -588,6 +588,12 @@
"name": "query",
"in": "query",
"required": true
},
{
"type": "string",
"description": "[Timezone identifier](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) used specifically for `before:` \u0026 `after:` searches (eg: \"Pacific/Auckland\").",
"name": "tz",
"in": "query"
}
],
"responses": {
Expand Down

0 comments on commit 8da8a1a

Please sign in to comment.