Skip to content

Conversation

FreeBono
Copy link
Contributor

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

Checklist

  • I have gone through the contributing guide
  • I have updated my branch and synced it with project main branch before making this PR
  • I am using the latest Flutter stable branch (run flutter upgrade and verify)
  • I have run the tests (flutter test) and all tests are passing

Added/updated tests?

We encourage you to add relevant test cases.

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

  • Windows
  • macOS
  • Linux
ref
.read(collectionStateNotifierProvider.notifier)
.update(body: value);
.update(body: removeJsonComments(value));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have to preserve the comments added by the user. Currently, it removes all comments and saves it. When the user comes back to the request, the body is modified.
Comments are cleaned up only when the request is sent.

@FreeBono
Copy link
Contributor Author

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

@FreeBono
Copy link
Contributor Author

FreeBono commented Apr 7, 2025

Can I get some feedback on this PR?

@animator
Copy link
Member

animator commented Apr 7, 2025

@FreeBono We are currently occupied with GSoC. The PR has already gone through a round of review. We are working on a merge schedule.

@animator animator merged commit 330e1b8 into foss42:main Jun 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants