You see a "contentsinfo" field with subfields: filescount set to 3, filessize indicating the total of the size of the 3 files, lastmodified indicating the bigger timemodified value of the 3 files and finally mimetypes listing first "text/html" and then the rest of the mimetypes (text/plain and application/pdf)

As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings
Create a new course
Turn editing on and add a new "file" resource in any section:
In the "Select files" area of the new "file" resource being created include at least 3 different types of files: a pdf, a txt file and a html file
Click on the html file and in the popup click on "Set main file"
Save changes
Enrol one user as student in the course
Create a Token in the mobile app service for the user created in the previous step
Click on Site administration ► Plugins ► Web services ► Manage tokens
Open the console an execute this new curl request, replacing wstoken with the token you just created and the site url with yours and the courseid with the id of the course created in step 2
curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'courseid=2&wsfunction=core_course_get_contents&wstoken=3af67232a7596ceb658df4db329e5ad6' --compressed | python -m "json.tool"
Now check that:
You see a contents field listing all the 3 files you added
The first file in the "contents" field is the HTML field
You see a "contentsinfo" field with subfields: filescount set to 3, filessize indicating the total of the size of the 3 files, lastmodified indicating the bigger timemodified value of the 3 files and finally mimetypes listing first "text/html" and then the rest of the mimetypes (text/plain and application/pdf)
Now, execute the following curl request doing the same replacements
curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'courseid=2&wsfunction=core_course_get_contents&wstoken=3af67232a7596ceb658df4db329e5ad6&options [0] [name] =excludecontents&options [0] [value] =1' --compressed | python -m "json.tool"
And check that you see the "contents" field empty but the "contentsinfo" field is populated with the same data that the previous request

Description

In order to reduce the number of WS requests the app needs to perform to display basic information (or to calculate the amount of data that will be downloaded when fetching a course to be used offline) it would be good if we could return some summary information about files in resource modules.

We'd need to obtaing the number of files, the total file size and the different mimetypes withouth having to retrieve all the module contents.