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

Extract Response Body? #25

Open
sachnk opened this issue Oct 24, 2018 · 1 comment
Open

Extract Response Body? #25

sachnk opened this issue Oct 24, 2018 · 1 comment

Comments

@sachnk
Copy link

sachnk commented Oct 24, 2018

I have several test cases that perform JSON asserations. However, I need to extract specific fields from a JSON response that will be used for subsequent business logic.

How does one extract values from the response body?

@h2non
Copy link
Owner

h2non commented Oct 24, 2018

You can write your own assertion function, where you can perform the specific JSON structure assertions the way you prefer in standard Go. See this example:
https://github.com/h2non/baloo/blob/master/_examples/custom_assertion/custom_test.go

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

No branches or pull requests

2 participants