This is an automated email from the ASF dual-hosted git repository.
rohit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/master by this push:
new 1ae2b6f api: Add api arg validator for createProject api (#3097)
(#3107)
1ae2b6f is described below
commit 1ae2b6fe203794cfd414cce8f72b981d926450cf
Author: Anurag Awasthi <[email protected]>
AuthorDate: Tue Jan 1 00:44:08 2019 +0530
api: Add api arg validator for createProject api (#3097) (#3107)
Create project command should have an API arg validator.
Fixes: #3097
---
.../apache/cloudstack/api/command/user/project/CreateProjectCmd.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git
a/api/src/main/java/org/apache/cloudstack/api/command/user/project/CreateProjectCmd.java
b/api/src/main/java/org/apache/cloudstack/api/command/user/project/CreateProjectCmd.java
index e8a045c..79e372e 100644
---
a/api/src/main/java/org/apache/cloudstack/api/command/user/project/CreateProjectCmd.java
+++
b/api/src/main/java/org/apache/cloudstack/api/command/user/project/CreateProjectCmd.java
@@ -16,6 +16,7 @@
// under the License.
package org.apache.cloudstack.api.command.user.project;
+import org.apache.cloudstack.api.ApiArgValidator;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.APICommand;
@@ -51,10 +52,10 @@ public class CreateProjectCmd extends BaseAsyncCreateCmd {
@Parameter(name = ApiConstants.DOMAIN_ID, type = CommandType.UUID,
entityType = DomainResponse.class, description = "domain ID of the account
owning a project")
private Long domainId;
- @Parameter(name = ApiConstants.NAME, type = CommandType.STRING, required =
true, description = "name of the project")
+ @Parameter(name = ApiConstants.NAME, type = CommandType.STRING, required =
true, validations = ApiArgValidator.NotNullOrEmpty, description = "name of the
project")
private String name;
- @Parameter(name = ApiConstants.DISPLAY_TEXT, type = CommandType.STRING,
required = true, description = "display text of the project")
+ @Parameter(name = ApiConstants.DISPLAY_TEXT, type = CommandType.STRING,
required = true, validations = ApiArgValidator.NotNullOrEmpty, description =
"display text of the project")
private String displayText;
// ///////////////////////////////////////////////////