use of io.swagger.parser.util.SwaggerDeserializationResult in project swagger-parser by swagger-api.
the class FileReferenceTests method testIssue340.
@Test
public void testIssue340() {
SwaggerDeserializationResult result = new SwaggerParser().readWithInfo("./src/test/resources/nested-file-references/issue-340.json", null, true);
assertNotNull(result.getSwagger());
Swagger swagger = result.getSwagger();
assertFalse(swagger.getDefinitions().get("BarData") instanceof RefModel);
}
use of io.swagger.parser.util.SwaggerDeserializationResult in project swagger-parser by swagger-api.
the class FileReferenceTests method testIssue312.
@Test
public void testIssue312() {
SwaggerDeserializationResult result = new SwaggerParser().readWithInfo("./src/test/resources/nested-file-references/issue-312.yaml", null, true);
assertNotNull(result.getSwagger());
Swagger swagger = result.getSwagger();
assertNotNull(swagger.getPath("/events"));
Path path = swagger.getPath("/events");
assertNotNull(path.getGet());
Operation get = path.getGet();
assertEquals(get.getOperationId(), "getEvents");
assertTrue(swagger.getDefinitions().size() == 2);
assertTrue(swagger.getDefinitions().get("Paging").getProperties().size() == 1);
}
use of io.swagger.parser.util.SwaggerDeserializationResult in project swagger-parser by swagger-api.
the class FileReferenceTests method testIssue308.
@Test
public void testIssue308() {
SwaggerDeserializationResult result = new SwaggerParser().readWithInfo("./src/test/resources/nested-file-references/issue-308.yaml", null, true);
assertNotNull(result.getSwagger());
Swagger swagger = result.getSwagger();
assertTrue(swagger.getDefinitions().size() == 2);
assertTrue(swagger.getDefinitions().get("Paging").getProperties().size() == 1);
}
use of io.swagger.parser.util.SwaggerDeserializationResult in project swagger-parser by swagger-api.
the class FileReferenceTests method testIssue304.
@Test
public void testIssue304() {
SwaggerDeserializationResult result = new SwaggerParser().readWithInfo("./src/test/resources/nested-file-references/issue-304.json", null, true);
assertNotNull(result.getSwagger().getDefinitions());
}
use of io.swagger.parser.util.SwaggerDeserializationResult in project swagger-parser by swagger-api.
the class NetworkReferenceTests method testIssue328.
@Test
public void testIssue328() throws Exception {
new Expectations() {
{
remoteUrl.urlToString("http://localhost:8080/resources/swagger/issue-328.yaml", new ArrayList<AuthorizationValue>());
result = issue_328_yaml;
remoteUrl.urlToString("http://localhost:8080/resources/swagger/issue-328-events.yaml", new ArrayList<AuthorizationValue>());
result = issue_328_events_yaml;
remoteUrl.urlToString("http://localhost:8080/resources/swagger/common/issue-328-paging.yaml", new ArrayList<AuthorizationValue>());
result = issue_328_paging_yaml;
remoteUrl.urlToString("http://localhost:8080/resources/swagger/common/common2/issue-328-bar.yaml", new ArrayList<AuthorizationValue>());
result = issue_328_bar_yaml;
}
};
SwaggerDeserializationResult result = new SwaggerParser().readWithInfo("http://localhost:8080/resources/swagger/issue-328.yaml", null, true);
assertNotNull(result.getSwagger());
Swagger swagger = result.getSwagger();
assertNotNull(swagger.getPath("/events"));
assertNotNull(swagger.getDefinitions().get("StatusResponse"));
assertNotNull(swagger.getDefinitions().get("Paging"));
assertNotNull(swagger.getDefinitions().get("Foobar"));
}
Aggregations