Skip to content

Commit 37dd4c0

Browse files
committed
Add examples for attachments in swagger doc
1 parent 38b5b04 commit 37dd4c0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

api/pkg/entities/message.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ type Message struct {
9090
UserID UserID `json:"user_id" gorm:"index:idx_messages__user_id" example:"WB7DRDWrJZRGbYrv2CKGkqbzvqdC"`
9191
Contact string `json:"contact" example:"+18005550100"`
9292
Content string `json:"content" example:"This is a sample text message"`
93-
Attachments pq.StringArray `json:"attachments" gorm:"type:text[]" swaggertype:"array,string"`
93+
Attachments pq.StringArray `json:"attachments" gorm:"type:text[]" swaggertype:"array,string" example:"https://example.com/image.jpg,https://example.com/video.mp4"`
9494
Encrypted bool `json:"encrypted" example:"false" gorm:"default:false"`
9595
Type MessageType `json:"type" example:"mobile-terminated"`
9696
Status MessageStatus `json:"status" example:"pending"`

api/pkg/requests/message_send_request.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type MessageSend struct {
1919
Content string `json:"content" example:"This is a sample text message"`
2020

2121
// Attachments are optional. When you provide a list of attachments, the message will be sent out as an MMS
22-
Attachments []string `json:"attachments" validate:"optional"`
22+
Attachments []string `json:"attachments" validate:"optional" example:"https://example.com/image.jpg,https://example.com/video.mp4"`
2323

2424
// Encrypted is an optional parameter used to determine if the content is end-to-end encrypted. Make sure to set the encryption key on the httpSMS mobile app
2525
Encrypted bool `json:"encrypted" example:"false" validate:"optional"`

0 commit comments

Comments
 (0)