feat(Insomnia): clarify dynamic mocking and faker usage#4969
feat(Insomnia): clarify dynamic mocking and faker usage#4969juliamrch wants to merge 3 commits intorelease/insomnia-v12.6from
Conversation
00e33f0 to
06187df
Compare
✅ Deploy Preview for kongdeveloper ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
57c0ccb to
adcfd35
Compare
06187df to
2335d8c
Compare
There was a problem hiding this comment.
Pull request overview
Clarifies Insomnia’s Dynamic Mocking documentation by explaining how Liquid templates are rendered at request time, contrasting static vs dynamic mocks, and expanding guidance on faker variables.
Changes:
- Reworks the intro to describe request-time Liquid rendering and the kinds of dynamic data supported.
- Adds a table comparing static vs dynamic mocks and a short “how to” for configuring mock bodies.
- Expands faker variable guidance and adds an example using
fakerFunctions.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| ``` | ||
|
|
||
| For a complete list of available faker variables, go to [**run.js#L218**](https://github.com/Kong/insomnia-mockbin/blob/04134cf81ce29ae7ffcc7ee13e2ecbce70414a96/lib/routes/bins/run.js#L218). | ||
| For a complete list of available faker variables, go to [**run.js#L218**](https://github.com/Kong/insomnia-mockbin/blob/04134cf81ce29ae7ffcc7ee13e2ecbce70414a96/lib/routes/bins/run.js#L218). Use the names listed under `fakerFunctions` (such as `guid`, `randomFullName`, `randomPhoneNumber`, etc.). For example: |
There was a problem hiding this comment.
Thoughts about this:
- If this code gets moved around, line 218 could be line 318 one day and we wouldn't be aware of it/could be directing users to the wrong thing.
- No definition or curation to the variables, so for example, I have no way to know what this is used for or when to use it:
randomAbstractImage: () =>
faker.image.urlLoremFlickr({ category: "abstract" }),
I think if the list of variables is worth documenting, it should live in the docs. Maybe as an include files that gets pulled into this. And, then the variables could have some sort of description. Alternatively, curating some example variables and descriptions would work.
I think this is Postman's version of this info:
https://learning.postman.com/docs/tests-and-scripts/write-scripts/variables-list/
Description
This PR clarifies the Dynamic Mocking features with:
Fixes #4965
Preview Links
Current docs VS. this PR
Checklist
descriptionentry in frontmatter.