Surface backend validation error messages inline in the Create-API wizard#1374
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
When validate-openapi rejects a definition by URL/file (HTTP 400 with a reason in the response body), the wizard's .catch handlers dropped the backend reason to console.error and showed only a generic "validation failed" message - the Validation Errors card stayed empty. A 400 was thus surfaced less prominently than a 200 isValid:false, which renders the backend errors array in the card. Add getValidationErrorsFromError() to thread the backend response.body.description into setValidationErrors() across the URL and file (API + MCP) rejection paths, so a rejected validation shows as prominently as the isValid:false path. Also clear stale validation errors on file-validation success. Errors without a backend description return [] and keep the existing generic-message fallback. Adds a unit test for the helper.
2c10bb8 to
ee5a286
Compare
|
This repetition comes from a few added lines landing inside the pre-existing API/MCP/URL validation handlers |


Surface backend validation error messages inline in the Create-API wizard
What
When
validate-openapirejects a definition by URL or file (HTTP 400 with a reason in the response body), the Create-API wizard's.catchhandlers dropped the backend reason toconsole.errorand showed only a generic "validation failed" message — the Validation Errors card stayed empty. A 400 was thus surfaced less prominently than a200 isValid:false, which renders the backend errors in the card.Change
getValidationErrorsFromError()to thread the backendresponse.body.descriptionintosetValidationErrors()across the URL and file (API + MCP) rejection paths, so a rejected validation shows as prominently as theisValid:falsepath.[]and keep the existing generic-message fallback.Testing
validationErrorUtilsjest suite (2/2 passing) + full publisher portal build green againstfeature_nw_access_control.Notes
feature_nw_access_controlintegration branch.