1
0
mirror of https://github.com/axllent/mailpit.git synced 2025-01-06 00:25:39 +02:00

Swagger: Update swagger field descriptions, add MessageID

This commit is contained in:
Ralph Slooten 2023-05-30 16:52:39 +12:00
parent 3d96b2cad0
commit db5d8f672a
4 changed files with 35 additions and 27 deletions

View File

@ -147,7 +147,7 @@ func GetMessage(w http.ResponseWriter, r *http.Request) {
// Parameters:
// + name: ID
// in: path
// description: Message ID
// description: Database ID
// required: true
// type: string
//
@ -188,7 +188,7 @@ func DownloadAttachment(w http.ResponseWriter, r *http.Request) {
// Parameters:
// + name: ID
// in: path
// description: Message ID
// description: Database ID
// required: true
// type: string
// + name: PartID
@ -237,7 +237,7 @@ func GetHeaders(w http.ResponseWriter, r *http.Request) {
// Parameters:
// + name: ID
// in: path
// description: Message ID
// description: Database ID
// required: true
// type: string
//
@ -284,7 +284,7 @@ func DownloadRaw(w http.ResponseWriter, r *http.Request) {
// Parameters:
// + name: ID
// in: path
// description: Message ID
// description: Database ID
// required: true
// type: string
//
@ -330,7 +330,7 @@ func DeleteMessages(w http.ResponseWriter, r *http.Request) {
// Parameters:
// + name: ids
// in: body
// description: Message IDs to delete
// description: Database IDs to delete
// required: false
// type: DeleteRequest
//
@ -381,7 +381,7 @@ func SetReadStatus(w http.ResponseWriter, r *http.Request) {
// Parameters:
// + name: ids
// in: body
// description: Message IDs to update
// description: Database IDs to update
// required: false
// type: SetReadStatusRequest
//
@ -459,7 +459,7 @@ func SetTags(w http.ResponseWriter, r *http.Request) {
// Parameters:
// + name: ids
// in: body
// description: Message IDs to update
// description: Database IDs to update
// required: true
// type: SetTagsRequest
//
@ -502,7 +502,7 @@ func ReleaseMessage(w http.ResponseWriter, r *http.Request) {
//
// # Release message
//
// Release a message via a preconfigured external SMTP server..
// Release a message via a pre-configured external SMTP server..
//
// Consumes:
// - application/json
@ -515,7 +515,7 @@ func ReleaseMessage(w http.ResponseWriter, r *http.Request) {
// Parameters:
// + name: ID
// in: path
// description: Message ID
// description: Database ID
// required: true
// type: string
// + name: to

View File

@ -39,12 +39,12 @@ func Thumbnail(w http.ResponseWriter, r *http.Request) {
// Parameters:
// + name: ID
// in: path
// description: message id
// description: Database ID
// required: true
// type: string
// + name: PartID
// in: path
// description: attachment part id
// description: Attachment part ID
// required: true
// type: string
//

View File

@ -66,7 +66,7 @@
"parameters": [
{
"type": "string",
"description": "Message ID",
"description": "Database ID",
"name": "ID",
"in": "path",
"required": true
@ -103,7 +103,7 @@
"parameters": [
{
"type": "string",
"description": "Message ID",
"description": "Database ID",
"name": "ID",
"in": "path",
"required": true
@ -142,7 +142,7 @@
"parameters": [
{
"type": "string",
"description": "Message ID",
"description": "Database ID",
"name": "ID",
"in": "path",
"required": true
@ -183,14 +183,14 @@
"parameters": [
{
"type": "string",
"description": "message id",
"description": "Database ID",
"name": "ID",
"in": "path",
"required": true
},
{
"type": "string",
"description": "attachment part id",
"description": "Attachment part ID",
"name": "PartID",
"in": "path",
"required": true
@ -224,7 +224,7 @@
"parameters": [
{
"type": "string",
"description": "Message ID",
"description": "Database ID",
"name": "ID",
"in": "path",
"required": true
@ -242,7 +242,7 @@
},
"/api/v1/message/{ID}/release": {
"post": {
"description": "Release a message via a preconfigured external SMTP server..",
"description": "Release a message via a pre-configured external SMTP server..",
"consumes": [
"application/json"
],
@ -261,7 +261,7 @@
"parameters": [
{
"type": "string",
"description": "Message ID",
"description": "Database ID",
"name": "ID",
"in": "path",
"required": true
@ -347,11 +347,11 @@
"operationId": "SetReadStatus",
"parameters": [
{
"description": "Message IDs to update",
"description": "Database IDs to update",
"name": "ids",
"in": "body",
"schema": {
"description": "Message IDs to update",
"description": "Database IDs to update",
"type": "object",
"$ref": "#/definitions/SetReadStatusRequest"
}
@ -385,11 +385,11 @@
"operationId": "Delete",
"parameters": [
{
"description": "Message IDs to delete",
"description": "Database IDs to delete",
"name": "ids",
"in": "body",
"schema": {
"description": "Message IDs to delete",
"description": "Database IDs to delete",
"type": "object",
"$ref": "#/definitions/DeleteRequest"
}
@ -466,12 +466,12 @@
"operationId": "SetTags",
"parameters": [
{
"description": "Message IDs to update",
"description": "Database IDs to update",
"name": "ids",
"in": "body",
"required": true,
"schema": {
"description": "Message IDs to update",
"description": "Database IDs to update",
"type": "object",
"$ref": "#/definitions/SetTagsRequest"
}
@ -751,6 +751,10 @@
"description": "Database ID",
"type": "string"
},
"MessageID": {
"description": "Message ID",
"type": "string"
},
"Read": {
"description": "Read status",
"type": "boolean"
@ -901,6 +905,10 @@
"description": "Whether message relaying (release) is enabled",
"type": "boolean"
},
"RecipientAllowlist": {
"description": "Allowlist of accepted recipients",
"type": "string"
},
"ReturnPath": {
"description": "Enforced Return-Path (if set) for relay bounces",
"type": "string"

View File

@ -12,7 +12,7 @@ import (
"github.com/leporo/sqlf"
)
// SetTags will set the tags for a given message ID, used via API
// SetTags will set the tags for a given database ID, used via API
func SetTags(id string, tags []string) error {
applyTags := []string{}
reg := regexp.MustCompile(`\s+`)
@ -61,7 +61,7 @@ func findTags(message *[]byte) []string {
return tags
}
// Get message tags from the database for a given message ID.
// Get message tags from the database for a given database ID
// Used when parsing a raw email.
func getMessageTags(id string) []string {
tags := []string{}