dheeraj12347 opened a new pull request, #13895:
URL: https://github.com/apache/cloudstack/pull/13895

   ## Description
   
   Refactor API parameter `allowedValues` discovery to support enum-backed 
values.
   
   Previously, enum values were specified directly as hard-coded strings in API 
parameter annotations. This can result in duplicated sources of truth when the 
corresponding enum changes.
   
   This change introduces `allowedValueType` to `@Parameter`. When an enum type 
is provided, API discovery derives the allowed values directly from the enum 
constants.
   
   The existing explicit `allowedValues` mechanism is retained for parameters 
that do not have a corresponding enum.
   
   The change also expands enum-backed allowed-values coverage across existing 
API parameters.
   
   ## Changes
   
   - Add `allowedValueType` to `@Parameter`.
   - Derive allowed values from enum constants in `ApiDiscoveryServiceImpl`.
   - Retain explicit `allowedValues` support as a fallback.
   - Refactor existing hard-coded enum values to use their corresponding enums.
   - Add unit-test coverage for enum-based allowed-value discovery.
   
   ## Validation
   
   - `mvn -pl plugins/api/discovery -am -DskipTests compile`
   - `mvn -pl plugins/api/discovery -Dtest=ApiDiscoveryServiceImplTest 
-DfailIfNoTests=false test`
   - `git diff --check`
   - Checkstyle: 0 violations
   
   API Discovery tests: 8/8 passed.


-- 
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