Skip to content

Commit

Permalink
testdata/alias_import: add test for embedded field
Browse files Browse the repository at this point in the history
  • Loading branch information
ShoshinNikita committed Apr 10, 2020
1 parent 3b82b47 commit 4c502aa
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions testdata/alias_import/data/applicationresponse.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
)

type ApplicationResponse struct {
typesapplication.TypeToEmbed

Application typesapplication.Application `json:"application"`
ApplicationArray []typesapplication.Application `json:"application_array"`
ApplicationTime typesapplication.DateOnly `json:"application_time"`
Expand Down
3 changes: 3 additions & 0 deletions testdata/alias_import/expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@
},
"application_time": {
"type": "string"
},
"embedded": {
"type": "string"
}
}
},
Expand Down
4 changes: 4 additions & 0 deletions testdata/alias_import/types/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ type Application struct {
}

type DateOnly time.Time

type TypeToEmbed struct {
Embedded string
}

0 comments on commit 4c502aa

Please sign in to comment.