Skip to content

Conversation

sr258
Copy link

@sr258 sr258 commented Nov 23, 2023

I've added the support for returning a string value in a response instead of only allowing JSON. Adding the change to the Storybook docs in packages/mock-addon-docs requires some bigger changes in the test files, so I haven't done that yet because I wanted to wait for your feedback on whether you want to accept the PR and if so, how it should be added to the docs.

Closes #200 .

Copy link

netlify bot commented Nov 23, 2023

Deploy Preview for storybook-addon-mock ready!

Name Link
🔨 Latest commit e8307ab
🔍 Latest deploy log https://app.netlify.com/sites/storybook-addon-mock/deploys/655f82af6bf56c0008a707f0
😎 Deploy Preview https://deploy-preview-201--storybook-addon-mock.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Mattsi-Jansky
Copy link

I would love this feature. It is quite a severe limitation to only be able to return objects and arrays. Hope the PR gets merged

@basvk
Copy link

basvk commented Oct 18, 2024

Nice, I hope this gets merged. There's still a small issue though: when using fetchXhrRequest it still uses JSON.stringify on a string response, causing it to become double quoted.
I've solved it like this: basvk@2c6db91 .

@pinguet62
Copy link

👍 for this feature
It should be a possibility to return a simple string.
This was a question when implementing typing #222

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support string responses
4 participants