Skip to content
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

Request object / expected response in GET #59

Closed
miguellobato84 opened this issue Sep 28, 2024 · 5 comments · Fixed by #61
Closed

Request object / expected response in GET #59

miguellobato84 opened this issue Sep 28, 2024 · 5 comments · Fixed by #61
Labels
enhancement New feature or request

Comments

@miguellobato84
Copy link

miguellobato84 commented Sep 28, 2024

What problem are you facing?
We are encountering an issue with the API we are trying to manage; it returns different response bodies for the GET and PUT requests. When using the Request object, this discrepancy causes it to get stuck in a loop.

To address this issue, it would be greatly beneficial to have an optional “expected response” field in the GET object. By default, this could align with the body of the PUT mapping.

Thank you for considering this enhancement!

@miguellobato84 miguellobato84 added the enhancement New feature or request label Sep 28, 2024
@arielsepton
Copy link
Member

I understand the issue you’re facing. My only concern is potential confusion during resource updates—you’d update the PUT mapping for the request execution but would also need to update the expected response separately. This could lead to data inconsistencies—updating the same information in different places, which can complicate management.

Currently, the PUT mapping’s body only needs to be contained within the GET response, not an exact match. Does that still not meet your needs?

@miguellobato84
Copy link
Author

yeah.. not the best API implementation :(

what about a jq expression that allows to transform the PUT response?

@arielsepton
Copy link
Member

I understand what you’re suggesting, but just to clarify—right now, you can already apply any jq expression to transform the PUT body. The only requirement is that the result of this expression should either be contained within the GET response or used as the body of a PUT request if it’s not.

Does that address your concern, or are you thinking of a different type of transformation? Let me know if I’m missing something!

@miguellobato84
Copy link
Author

I was thinking a transform in the put response so it can be compared to the GET :)

@miguellobato84
Copy link
Author

great, thanks!

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

Successfully merging a pull request may close this issue.

2 participants