mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-07 20:47:45 +00:00
Refactored SecurityRequirement **breaking change**
The v3 model is wrong and out of sync with the spec. It's been corrected, so the v2 and v2 model for SecurityRequirement have been collapsed down into a base model., they are the same data structures. This has allowed me to delete the complexity of sharing two different models for the same structure, by unifying the model correctly. I am not sure why I decided to change the v3 model, oh well, its been corrected. Long live swagger!
This commit is contained in:
@@ -317,11 +317,7 @@ func TestCreateDocument_Paths(t *testing.T) {
|
||||
assert.Equal(t, "$response.body#/id", burgerIdParam.Value)
|
||||
|
||||
// check security requirements
|
||||
security := burgersPost.Security.Value
|
||||
assert.NotNil(t, security)
|
||||
assert.Len(t, security.ValueRequirements, 1)
|
||||
|
||||
oAuthReq := security.FindRequirement("OAuthScheme")
|
||||
oAuthReq := burgersPost.FindSecurityRequirement("OAuthScheme")
|
||||
assert.Len(t, oAuthReq, 2)
|
||||
assert.Equal(t, "read:burgers", oAuthReq[0].Value)
|
||||
|
||||
@@ -453,11 +449,7 @@ func TestCreateDocument_Components_Links(t *testing.T) {
|
||||
|
||||
func TestCreateDocument_Doc_Security(t *testing.T) {
|
||||
initTest()
|
||||
security := doc.Security.Value
|
||||
assert.NotNil(t, security)
|
||||
assert.Len(t, security.ValueRequirements, 1)
|
||||
|
||||
oAuth := security.FindRequirement("OAuthScheme")
|
||||
oAuth := doc.FindSecurityRequirement("OAuthScheme")
|
||||
assert.Len(t, oAuth, 2)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user