Skip to content

Commit

Permalink
Explicited time.Time behaviour for OpenAPI declaration (#397)
Browse files Browse the repository at this point in the history
* Fixing time.Time behaviour in Pet model

* example: Renamed BornDate to BirthDate
  • Loading branch information
EwenQuim committed Feb 12, 2025
1 parent 88013a3 commit fbb6506
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions examples/petstore/lib/testdata/doc/openapi.golden.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
"example": 2,
"type": "integer"
},
"birth_date": {
"format": "date-time",
"type": "string"
},
"id": {
"example": "pet-123456",
"type": "string"
Expand Down Expand Up @@ -62,6 +66,10 @@
"example": 2,
"type": "integer"
},
"birth_date": {
"format": "date-time",
"type": "string"
},
"id": {
"example": "pet-123456",
"type": "string"
Expand Down Expand Up @@ -161,6 +169,10 @@
"example": 2,
"type": "integer"
},
"birth_date": {
"format": "date-time",
"type": "string"
},
"id": {
"example": "pet-123456",
"type": "string"
Expand Down
2 changes: 2 additions & 0 deletions examples/petstore/models/Pet.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package models
import (
"context"
"errors"
"time"

"github.com/go-fuego/fuego"
)
Expand All @@ -20,6 +21,7 @@ type Pets struct {
Age int `json:"age" example:"2" description:"Age of the pet, in years"`
IsAdopted bool `json:"is_adopted" description:"Is the pet adopted"`
References References `json:"references"`
BirthDate time.Time `json:"birth_date"`
}

type PetsCreate struct {
Expand Down

0 comments on commit fbb6506

Please sign in to comment.