1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-17 17:47:03 +00:00

REST APIv1 now uses lowercase JSON property names

- Updated rest-apiv1.sh to pretty print JSON with jq if available
- Fixed some missing checks on JSON testutils
This commit is contained in:
James Hillyerd
2016-02-25 19:21:47 -08:00
parent 5da5d3e509
commit f36e21a65c
4 changed files with 76 additions and 58 deletions

View File

@@ -14,30 +14,30 @@ import (
// JSONMessageHeaderV1 contains the basic header data for a message
type JSONMessageHeaderV1 struct {
Mailbox string
ID string `json:"Id"`
From string
Subject string
Date time.Time
Size int64
Mailbox string `json:"mailbox"`
ID string `json:"id"`
From string `json:"from"`
Subject string `json:"subject"`
Date time.Time `json:"date"`
Size int64 `json:"size"`
}
// JSONMessageV1 contains the same data as the header plus a JSONMessageBody
type JSONMessageV1 struct {
Mailbox string
ID string `json:"Id"`
From string
Subject string
Date time.Time
Size int64
Body *JSONMessageBodyV1
Header mail.Header
Mailbox string `json:"mailbox"`
ID string `json:"id"`
From string `json:"from"`
Subject string `json:"subject"`
Date time.Time `json:"date"`
Size int64 `json:"size"`
Body *JSONMessageBodyV1 `json:"body"`
Header mail.Header `json:"header"`
}
// JSONMessageBodyV1 contains the Text and HTML versions of the message body
type JSONMessageBodyV1 struct {
Text string
HTML string `json:"Html"`
Text string `json:"text"`
HTML string `json:"html"`
}
// MailboxListV1 renders a list of messages in a mailbox