Hello! I have a little question. Is it possible to...
# help
s
Hello! I have a little question. Is it possible to return a response from several JSON files ? I know I can return bodyAsFile, but can I do from more than one file? Thanks!!
l
Hi, this is not currently possible using
bodyAsFile
What is your use case? There might be a different way to achieve what you are trying to do?
t
Hi Sergio, you can use templating on the body filename as a way of selecting different files depending on the request. Does that help?
s
We have different JSON files responses, I would like to return them all. The idea is that the tester upload multiple JSON files as responses and the app replies with all of them in the same request.
Maybe it is not possible. I can find out another solution
t
Ah OK, that’s not going to work as things stand. I suggest just building a single file and returning that if that’s possible.
s
Oke, thanks!!
t
Or at a stretch you could build a
ResponseDefinitionTransformer
that does the file assembly for you
I’d be tempted to go back to 1st principles and ask whether this process is really needed though if this were my team
s
Oke, great. Thanks very appreciated!!
👍 1