use of org.eclipse.microprofile.openapi.models.media.Schema in project wildfly-swarm by wildfly-swarm.
the class ExpectationTests method testBareEnum.
@Test
public void testBareEnum() throws IOException, JSONException {
DotName baz = createSimple(EnumContainer.class.getName());
OpenApiDataObjectScanner scanner = new OpenApiDataObjectScanner(index, ClassType.create(baz, Type.Kind.CLASS));
Schema result = scanner.process();
printToConsole(baz.local(), result);
assertJsonEquals(baz.local(), "enum.expected.json", result);
}
use of org.eclipse.microprofile.openapi.models.media.Schema in project wildfly-swarm by wildfly-swarm.
the class OpenApiDataObjectScannerTestBase method schemaToString.
public static String schemaToString(String entityName, Schema schema) throws IOException {
Map<String, Schema> map = new HashMap<>();
map.put(entityName, schema);
OpenAPIImpl oai = new OpenAPIImpl();
ComponentsImpl comp = new ComponentsImpl();
comp.setSchemas(map);
oai.setComponents(comp);
return OpenApiSerializer.serialize(oai, OpenApiSerializer.Format.JSON);
}
use of org.eclipse.microprofile.openapi.models.media.Schema in project wildfly-swarm by wildfly-swarm.
the class SpecialCaseTests method testCollection_Wildcard.
@Test
public void testCollection_Wildcard() throws IOException, JSONException {
String name = SpecialCaseTestContainer.class.getName();
Type pType = getFieldFromKlazz(name, "listOfAnything").type();
OpenApiDataObjectScanner scanner = new OpenApiDataObjectScanner(index, pType);
Schema result = scanner.process();
printToConsole(name, result);
assertJsonEquals(name, "special.wildcard.expected.json", result);
}
use of org.eclipse.microprofile.openapi.models.media.Schema in project wildfly-swarm by wildfly-swarm.
the class SpecialCaseTests method testCollection_DataObjectList.
@Test
public void testCollection_DataObjectList() throws IOException, JSONException {
String name = SpecialCaseTestContainer.class.getName();
Type pType = getFieldFromKlazz(name, "ccList").type();
OpenApiDataObjectScanner scanner = new OpenApiDataObjectScanner(index, pType);
Schema result = scanner.process();
printToConsole(name, result);
assertJsonEquals(name, "special.dataObjectList.expected.json", result);
}
use of org.eclipse.microprofile.openapi.models.media.Schema in project wildfly-swarm by wildfly-swarm.
the class SpecialCaseTests method testCollection_WildcardWithSuperBound.
@Test
public void testCollection_WildcardWithSuperBound() throws IOException, JSONException {
String name = SpecialCaseTestContainer.class.getName();
Type pType = getFieldFromKlazz(name, "listSuperFlight").type();
OpenApiDataObjectScanner scanner = new OpenApiDataObjectScanner(index, pType);
Schema result = scanner.process();
printToConsole(name, result);
assertJsonEquals(name, "special.wildcardWithSuperBound.expected.json", result);
}
Aggregations