Skip to content

Commit

Permalink
fix: time unmarshalling (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
rriski authored Feb 9, 2024
1 parent 21a0508 commit 85363c9
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 15 deletions.
1 change: 1 addition & 0 deletions generator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ func exec() error {
}

ifErr := jen.If(jen.Err().Op("!=").Nil()).Block(returnErr)

if rsp == nil {
block = append(block, jen.Return(jen.Err()))
} else {
Expand Down
5 changes: 3 additions & 2 deletions generator/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,9 @@ func (s *Schema) init(doc *Doc, scope map[string]*Schema, name string) {

if s.Type == SchemaTypeString {
parts := strings.Split(s.name, "_")
switch parts[len(parts)-1] {
case "at", "time":
suffix := parts[len(parts)-1]

if len(parts) > 1 && (suffix == "at" || suffix == "time") {
s.Type = SchemaTypeTime
}
}
Expand Down
12 changes: 6 additions & 6 deletions handler/project/project.go

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

12 changes: 6 additions & 6 deletions handler/service/service.go

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

2 changes: 1 addition & 1 deletion handler/serviceuser/serviceuser.go

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

0 comments on commit 85363c9

Please sign in to comment.