firecamp-io / firecamp

VSCode for APIs, Postman Alternative.
https://firecamp.dev
317 stars 22 forks source link

[RFC / Feature Request] Support saving sample response / sub messages or mocking based on response model. #137

Open jugglingjsons opened 3 years ago

jugglingjsons commented 3 years ago

It would be great if Firecamp could serve not only as a client but a self documenting pub/sub map. IE it could intercept responses / subs that you receive from connection, pass them through a mocking helper and save the results as a sample.

I am currently doing the following:

  1. Write types in TS
  2. Pass types to https://github.com/google/intermock
  3. Spit out sample
  4. Obscure input
  5. Format both to my looks requirements

My flow is JS specific, there is nothing in the way of using some other format - joining forces with https://playground.asyncapi.io/ for example.

I am mentioning using types / classes as it would make the documentation extendible, and allow for writing contracts before actual coding.

Not sure if others would use it but, it would be damn useful for my current project. Let me know what you guys thing, I am happy to help on that if you accept OS contributions.

This is mostly useful when you are using the Streaming servers in a req -> response fashion. But even with layer separation a way to document the pun AND sub would be very useful.

welcome[bot] commented 3 years ago

Welcome to the Firecamp! Thanks and congrats for opening your very first issue in Firecamp. Join the Discord community here https://discord.gg/8hRaqhK Hope you have a great time here :)

Nishchit14 commented 3 years ago

@jugglingjsons Thank you for sharing the story, I am thinking about it. I'll ask for help if needed as you've good experience with it so :)