use of io.swagger.models.properties.MapProperty in project swagger-parser by swagger-api.
the class SwaggerInventory method process.
public void process(Property property) {
this.properties.add(property);
if (property instanceof ArrayProperty) {
ArrayProperty p = (ArrayProperty) property;
Property ap = p.getItems();
this.process(ap);
} else if (property instanceof MapProperty) {
MapProperty p1 = (MapProperty) property;
} else if (property instanceof ObjectProperty) {
ObjectProperty p2 = (ObjectProperty) property;
if (p2.getProperties() != null) {
Iterator ap1 = p2.getProperties().keySet().iterator();
while (ap1.hasNext()) {
String name = (String) ap1.next();
Property ip = (Property) p2.getProperties().get(name);
this.process(ip);
}
}
}
}
use of io.swagger.models.properties.MapProperty in project java-chassis by ServiceComb.
the class TestSwaggerUtils method isComplexProperty.
@Test
public void isComplexProperty() {
Property property = new RefProperty("ref");
Assert.assertTrue(SwaggerUtils.isComplexProperty(property));
property = new ObjectProperty();
Assert.assertTrue(SwaggerUtils.isComplexProperty(property));
property = new MapProperty();
Assert.assertTrue(SwaggerUtils.isComplexProperty(property));
property = new ArrayProperty(new ObjectProperty());
Assert.assertTrue(SwaggerUtils.isComplexProperty(property));
property = new ArrayProperty(new StringProperty());
Assert.assertFalse(SwaggerUtils.isComplexProperty(property));
property = new StringProperty();
Assert.assertFalse(SwaggerUtils.isComplexProperty(property));
}
Aggregations