use of org.eclipse.microprofile.openapi.models.media.Schema in project wildfly-swarm by wildfly-swarm.
the class FilterUtil method filterSchemaList.
/**
* Filters the given models.
* @param filter
* @param models
*/
private static void filterSchemaList(OASFilter filter, List<Schema> models) {
if (models == null) {
return;
}
ListIterator<Schema> iterator = models.listIterator();
while (iterator.hasNext()) {
Schema model = iterator.next();
filterSchema(filter, model);
if (filter.filterSchema(model) == null) {
iterator.remove();
}
}
}
use of org.eclipse.microprofile.openapi.models.media.Schema in project wildfly-swarm by wildfly-swarm.
the class ExpectationTests method genericFieldTest.
@Test
public void genericFieldTest() throws IOException, JSONException {
String name = GenericTypeTestContainer.class.getName();
Type pType = getFieldFromKlazz(name, "genericContainer").type();
OpenApiDataObjectScanner scanner = new OpenApiDataObjectScanner(index, pType);
Schema result = scanner.process();
printToConsole(name, result);
assertJsonEquals(name, "generic.fields.expected.json", result);
}
use of org.eclipse.microprofile.openapi.models.media.Schema in project wildfly-swarm by wildfly-swarm.
the class ExpectationTests method testGenericsWithBounds.
@Test
public void testGenericsWithBounds() throws IOException, JSONException {
String name = GenericTypeTestContainer.class.getName();
Type pType = getFieldFromKlazz(name, "genericWithBounds").type();
OpenApiDataObjectScanner scanner = new OpenApiDataObjectScanner(index, pType);
Schema result = scanner.process();
printToConsole(name, result);
assertJsonEquals(name, "generic.withBounds.expected.json", result);
}
use of org.eclipse.microprofile.openapi.models.media.Schema in project wildfly-swarm by wildfly-swarm.
the class ExpectationTests method testUnresolvable.
/**
* Unresolvable type parameter.
*/
@Test
@Ignore
public void testUnresolvable() throws IOException, JSONException {
DotName bar = createSimple(Bar.class.getName());
OpenApiDataObjectScanner scanner = new OpenApiDataObjectScanner(index, ClassType.create(bar, Type.Kind.CLASS));
Schema result = scanner.process();
printToConsole(bar.local(), result);
assertJsonEquals(bar.local(), "unresolvable.expected.json", result);
}
use of org.eclipse.microprofile.openapi.models.media.Schema in project wildfly-swarm by wildfly-swarm.
the class SpecialCaseTests method testCollection_SimpleTerminalType.
@Test
public void testCollection_SimpleTerminalType() throws IOException, JSONException {
String name = SpecialCaseTestContainer.class.getName();
Type pType = getFieldFromKlazz(name, "listOfString").type();
OpenApiDataObjectScanner scanner = new OpenApiDataObjectScanner(index, pType);
Schema result = scanner.process();
printToConsole(name, result);
assertJsonEquals(name, "special.simple.expected.json", result);
}
Aggregations