fix: format-create-segment-errors-from-payload #5082
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.
Thanks for submitting a PR! Please check the boxes below:
docs/
if required so people know about the feature!Changes
Issue: #5071
Fixes #5071
Please describe.
The payload was passed as of from the request response.
CreateSegment
value/property
Rules: XXXXX
), if multiple errors, returns an array that is natively handled by the error component (but displays them as indexed list)Also please let me know if you have a better solution to handle multiple errors, the best would be something like the following but maybe you have other plans/prio:
How did you test this code?
Single error case
![image](https://private-user-images.githubusercontent.com/22979684/410884330-d06e0d63-d50b-45e9-887d-f88fe2c61d25.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyOTAyNzQsIm5iZiI6MTczOTI4OTk3NCwicGF0aCI6Ii8yMjk3OTY4NC80MTA4ODQzMzAtZDA2ZTBkNjMtZDUwYi00NWU5LTg4N2QtZjg4ZmUyYzYxZDI1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDE2MDYxNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTI4N2U0NWRiNWUwYzM4OWE4OWI5NzU5MzRjNWJhMzE4YjIyOTMyY2Q4NjMwY2Q2MDAzZWNlNmFlOTM2MGQ4ODQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.3Tm-LnAN2nbvRB8mZomzPmob5h5F-61NSroXL6mGVrE)
Multiple error case (to be improved)
![image](https://private-user-images.githubusercontent.com/22979684/410884514-82e10f6d-e67d-4c42-8d3b-638674bbe67a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyOTAyNzQsIm5iZiI6MTczOTI4OTk3NCwicGF0aCI6Ii8yMjk3OTY4NC80MTA4ODQ1MTQtODJlMTBmNmQtZTY3ZC00YzQyLThkM2ItNjM4Njc0YmJlNjdhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDE2MDYxNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTUwNzI5ZDJkOWJmNWRmNTZjMTU5MzhmYTA3MGM3MTQ5NjVmNjI3NGI1OGUyNzgzMTlmODI0ZmRkMDQxYWNjODcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.0KM4yjE1C_S89TPufVwqbe86n6y652OPhmTP-YCQ_vg)
Please describe.