SpectoLabs / hoverfly

Lightweight service virtualization/ API simulation / API mocking tool for developers and testers
https://hoverfly.io
Apache License 2.0
2.36k stars 208 forks source link

Manipulate csv contents #1143

Closed stuioco closed 3 months ago

stuioco commented 3 months ago

Added 3 templating functions to manipulate csv content.

Docs are also updated

stuioco commented 3 months ago

Hi Tommy, the main reason to extend the csv capability from read only to read/write is that it gives a much simpler and more natural mechanism to simulate structured data persistence between calls than having to use journal indexing which can be confusing for complex processes.

kapishmalik commented 3 months ago

It is quite unconventional to do so. We can make another api call to add or delete the data instead of displaying it using template function.

stuioco commented 3 months ago

I agree it's unconventional, but not necessarily a bad idea. I'm struggling to see how using just api calls we can implement a sandbox environment that needs to simulate a mutable persistent back-end that supports CRUD operations on known data structures.

kapishmalik commented 3 months ago

Can't we write middleware to update CSV and it shows that data instead of templating function. Can you help us understand your use case?