use of io.swagger.core.filter.SpecFilter in project swagger-core by swagger-api.
the class SpecFilterTest method retainModelsReferencesFromAdditionalProperties.
@Test(description = "Retain models referenced from additonalProperties")
public void retainModelsReferencesFromAdditionalProperties() throws IOException {
final Swagger swagger = getSwagger("specFiles/additionalpropsmodel.json");
final RemoveUnreferencedDefinitionsFilter remover = new RemoveUnreferencedDefinitionsFilter();
final Swagger filtered = new SpecFilter().filter(swagger, remover, null, null, null);
assertNotNull(filtered.getDefinitions().get("A"));
assertNotNull(filtered.getDefinitions().get("B"));
}
Aggregations