
❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Overview
Studio's v2/importmetadata ignores max_results and descendants, and always returns the ancestors of one node as a single unpaginated dict. Since v0.19.3, Kolibri requests import metadata in pages and passes descendants for course imports. learningequality/kolibri#15352 makes Kolibri skip unpaginated sources for course imports, so until Studio supports both parameters, Kolibri can't import course metadata from Studio. Studio should paginate when given max_results and include descendants when given descendants, matching Kolibri's endpoint.
Complexity: Medium
Target branch: hotfixes
Context
- Kolibri's endpoint (
import_metadata.py#L18-L205):
- cursor pagination ordered by
lft, with max_results as the page size;
- a response of
{"more": …, "results": {<table>: [...], "schema_version": …}};
descendants returns the ancestors plus all descendants, ordered by lft.
- Studio's current view:
import_metadata_view.py#L69-L203
The Change
v2/importmetadata should accept max_results and descendants with the same semantics and response shape as Kolibri's endpoint. Without max_results, it keeps returning the unpaginated dict.
Acceptance Criteria
General
Testing
AI usage
I asked Claude Code to compare Kolibri's and Studio's v2 public content APIs. It found this gap and drafted the sections. I set the scope and target branch, and reviewed each section.
❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.
Overview
Studio's
v2/importmetadataignoresmax_resultsanddescendants, and always returns the ancestors of one node as a single unpaginated dict. Since v0.19.3, Kolibri requests import metadata in pages and passesdescendantsfor course imports. learningequality/kolibri#15352 makes Kolibri skip unpaginated sources for course imports, so until Studio supports both parameters, Kolibri can't import course metadata from Studio. Studio should paginate when givenmax_resultsand include descendants when givendescendants, matching Kolibri's endpoint.Complexity: Medium
Target branch: hotfixes
Context
import_metadata.py#L18-L205):lft, withmax_resultsas the page size;{"more": …, "results": {<table>: [...], "schema_version": …}};descendantsreturns the ancestors plus all descendants, ordered bylft.import_metadata_view.py#L69-L203The Change
v2/importmetadatashould acceptmax_resultsanddescendantswith the same semantics and response shape as Kolibri's endpoint. Withoutmax_results, it keeps returning the unpaginated dict.Acceptance Criteria
General
max_results=N, the response is{"more", "results"},resultsholds the tables for at most N nodes, and requesting again withmoreas the query string returns the next page untilmoreisnull.descendants=true, the paged results cover the node, its ancestors and all its descendants, inlftorder, with no node repeated.max_results, the response is unchanged from today._get_import_metadataimports a course node's metadata from Studio.Testing
descendants, and the unpaginated response.AI usage
I asked Claude Code to compare Kolibri's and Studio's v2 public content APIs. It found this gap and drafted the sections. I set the scope and target branch, and reviewed each section.