-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API/method to overwrite specific request without using PUT api as it completely overwrites the entire data #992
Comments
Hoverfly hardly takes any time to update the entire simulation data as it is in memory and takes exclusive locks before modifying the simulation data. It won't disrupt the other services but at times call will be slower. You are probably asking for a PATCH call but there is no mechanism to identify that request/response pair. |
@tommysitu do you want to do this? |
We need a way to identify the request-response pair first. Have you got any idea? |
@tommysitu we can add auto generated id to each request response pair and identify using the same. What do you say? |
Hey guys, any update on this? |
@tommysitu what do you say about this?
|
you can compute a hash code for the request struct and use the code for checking equality. |
sure @tommysitu I can proceed in that way. |
@atif-github-venture I will start working on this and get back with more updates. |
@kapishmalik what's your plan? Are you creating a new admin API or updating the POST simulation API? |
@tommysitu I am planning to create new PATCH admin API endpoint to update a particular request. Shall I go ahead with that? |
Cool, let's do a PATCH API that can merge the new data with the old data, so:
We probably want to deprecated the POST API in the future, I don't know if that's useful or not, it has quite a lot of overlap with this new proposed PATCH API. Thanks @kapishmalik |
Yup, that's an idea. I will get back in few days with PR. |
This appends the supplied simulation JSON to the existing simulation data in Hoverfly. Any pair that has request data identical to the existing ones will not be added.
As per the documentation POST adds the supplied JSON, but lets say I have need to overwrite the existing content just for single request match NOT the whole simulations set, and API suitable for just this will be helpful.
We are looking for alternative to our existing mock solution. So in hoverfly we are looking for a way to not bring down a service and also NOT overwrite the whole set, but for something which can support multiple team members to use the same service in their own way. And many a times we end up changing the stubbed data, so we can not afford to overwrite and disrupt others.
If you have more questions, please let me know.
The text was updated successfully, but these errors were encountered: