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
Transformations for doc capture #221
Comments
Discussed this with @MykolaGolubyev, we propose the syntax listed below. This is based on an example response: {
"ints": [1,2,3,4,5],
"strings": ["a", "b", "ab", "abc", "ba"]
} Simple response filter: http.doc.filterResponse('ints', anInt -> anInt > 3) Would generate: {
"ints": [4,5],
"strings": ["a", "b", "ab", "abc", "ba"]
} Multiple filters: http.doc
.filterResponse('ints', anInt -> anInt > 3)
.filterResponse('strings', str -> str.startsWith('a')
.capture() Would generate: {
"ints": [4,5],
"strings": ["a", "ab", "abc"]
} The reason for the fluid API with Such capture calls should capture the unfiltered body in the existing path/filename and the filtered body in a file with a |
Is this still relevant? |
It's relevant in that we still don't have support for it but I don't have a need for it any more. |
This should be used sparingly but for list responses for example, it's likely that in docs you'll only want one or two items. Supporting transformations at capture time will allow one to use somewhat sophisticated logic for selecting what to show in docs.
The text was updated successfully, but these errors were encountered: