JetClient / jet-client-support

JetClient is an advanced REST API Client plugin for JetBrains IDEs
https://plugins.jetbrains.com/plugin/21173-jetclient
110 stars 0 forks source link

Allow comments in JSON (and XML) body #78

Open marcvanbreemen opened 5 months ago

marcvanbreemen commented 5 months ago

Is your feature request related to a problem?

No

Describe the solution you'd like

I'm aware that JSON is data only.

However when testing API's it can be convenient to have comments in them.

For example:"

{
  "JnCd": 15,  // This is a journal code
  // Transaction information:
  "TrIn": {
     "Amount": 1234.50
  }  
}

What JetClient could do is strip out the comments, identified by "//", before sending the JSON body to the API endpoint.

Additional context

No response

AntonShuvaev commented 5 months ago

Thank you for your suggestion. I just released version 2024.2.4, which includes support for comments in the JSON body, along with other JSON5 features such as trailing commas, single quotes, and unquoted keys. These JSON5 bodies are automatically converted to JSON when the request is sent.

Regarding XML support, I will consider adding this feature in the future.