Ori Liel has posted comments on this change.
Change subject: restapi: Add enum validations
......................................................................
Patch Set 1: (2 inline comments)
....................................................
File
backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
Line 1432
Line 1433
Line 1434
Line 1435
Line 1436
It's not related to the patch, I was going over enums that should be validated
and saw that this one is not in use at all. I guess it should go in a separate
patch...
....................................................
File
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/validation/ValidatorLocator.java
Line 25: public class ValidatorLocator {
Line 26:
Line 27: private static Map<Class<?>, Validator<?>> validators = new
HashMap<Class<?>, Validator<?>>();
Line 28:
Line 29: static {
It requires adding annotations, something like:
@Mapping(from = VM.class, to = VmStatic.class)
I think it made more sense in mappers, since there are several mapping methods
in the same mapper, so this information is useful (you could get to the exact
mapping method by supplying the classes).
I think in the case of validators, we don't need this.
Line 30: validators.put(Boot.class, new BootValidator());
Line 31: validators.put(Cluster.class, new ClusterValidator());
Line 32: validators.put(DataCenter.class, new DataCenterValidator());
Line 33: validators.put(Disk.class, new DiskValidator());
--
To view, visit http://gerrit.ovirt.org/7218
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I32b575589a7c82cb2d9e6da8d4d852a50f0f595f
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Ori Liel <[email protected]>
Gerrit-Reviewer: Michael Pasternak <[email protected]>
Gerrit-Reviewer: Ori Liel <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches