Add support comments in JSON request body #599
PR Description
When a body in JSON format is provided, the function checks whether the body is in JSON format. If it is, the function returns the JSON string with comments removed. If not, it returns the input string as it is.
I have written test cases for removing single-line comments, multi-line comments, and other scenarios.
Related Issues
- Closes #599
Checklist
- [x] I have gone through the contributing guide
- [x] I have updated my branch and synced it with project
mainbranch before making this PR - [x] I am using the latest Flutter stable branch (run
flutter upgradeand verify) - [x] I have run the tests (
flutter test) and all tests are passing
Added/updated tests?
We encourage you to add relevant test cases.
- [x] Yes
- [ ] No, and this is why: please replace this line with details on why tests have not been included
OS on which you have developed and tested the feature?
- [x] Windows
- [ ] macOS
- [ ] Linux
Thank you for the great feedback. I’ve modified the code in the core package to only remove comments when the data is in JSON format, ensuring that the existing data in the editor remains unchanged and comments are removed only during the send request
Can I get some feedback on this PR?
@FreeBono We are currently occupied with GSoC. The PR has already gone through a round of review. We are working on a merge schedule.