use of io.gravitee.rest.api.service.swagger.SwaggerDescriptor in project gravitee-management-rest-api by gravitee-io.
the class SwaggerService_ParseTest method shouldParseSwaggerV3_yaml.
@Test
public void shouldParseSwaggerV3_yaml() throws IOException {
PageEntity pageEntity = getPage("io/gravitee/rest/api/management/service/openapi.yaml", MediaType.TEXT_PLAIN);
SwaggerDescriptor descriptor = swaggerService.parse(pageEntity.getContent(), false);
assertNotNull(descriptor);
validateV3(Yaml.mapper().readTree(descriptor.toYaml()));
}
use of io.gravitee.rest.api.service.swagger.SwaggerDescriptor in project gravitee-management-rest-api by gravitee-io.
the class SwaggerService_ParseTest method shouldNotThrowAnythingWhenFailIfErrorsFalse_yaml.
@Test
public void shouldNotThrowAnythingWhenFailIfErrorsFalse_yaml() throws IOException {
PageEntity pageEntity = getPage("io/gravitee/rest/api/management/service/swagger-v2-no-info-name.yaml", MediaType.APPLICATION_JSON);
SwaggerDescriptor descriptor = swaggerService.parse(pageEntity.getContent());
assertNotNull(descriptor);
}
use of io.gravitee.rest.api.service.swagger.SwaggerDescriptor in project gravitee-management-rest-api by gravitee-io.
the class SwaggerService_ParseTest method shouldParseSwaggerV2_yaml.
@Test
public void shouldParseSwaggerV2_yaml() throws IOException {
PageEntity pageEntity = getPage("io/gravitee/rest/api/management/service/swagger-v2.yaml", MediaType.TEXT_PLAIN);
SwaggerDescriptor descriptor = swaggerService.parse(pageEntity.getContent(), false);
assertNotNull(descriptor);
validateV3(Yaml.mapper().readTree(descriptor.toYaml()), false);
}
Aggregations