Skip to content

Commit

Permalink
openapi3: empty scopes are valid (#754)
Browse files Browse the repository at this point in the history
  • Loading branch information
nodar963 committed Jan 28, 2023
1 parent a3a19f0 commit 84703aa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions openapi3/security_scheme.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,8 @@ func (flow *OAuthFlow) Validate(ctx context.Context, opts ...ValidationOption) e
}
}

if v := flow.Scopes; len(v) == 0 {
return errors.New("field 'scopes' is empty or missing")
if flow.Scopes == nil {
return errors.New("field 'scopes' is missing")
}

return validateExtensions(ctx, flow.Extensions)
Expand Down
2 changes: 1 addition & 1 deletion openapi3/security_scheme_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ var securitySchemeExamples = []securitySchemeExample{
}
}
}`),
valid: false,
valid: true,
},

{
Expand Down

0 comments on commit 84703aa

Please sign in to comment.