mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
bug 7223: page and pagesize parameters must be specified together "list" api commands
status 7223: resolved fixed
This commit is contained in:
parent
17ffde1c17
commit
680812f675
@ -143,6 +143,14 @@ public class ApiDispatcher {
|
||||
public static void setupParameters(BaseCmd cmd, Map<String, String> params){
|
||||
Map<String, Object> unpackedParams = cmd.unpackParams(params);
|
||||
|
||||
if (cmd instanceof BaseListCmd) {
|
||||
if ((unpackedParams.get(ApiConstants.PAGE) == null) && (unpackedParams.get(ApiConstants.PAGE_SIZE) != null)) {
|
||||
throw new ServerApiException(BaseCmd.PARAM_ERROR, "\"page\" parameter is required when \"pagesize\" is specified");
|
||||
} else if ((unpackedParams.get(ApiConstants.PAGE_SIZE) == null) && (unpackedParams.get(ApiConstants.PAGE) != null)) {
|
||||
throw new ServerApiException(BaseCmd.PARAM_ERROR, "\"pagesize\" parameter is required when \"page\" is specified");
|
||||
}
|
||||
}
|
||||
|
||||
Field[] fields = cmd.getClass().getDeclaredFields();
|
||||
Class<?> superClass = cmd.getClass().getSuperclass();
|
||||
while (BaseCmd.class.isAssignableFrom(superClass)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user