Skip to content

Commit

Permalink
Merge 651fd82 into 08348d0
Browse files Browse the repository at this point in the history
  • Loading branch information
daemonfire300 committed Jan 8, 2021
2 parents 08348d0 + 651fd82 commit 8ef991a
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 1 deletion.
6 changes: 5 additions & 1 deletion http/jsonapi/generator/generate_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ func (g *typeGenerator) invoke() error { // nolint: gocyclo
}
case "date":
addValidator(g.tags, "time(2006-01-02)")
g.stmt.Qual("time", "Time")
if g.isParam {
g.stmt.Qual("time", "Time")
} else {
g.stmt.Op("*").Qual("time", "Time") // time.Time can not be nil, so a pointer is needed for omitempty to work
}
case "uuid":
addValidator(g.tags, "uuid")
g.stmt.String()
Expand Down
32 changes: 32 additions & 0 deletions http/jsonapi/generator/internal/pay/open-api.json
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,38 @@
}
}
},
"PaymentMethod": {
"type": "object",
"properties": {
"data": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"paymentMethod"
]
},
"id": {
"type": "string",
"description": "Payment Method ID",
"example": "ae8d0b2cca500ef9d2fe65cfa5725e64"
},
"attributes": {
"type": "object",
"properties": {
"expiry": {
"type": "string",
"format": "date",
"description": "Expiry date",
"example": "2006-01-02"
}
}
}
}
}
}
},
"PaymentMethodsWithPaymentTokens": {
"type": "object",
"properties": {
Expand Down
7 changes: 7 additions & 0 deletions http/jsonapi/generator/internal/pay/open-api_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8ef991a

Please sign in to comment.