-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: cover uncovered security definitions validation
- Loading branch information
Showing
5 changed files
with
282 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 88 additions & 0 deletions
88
.../fixtures/SwaggerServiceTest/documentation/invalid_format__security_definition__flow.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
{ | ||
"swagger": "2.0", | ||
"host": "localhost", | ||
"basePath": "\/", | ||
"schemes": [], | ||
"paths": { | ||
"\/api\/users": | ||
{ | ||
"post": | ||
{ | ||
"tags": ["api"], | ||
"consumes": ["application\/x-www-form-urlencoded"], | ||
"produces": ["application\/json"], | ||
"parameters": [ | ||
{ | ||
"in": "body", | ||
"name": "body", | ||
"description": "", | ||
"required": true, | ||
"schema": { | ||
"$ref": "#/definitions/apiusersObject" | ||
} | ||
} | ||
], | ||
"responses": | ||
{ | ||
"403": | ||
{ | ||
"description": "Forbidden", | ||
"schema": | ||
{ | ||
"example": | ||
{ | ||
"message": "This action is unauthorized." | ||
} | ||
} | ||
} | ||
}, | ||
"security": [], | ||
"description": "", | ||
"summary": "test" | ||
} | ||
} | ||
}, | ||
"definitions": { | ||
"apiusersObject": { | ||
"type": "object", | ||
"properties": { | ||
"query": { | ||
"type": "string", | ||
"description": "" | ||
}, | ||
"user_id": { | ||
"type": "integer", | ||
"description": "with_to_array_rule_string_name" | ||
}, | ||
"is_email_enabled": { | ||
"type": "string", | ||
"description": "test_rule_without_to_string" | ||
} | ||
}, | ||
"required": { | ||
"0": "query" | ||
}, | ||
"example": { | ||
"first_name": "andrey", | ||
"last_name": "voronin" | ||
} | ||
} | ||
}, | ||
"info": { | ||
"description": "This is automatically collected documentation", | ||
"version": "0.0.0", | ||
"title": "Name of Your Application", | ||
"termsOfService": "", | ||
"contact": | ||
{ | ||
"email": "[email protected]" | ||
} | ||
}, | ||
"securityDefinitions": [ | ||
{ | ||
"type": "basic", | ||
"in": "query", | ||
"flow": "invalid" | ||
} | ||
] | ||
} |
88 changes: 88 additions & 0 deletions
88
tests/fixtures/SwaggerServiceTest/documentation/invalid_format__security_definition__in.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
{ | ||
"swagger": "2.0", | ||
"host": "localhost", | ||
"basePath": "\/", | ||
"schemes": [], | ||
"paths": { | ||
"\/api\/users": | ||
{ | ||
"post": | ||
{ | ||
"tags": ["api"], | ||
"consumes": ["application\/x-www-form-urlencoded"], | ||
"produces": ["application\/json"], | ||
"parameters": [ | ||
{ | ||
"in": "body", | ||
"name": "body", | ||
"description": "", | ||
"required": true, | ||
"schema": { | ||
"$ref": "#/definitions/apiusersObject" | ||
} | ||
} | ||
], | ||
"responses": | ||
{ | ||
"403": | ||
{ | ||
"description": "Forbidden", | ||
"schema": | ||
{ | ||
"example": | ||
{ | ||
"message": "This action is unauthorized." | ||
} | ||
} | ||
} | ||
}, | ||
"security": [], | ||
"description": "", | ||
"summary": "test" | ||
} | ||
} | ||
}, | ||
"definitions": { | ||
"apiusersObject": { | ||
"type": "object", | ||
"properties": { | ||
"query": { | ||
"type": "string", | ||
"description": "" | ||
}, | ||
"user_id": { | ||
"type": "integer", | ||
"description": "with_to_array_rule_string_name" | ||
}, | ||
"is_email_enabled": { | ||
"type": "string", | ||
"description": "test_rule_without_to_string" | ||
} | ||
}, | ||
"required": { | ||
"0": "query" | ||
}, | ||
"example": { | ||
"first_name": "andrey", | ||
"last_name": "voronin" | ||
} | ||
} | ||
}, | ||
"info": { | ||
"description": "This is automatically collected documentation", | ||
"version": "0.0.0", | ||
"title": "Name of Your Application", | ||
"termsOfService": "", | ||
"contact": | ||
{ | ||
"email": "[email protected]" | ||
} | ||
}, | ||
"securityDefinitions": [ | ||
{ | ||
"type": "basic", | ||
"in": "invalid", | ||
"flow": "password" | ||
} | ||
] | ||
} |
88 changes: 88 additions & 0 deletions
88
.../fixtures/SwaggerServiceTest/documentation/invalid_format__security_definition__type.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
{ | ||
"swagger": "2.0", | ||
"host": "localhost", | ||
"basePath": "\/", | ||
"schemes": [], | ||
"paths": { | ||
"\/api\/users": | ||
{ | ||
"post": | ||
{ | ||
"tags": ["api"], | ||
"consumes": ["application\/x-www-form-urlencoded"], | ||
"produces": ["application\/json"], | ||
"parameters": [ | ||
{ | ||
"in": "body", | ||
"name": "body", | ||
"description": "", | ||
"required": true, | ||
"schema": { | ||
"$ref": "#/definitions/apiusersObject" | ||
} | ||
} | ||
], | ||
"responses": | ||
{ | ||
"403": | ||
{ | ||
"description": "Forbidden", | ||
"schema": | ||
{ | ||
"example": | ||
{ | ||
"message": "This action is unauthorized." | ||
} | ||
} | ||
} | ||
}, | ||
"security": [], | ||
"description": "", | ||
"summary": "test" | ||
} | ||
} | ||
}, | ||
"definitions": { | ||
"apiusersObject": { | ||
"type": "object", | ||
"properties": { | ||
"query": { | ||
"type": "string", | ||
"description": "" | ||
}, | ||
"user_id": { | ||
"type": "integer", | ||
"description": "with_to_array_rule_string_name" | ||
}, | ||
"is_email_enabled": { | ||
"type": "string", | ||
"description": "test_rule_without_to_string" | ||
} | ||
}, | ||
"required": { | ||
"0": "query" | ||
}, | ||
"example": { | ||
"first_name": "andrey", | ||
"last_name": "voronin" | ||
} | ||
} | ||
}, | ||
"info": { | ||
"description": "This is automatically collected documentation", | ||
"version": "0.0.0", | ||
"title": "Name of Your Application", | ||
"termsOfService": "", | ||
"contact": | ||
{ | ||
"email": "[email protected]" | ||
} | ||
}, | ||
"securityDefinitions": [ | ||
{ | ||
"type": "invalid", | ||
"in": "query", | ||
"flow": "password" | ||
} | ||
] | ||
} |