How to place comments in Postman

You can write documentation and comments using the description section of the requests, collections or folders.


Finally, since Postman v8.3.0 you can do this in your collections pre-request script:

// Strip JSON Comments
if (pm?.request?.body?.options?.raw?.language === 'json') {
    const rawData = pm.request.body.toString();
    const strippedData = rawData.replace(
        /\\"|"(?:\\"|[^"])*"|(\/\/.*|\/\*[\s\S]*?\*\/)/g,
        (m, g) => g ? "" : m
    );
    pm.request.body.update(JSON.stringify(JSON.parse(strippedData)));
}

This strips all comments from the json and sets the current body to the cleaned one, there are more examples for other body types (GraphQL, URL Encoded, Form Data) in the original github post this code is based from.


A "Comments" option/button is above the send button for every request.

But still, we can't add a comment in the request body, maybe in future, they'll provide this feature.

screenshot