Add allowedValues support for API parameter discovery#13543
Add allowedValues support for API parameter discovery#13543dheeraj12347 wants to merge 2 commits into
Conversation
|
@blueorangutan package |
|
@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 18464 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13543 +/- ##
============================================
+ Coverage 18.08% 20.40% +2.31%
- Complexity 16721 18786 +2065
============================================
Files 6037 5757 -280
Lines 542580 520931 -21649
Branches 66428 60824 -5604
============================================
+ Hits 98149 106293 +8144
+ Misses 433409 403057 -30352
- Partials 11022 11581 +559
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Hi @DaanHoogland , @Pearl1594 and @soreana Mockito.when(parameterMock.allowedValues()).thenReturn(new String[]{}); This fixes the NullPointerException in ApiDiscoveryServiceImplTest, and I verified that the test passes locally with: mvn -pl plugins/api/discovery Please let me know if there are any other changes you'd like me to make. |
Summary
This PR adds support for exposing allowed parameter values through the API Discovery framework.
Framework changes
allowedValuesattribute to the@ParameterannotationApiParameterResponseto expose allowed valuesApiDiscoveryServiceImplto populateallowedValuesAPI annotations
Add
allowedValuesannotations to representative API parameters with fixed documented values.The annotations cover:
Testing
Successfully built using:
I also investigated runtime verification using the simulator. The simulator Docker image runs from an embedded source tree, so local source changes require rebuilding the simulator image before they are reflected in
listApis.