Pearl1594 commented on PR #13783:
URL: https://github.com/apache/cloudstack/pull/13783#issuecomment-5258284244

   @dheeraj12347 I had a cursory look at the PR and would say that this can be 
extended to a lot more parameters. 
   That said, for the params that are already backed by a Java enum (e.g. 
ProvisioningType in CreateDiskOfferingCmd), allowedValues is hard-coding those 
enum values a second time as a String[], which is a second source of truth; if 
the enum gains a value later, the annotation can silently lag behind.
   I would consider passing the enum Class itself (for example 
allowedValuesEnum = ProvisioningType.class) in @Parameter and have 
ApiDiscoveryServiceImpl, which already reflects over these annotations, call 
getEnumConstants() on it to build the list at discovery time. That'd keep the 
enum as the single source of truth for those cases.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to