feat(RequestBody): validation support for required fields #6223
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes #5181
Description
Changed how UI receives x-www-form-urlencoded form data. Specifically, set requestBodyValue values to be an immutable Map, as "value". Previously stored as a normal String.
This change enables the ability to add "errors" to a Map that can be used by validation.
This change also matches the existing behavior of OAS2, and OAS3 Parameters
For application/json and application/xml, the "errors" field is added directly to the
bodyValueMapgetOAS3RequiredRequestBodyContentTyperequiresstate.spec, which is not available tostate.oas3Motivation and Context
Fixes #5181
For OAS3 Request Body, if required fields are empty, user should not be able to "Execute" and get a response. In addition, the missing required fields should be highlighted in Red.
How Has This Been Tested?
new cypress and mocha tests
Screenshots (if appropriate):
application/x-www-form-urlencoded

application/json (application/xml is similar)

Checklist
My PR contains...
src/is unmodified: changes to documentation, CI, metadata, etc.)package.json)My changes...
Documentation
Automated tests