diff --git a/packages/bruno-filestore/src/formats/yml/items/stringifyHttpRequest.ts b/packages/bruno-filestore/src/formats/yml/items/stringifyHttpRequest.ts index eced35b2c..99c122e96 100644 --- a/packages/bruno-filestore/src/formats/yml/items/stringifyHttpRequest.ts +++ b/packages/bruno-filestore/src/formats/yml/items/stringifyHttpRequest.ts @@ -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 }; } }