Feat(user): Added swagger examples
All checks were successful
ktm-booking-bot/ktm-booking-bot/pipeline/head This commit looks good

This commit is contained in:
2022-09-27 04:23:12 +08:00
parent e99182da51
commit 252dfbffd6
4 changed files with 36 additions and 18 deletions

View File

@@ -505,22 +505,28 @@ const docTemplate = `{
"type": "object",
"properties": {
"ktmTrainCreditCard": {
"type": "string"
"type": "string",
"example": "1234123412341234"
},
"ktmTrainCreditCardCVV": {
"type": "string"
"type": "string",
"example": "123"
},
"ktmTrainCreditCardExpiry": {
"type": "string"
"type": "string",
"example": "01/2022"
},
"ktmTrainCreditCardType": {
"type": "string"
"type": "string",
"example": "Visa|Mastercard"
},
"ktmTrainPassword": {
"type": "string"
"type": "string",
"example": "password"
},
"ktmTrainUsername": {
"type": "string"
"type": "string",
"example": "user@gmail.com"
}
}
},

View File

@@ -497,22 +497,28 @@
"type": "object",
"properties": {
"ktmTrainCreditCard": {
"type": "string"
"type": "string",
"example": "1234123412341234"
},
"ktmTrainCreditCardCVV": {
"type": "string"
"type": "string",
"example": "123"
},
"ktmTrainCreditCardExpiry": {
"type": "string"
"type": "string",
"example": "01/2022"
},
"ktmTrainCreditCardType": {
"type": "string"
"type": "string",
"example": "Visa|Mastercard"
},
"ktmTrainPassword": {
"type": "string"
"type": "string",
"example": "password"
},
"ktmTrainUsername": {
"type": "string"
"type": "string",
"example": "user@gmail.com"
}
}
},

View File

@@ -80,16 +80,22 @@ definitions:
user.ProfileRequest:
properties:
ktmTrainCreditCard:
example: "1234123412341234"
type: string
ktmTrainCreditCardCVV:
example: "123"
type: string
ktmTrainCreditCardExpiry:
example: 01/2022
type: string
ktmTrainCreditCardType:
example: Visa|Mastercard
type: string
ktmTrainPassword:
example: password
type: string
ktmTrainUsername:
example: user@gmail.com
type: string
type: object
user.ProfileResponse:

View File

@@ -22,12 +22,12 @@ type Profile struct {
}
type ProfileRequest struct {
KtmTrainUsername string `json:"ktmTrainUsername"`
KtmTrainPassword string `json:"ktmTrainPassword"`
KtmTrainCreditCardType string `json:"ktmTrainCreditCardType"`
KtmTrainCreditCard string `json:"ktmTrainCreditCard"`
KtmTrainCreditCardExpiry string `json:"ktmTrainCreditCardExpiry"`
KtmTrainCreditCardCVV string `json:"ktmTrainCreditCardCVV"`
KtmTrainUsername string `json:"ktmTrainUsername" swaggertype:"string" example:"user@gmail.com"`
KtmTrainPassword string `json:"ktmTrainPassword" swaggertype:"string" example:"password"`
KtmTrainCreditCardType string `json:"ktmTrainCreditCardType" swaggertype:"string" example:"Visa|Mastercard"`
KtmTrainCreditCard string `json:"ktmTrainCreditCard" swaggertype:"string" example:"1234123412341234"`
KtmTrainCreditCardExpiry string `json:"ktmTrainCreditCardExpiry" swaggertype:"string" example:"01/2022"`
KtmTrainCreditCardCVV string `json:"ktmTrainCreditCardCVV" swaggertype:"string" example:"123"`
}
type ProfileResponse struct {