fix: update stringifyHttpRequest to handle response body content correctly (#6488)

This commit is contained in:
Sanjai Kumar
2025-12-23 15:48:52 +05:30
committed by GitHub
parent 01d4d3dc2a
commit 87c8934c45

View File

@@ -189,9 +189,12 @@ const stringifyHttpRequest = (item: BrunoItem): string => {
}
if (example.response.body && example.response.body.type && example.response.body.content !== undefined) {
const content = example.response.body.content;
const contentString = typeof content === 'string' ? content : JSON.stringify(content, null, 2);
ocExample.response.body = {
type: example.response.body.type as 'json' | 'text' | 'xml' | 'html' | 'binary',
data: String(example.response.body.content || '')
data: contentString
};
}
}