Get source action file_list execute answers does not correspond to swagger specifications

I am trying to upload document from a source using the REST API.
The problem is I find a discrepancy between what is written in the swagger and what is actually returned by Mayan.

When i try to get the list of file available in the selected source I use the action ‘file_list’ and ask for pagination because i know there will be a lot of files. Here is the request :

curl -X 'GET' \
  'http://localhost/api/v4/sources/2/actions/file_list/execute/?page=1&page_size=2' \
  -H 'accept: application/json' \
  -H 'authorization: Basic YWRtaW46ajRrVEdDVHNaMg==' \
  -H 'X-CSRFToken: ZNvziEHo7ZoUBQXFLvi7ZdsqUao4C0ttgpEkVsxaNOSqRPYPRbXY0mF73rM4GnbH'

Here is what the swagger says the response should look like :

count*	integer
next	string($uri)
previous	string($uri)
results*	[]

And here is the actual response of Mayan :

    "encoded_filename": "MTAwYmY5MmItODA4Yi00ODhhLWI4Y2UtYzhkZDNhNWU3Nzc3LmpwZw%3D%3D",
    "filename": "100bf92b-808b-488a-b8ce-c8dd3a5e7777.jpg",
    "size": 3833220
    "encoded_filename": "MjAwYmY5MmItODA4Yi00ODhhLWI4Y2UtYzhkZDNhNWU4ODg4LmpwZw%3D%3D",
    "filename": "200bf92b-808b-488a-b8ce-c8dd3a5e8888.jpg",
    "size": 79153
    "encoded_filename": "MDAwYmY5MmItODA4Yi00ODhhLWI4Y2UtYzhkZDNhNWU0NjVlLnBuZw%3D%3D",
    "filename": "000bf92b-808b-488a-b8ce-c8dd3a5e465e.png",
    "size": 634783

I have a file list but it does not respect the pagination, and the format is not what is expected.
Am i missing a point ?


Adding pagination to the source action system is in the roadmap but was not included in version 4.5 due to time and because the patch to refactor the sources system was already very big.


These are two different things.

Swagger is describing the API endpoint. That would be:



api/v4/sources/{ ID }/actions/

The change that was added in version 4.5 allows sources to register their own unique actions. This way the main sources app does need to code behavior for all source classes. This is now the responsibility of each specialized source app managing a single source class. This allows disabling individual source classes or adding new one without having to rewrite the entire source system.

The source refactor allows each source class to define its own specific functionality. This is coded as source “actions”. Because these actions are not part of the API but internal code of each sources class, the API and Swagger have no advanced knowledge of what these actions do, what they return, or how to handle the returned data. All of this done by the source action interface itself.

Over the next version incremental improvements will be added including pagination and complete merge of the few remaining specialized source views with the actions API.