Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions httperror/http_error.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ import (
"github.com/labstack/echo/v4"
)

// swagger:model JSONError
type JSONError struct {
Code string `json:"code"`
Message string `json:"message"`
Details *Details `json:"details,omitempty"`
}

// swagger:model JSONErrorDetails
type Details struct {
Params *validator.InvalidParams `json:"invalidParams,omitempty"`
}
Expand Down
2 changes: 2 additions & 0 deletions validator/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ var tagsMessage = map[string]string{
"numeric": "must be a valid numeric value",
}

// swagger:model InvalidParamError
type InvalidParamError struct {
Param string `json:"param"`
Value any `json:"value"`
ExpectedType string `json:"expectedType"`
Message string `json:"message"`
}

// swagger:model InvalidParams
type InvalidParams []InvalidParamError

type Validator struct {
Expand Down