If the list is empty before it is passed to the mapping, then you will get an empty result.
Just for a rest-service practice: right-click on any entity in your domain model and select "Expose as REST service”.
I think you would be better off using something like https://www.mockapi.io/ .
Otherwise, do something like this:
- Create new entity with generalization of FileDocument
- In your microflow which is used by rest service operation, create new object of this filedocument specialization
- Import CommunityCommons module from the appstore in to your project
- Place Java action GetFileContensFromResource in your microflow and specify parameters (your newly created document and filename of the document which resides in your resourcefolder
- Place Java action after StringFromFile and input your created document entity.
- Set the return parameter of the microflow, the red endpoint to the string of the last Java action.