use of org.eclipse.microprofile.openapi.models.media.Schema in project wildfly-swarm by wildfly-swarm.
the class FilterUtil method filterSchemas.
/**
* Filters the given models.
* @param filter
* @param models
*/
private static void filterSchemas(OASFilter filter, Map<String, Schema> models) {
if (models == null) {
return;
}
Collection<String> keys = new ArrayList<>(models.keySet());
for (String key : keys) {
Schema model = models.get(key);
filterSchema(filter, model);
if (filter.filterSchema(model) == null) {
models.remove(key);
}
}
}
use of org.eclipse.microprofile.openapi.models.media.Schema in project wildfly-swarm by wildfly-swarm.
the class ExpectationTests method testNestedGenerics.
@Test
public void testNestedGenerics() throws IOException, JSONException {
String name = GenericTypeTestContainer.class.getName();
Type pType = getFieldFromKlazz(name, "nesting").type();
OpenApiDataObjectScanner scanner = new OpenApiDataObjectScanner(index, pType);
Schema result = scanner.process();
printToConsole(name, result);
assertJsonEquals(name, "generic.nested.expected.json", result);
}
use of org.eclipse.microprofile.openapi.models.media.Schema in project wildfly-swarm by wildfly-swarm.
the class ExpectationTests method testComplexInheritanceGenerics.
@Test
public void testComplexInheritanceGenerics() throws IOException, JSONException {
String name = GenericTypeTestContainer.class.getName();
Type pType = getFieldFromKlazz(name, "complexInheritance").type();
OpenApiDataObjectScanner scanner = new OpenApiDataObjectScanner(index, pType);
Schema result = scanner.process();
printToConsole(name, result);
assertJsonEquals(name, "generic.complexInheritance.expected.json", result);
}
use of org.eclipse.microprofile.openapi.models.media.Schema in project wildfly-swarm by wildfly-swarm.
the class ExpectationTests method testCycle.
/**
* Unresolvable type parameter.
*/
@Test
public void testCycle() throws IOException, JSONException {
DotName buzz = createSimple(BuzzLinkedList.class.getName());
OpenApiDataObjectScanner scanner = new OpenApiDataObjectScanner(index, ClassType.create(buzz, Type.Kind.CLASS));
Schema result = scanner.process();
printToConsole(buzz.local(), result);
assertJsonEquals(buzz.local(), "cycle.expected.json", result);
}
use of org.eclipse.microprofile.openapi.models.media.Schema in project wildfly-swarm by wildfly-swarm.
the class ExpectationTests method testComplexNestedGenerics.
@Test
public void testComplexNestedGenerics() throws IOException, JSONException {
String name = GenericTypeTestContainer.class.getName();
Type pType = getFieldFromKlazz(name, "complexNesting").type();
OpenApiDataObjectScanner scanner = new OpenApiDataObjectScanner(index, pType);
Schema result = scanner.process();
printToConsole(name, result);
assertJsonEquals(name, "generic.complexNesting.expected.json", result);
}
Aggregations