Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
Signed-off-by: Alvaro Frias Garay <alvarofriasgaray@gmail.com>
  • Loading branch information
qequ committed May 14, 2024
1 parent 9953010 commit d221446
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion integration_test/test_data/handler/restaurants.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func GetRestaurants() {
// @param commodityGroup query string false "Use as filter.commodityGroup! Commodity Group"
// @param isDigitalScreen query string false "Use as filter.isDigitalScreen! IsDigitalScreen. Can be: true, false"
// @success 200 {object} GetPogsResponse
// @failure 400 {object} ValidationError
// @failure 400 {object} aliasValidationError
// @failure 404 {object} ErrResponse
// @failure 500 {object} ErrResponse
// @route assortment/planogram [get]
Expand All @@ -37,6 +37,9 @@ type GetPogsResponse struct {
Planograms []int `json:"planograms"`
}

// make a type alias of ValidationError
type aliasValidationError = ValidationError

type ValidationError struct {
StatusCode int `json:"statusCode" xml:"statusCode"`
Errors []error `json:"errors" xml:"errors"`
Expand Down
4 changes: 2 additions & 2 deletions integration_test/test_data/spec/expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ValidationError"
"$ref": "#/components/schemas/aliasValidationError"
}
}
}
Expand Down Expand Up @@ -489,7 +489,7 @@
}
}
},
"ValidationError": {
"aliasValidationError": {
"type": "object",
"properties": {
"statusCode": {
Expand Down
4 changes: 2 additions & 2 deletions integration_test/test_data/spec/expected_with_pkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/github.com.parvez3019.go-swagger3.handler.ValidationError"
"$ref": "#/components/schemas/github.com.parvez3019.go-swagger3.handler.aliasValidationError"
}
}
}
Expand Down Expand Up @@ -382,7 +382,7 @@
}
}
},
"github.com.parvez3019.go-swagger3.handler.ValidationError": {
"github.com.parvez3019.go-swagger3.handler.aliasValidationError": {
"type": "object",
"properties": {
"statusCode": {
Expand Down

0 comments on commit d221446

Please sign in to comment.