Skip to content

Commit d7af249

Browse files
authored
Add url validate case to return InvalidParameterError (#301)
1 parent 0e7d807 commit d7af249

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pkg/service/json.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,8 @@ func ValidateStruct(ctx context.Context, obj interface{}) error {
207207
switch ruleName {
208208
case "email":
209209
return NewInvalidParameterError(fieldName, "must be a valid email")
210+
case "url":
211+
return NewInvalidParameterError(fieldName, "must be a valid url")
210212
case "max":
211213
return NewInvalidParameterError(fieldName, fmt.Sprintf("must be less than %s", validationRules[ruleName]))
212214
case "min":

0 commit comments

Comments
 (0)