unbridled-41 opened a new pull request, #6011:
URL: https://github.com/apache/rocketmq-dashboard/pull/6011

   ### Which Issue(s) This PR Fixes
   Fixes #6010
   ### Problem / Evidence
   ```java
   // SettingsController (before)
   public Result<Void> deleteDataSource(@RequestParam(required = false) String 
key) {
   ```
   with `docs/api-spec.md` ยง14.7 declaring a required `{"key": ...}` body:
   ```
   SettingsControllerTest: deleteDataSourceShouldAcceptTheDocumentedKeyBodyTest 
 -> 400 before the change
   ```
   ### Root cause / Fix
   The endpoint (and the console) use a query parameter while the spec 
documents a body. Accept both, using whichever carries the key; the parameter 
stays for the existing client.
   ### Priority and scoring
   **PRIORITY 58** - impact 20/40 (a documented request is a hard 400; an 
API-only client cannot delete a data source), blast radius 8/20, 
reproducibility 20/20 (pinned by the new test), maintenance value 10/20. 
**FIX_CONFIDENCE 75**.
   ### Tests
   `cd server && mvn -o -B -ntp test -Dtest='SettingsControllerTest'` -> `Tests 
run: 24, Failures: 0, Errors: 0`; the new case fails before the change and 
passes after it; the existing query-parameter and missing-key cases still pass; 
`checkstyle:check` passes.
   ### Risk
   One more optional binding; a request with neither a parameter nor a body 
keeps its 400.
   


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