Skip to content

Commit 84703aa

Browse files
authored
openapi3: empty scopes are valid (#754)
1 parent a3a19f0 commit 84703aa

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

openapi3/security_scheme.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,8 @@ func (flow *OAuthFlow) Validate(ctx context.Context, opts ...ValidationOption) e
363363
}
364364
}
365365

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

370370
return validateExtensions(ctx, flow.Extensions)

openapi3/security_scheme_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ var securitySchemeExamples = []securitySchemeExample{
197197
}
198198
}
199199
}`),
200-
valid: false,
200+
valid: true,
201201
},
202202

203203
{

0 commit comments

Comments
 (0)