|
16 | 16 | import io.swagger.v3.oas.models.security.SecurityScheme; |
17 | 17 | import io.swagger.v3.oas.models.tags.Tag; |
18 | 18 | import io.swagger.v3.parser.converter.SwaggerConverter; |
| 19 | +import io.swagger.v3.parser.core.models.AuthorizationValue; |
19 | 20 | import io.swagger.v3.parser.core.models.ParseOptions; |
20 | 21 | import io.swagger.v3.parser.core.models.SwaggerParseResult; |
21 | 22 | import org.testng.annotations.Test; |
|
26 | 27 | import java.nio.file.Files; |
27 | 28 | import java.nio.file.Paths; |
28 | 29 | import java.util.ArrayList; |
| 30 | +import java.util.Arrays; |
29 | 31 | import java.util.List; |
30 | 32 | import java.util.Map; |
31 | 33 |
|
@@ -622,6 +624,15 @@ public void testIssue708() throws Exception { |
622 | 624 | assertEquals(schema.getPattern(), "^[0-9]+$"); |
623 | 625 | } |
624 | 626 |
|
| 627 | + @Test(description = "OpenAPIParser.readLocation fails when fetching valid Swagger 2.0 resource with AuthorizationValues provided") |
| 628 | + public void testIssue785() { |
| 629 | + AuthorizationValue apiKey = new AuthorizationValue("api_key", "special-key", "header"); |
| 630 | + List<AuthorizationValue> authorizationValues = Arrays.asList(apiKey); |
| 631 | + SwaggerConverter converter = new SwaggerConverter(); |
| 632 | + List<io.swagger.models.auth.AuthorizationValue> convertedAuthList = converter.convert(authorizationValues); |
| 633 | + assertEquals(convertedAuthList.size(), authorizationValues.size()); |
| 634 | + } |
| 635 | + |
625 | 636 | @Test(description = "OpenAPI v2 converter - Migrate a schema with AllOf") |
626 | 637 | public void testIssue740() throws Exception { |
627 | 638 | final OpenAPI oas = getConvertedOpenAPIFromJsonFile(ISSUE_740_YAML); |
|
0 commit comments