use of io.swagger.models.Operation in project swagger-core by swagger-api.
the class GenericsTest method checkCollectionsOfIntegers.
@Test(description = "check collections of integers")
public void checkCollectionsOfIntegers() {
Operation op = getOperation("testIntegerContainers");
assertEquals(op.getParameters().size(), 8);
testCollection(getQueryParameter(op, 0), "set", "integer", "int32");
testCollection(getQueryParameter(op, 1), "list", "integer", "int32");
testCollection(getQueryParameter(op, 2), "list2D", "string", null);
testCollection(getQueryParameter(op, 3), "array", "integer", "int32");
testCollection(getQueryParameter(op, 4), "arrayP", "integer", "int32");
testScalar(getQueryParameter(op, 5), "scalar", "integer", "int32");
testScalar(getQueryParameter(op, 6), "scalarP", "integer", "int32");
testCollection(getQueryParameter(op, 7), "forced", "integer", "int32");
}
use of io.swagger.models.Operation in project swagger-core by swagger-api.
the class GenericsTest method checkCollectionsOfObjects.
@Test(description = "check collections of objects")
public void checkCollectionsOfObjects() {
Operation op = getOperation("testObjectContainers");
assertEquals(op.getParameters().size(), 5);
testCollection(getQueryParameter(op, 0), "set", "string", null);
testCollection(getQueryParameter(op, 1), "list", "string", null);
testCollection(getQueryParameter(op, 2), "list2D", "string", null);
testCollection(getQueryParameter(op, 3), "array", "string", null);
testScalar(getQueryParameter(op, 4), "scalar", "string", null);
}
use of io.swagger.models.Operation in project swagger-core by swagger-api.
the class GenericsTest method checkCollectionsOfEnumerationsAsBodyParameter.
@Test(description = "check collection of enumerations as body parameter")
public void checkCollectionsOfEnumerationsAsBodyParameter() {
Operation op = getOperation("testEnumsInBody");
assertEquals(op.getParameters().size(), 1);
BodyParameter p = getBodyParameter(op, 0);
ArrayModel enumArray = (ArrayModel) p.getSchema();
assertEquals(((StringProperty) enumArray.getItems()).getEnum(), enumValues);
}
use of io.swagger.models.Operation in project swagger-core by swagger-api.
the class GenericsTest method checkCollectionsOfStrings.
@Test(description = "check collections of strings")
public void checkCollectionsOfStrings() {
Operation op = getOperation("testStringContainers");
assertEquals(op.getParameters().size(), 5);
QueryParameter set = getQueryParameter(op, 0);
testCollection(set, "set", "string", null);
assertEquals(((StringProperty) set.getItems()).getEnum(), Arrays.asList("1", "2", "3"));
testCollection(getQueryParameter(op, 1), "list", "string", null);
testCollection(getQueryParameter(op, 2), "list2D", "string", null);
testCollection(getQueryParameter(op, 3), "array", "string", null);
testScalar(getQueryParameter(op, 4), "scalar", "string", null);
}
use of io.swagger.models.Operation in project swagger-core by swagger-api.
the class HiddenParametersScannerTest method shouldScanMethodWithAllParamsHidden.
@Test
public void shouldScanMethodWithAllParamsHidden() throws Exception {
Operation get = getGet("/all-hidden/{id}");
assertNotNull(get);
assertEquals(0, get.getParameters().size());
}
Aggregations