Skip to content

Commit

Permalink
Fix once again oneOf constraint for HTTP Bearer scheme (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
vearutop authored Mar 5, 2024
1 parent 7eb17ad commit eebc1f6
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
21 changes: 21 additions & 0 deletions openapi3/entities_extra_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,24 @@ paths:

require.NoError(t, s.UnmarshalYAML([]byte(spec)))
}

func TestSpec_MarshalYAML_3(t *testing.T) {
var s openapi3.Spec

spec := `openapi: 3.0.3
info:
title: MyProject
description: "My Project Description"
version: v1.0.0
components:
securitySchemes:
basicAuth: # <-- arbitrary name for the security scheme
type: http
scheme: basic
security:
- basicAuth: [] # <-- use the same name here
paths:
`

require.NoError(t, s.UnmarshalYAML([]byte(spec)))
}
4 changes: 4 additions & 0 deletions openapi31/entities.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions openapi31/entities_extra_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,24 @@ paths:

require.NoError(t, s.UnmarshalYAML([]byte(spec)))
}

func TestSpec_MarshalYAML_3(t *testing.T) {
var s openapi31.Spec

spec := `openapi: 3.1.0
info:
title: MyProject
description: "My Project Description"
version: v1.0.0
components:
securitySchemes:
basicAuth: # <-- arbitrary name for the security scheme
type: http
scheme: basic
security:
- basicAuth: [] # <-- use the same name here
paths:
`

require.NoError(t, s.UnmarshalYAML([]byte(spec)))
}

0 comments on commit eebc1f6

Please sign in to comment.