Skip to content

Conversation

@jonhealy1
Copy link
Contributor

This PR proposes adding an optional type query parameter to the /children endpoint to support filtering results by resource type (e.g., Catalog or Collection).

Motivation

While the specification recommends separating different types into different hierarchy branches as a best practice, real-world data organization often results in "mixed content" folders (e.g., a Project Catalog containing both sub-project Catalogs and direct Dataset Collections).

In dynamic, database-backed APIs (like those using Elasticsearch), retrieving and paginating mixed-type lists can be computationally expensive and complex to implement.

Adding a standard type parameter allows:

  1. Backend Optimization: Implementations can execute efficient, type-specific queries (e.g., type: "Catalog") rather than fetching all children and filtering in memory.
  2. Client Flexibility: Clients can request only the resource type they are interested in (e.g., "Show me sub-folders" vs. "Show me datasets") without receiving unwanted data.
  3. Standardization: Prevents the proliferation of custom filter parameters (e.g., ?kind=, ?filter=) across different implementations.

Proposed Change

Add a section detailing the type parameter:

Filtering by Type

Implementations MAY support a type query parameter to allow clients to request a specific resource type.

  • GET .../children?type=Catalog
  • GET .../children?type=Collection

Related Issue(s):

Proposed Changes:

PR Checklist:

  • This PR has no breaking changes.
  • I have added my changes to the CHANGELOG or a CHANGELOG entry is not required.

m-mohr and others added 2 commits December 7, 2025 16:56
This PR proposes adding an optional `type` query parameter to the `/children` endpoint to support filtering results by resource type (e.g., `Catalog` or `Collection`).

### Motivation

While the specification recommends separating different types into different hierarchy branches as a best practice, real-world data organization often results in "mixed content" folders (e.g., a Project Catalog containing both sub-project Catalogs and direct Dataset Collections).

In dynamic, database-backed APIs (like those using Elasticsearch), retrieving and paginating mixed-type lists can be computationally expensive and complex to implement.

Adding a standard `type` parameter allows:
1.  **Backend Optimization:** Implementations can execute efficient, type-specific queries (e.g., `type: "Catalog"`) rather than fetching all children and filtering in memory.
2.  **Client Flexibility:** Clients can request only the resource type they are interested in (e.g., "Show me sub-folders" vs. "Show me datasets") without receiving unwanted data.
3.  **Standardization:** Prevents the proliferation of custom filter parameters (e.g., `?kind=`, `?filter=`) across different implementations.

### Proposed Change

Add a section detailing the `type` parameter:

#### Filtering by Type
Implementations MAY support a `type` query parameter to allow clients to request a specific resource type.

* `GET .../children?type=Catalog`
* `GET .../children?type=Collection`
Copy link
Contributor

@m-mohr m-mohr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'm fine with the functionality in general, but as it's optional clients may run into issues as they don't know whether it's supported or not. As such, I'd propose to make it an optional conformance class. Something like https://api.stacspec.org/v1.0.0-rc.2/children#type-filter. Should be listed at the top and in the section.

Additionally, you'd need to update the TOC and the OpenAPI document.

Co-authored-by: Matthias Mohr <[email protected]>
@jonhealy1 jonhealy1 requested a review from m-mohr December 9, 2025 15:07
@m-mohr
Copy link
Contributor

m-mohr commented Dec 9, 2025

Additionally, you'd need to update the TOC and the OpenAPI document.

@jonhealy1 I think this^ is still open. Now that #6 is merged, the CI also fails due to the outdated TOC, I think. Can you please update this PR accordingly? Otherwise, I think it looks good.

Changed the base after the merging #6 and tried to resolve the conflicts...

@m-mohr m-mohr deleted the branch stac-api-extensions:main December 9, 2025 21:02
@m-mohr m-mohr closed this Dec 9, 2025
@m-mohr m-mohr reopened this Dec 9, 2025
@m-mohr m-mohr changed the base branch from generalize to main December 9, 2025 21:05
m-mohr and others added 6 commits December 9, 2025 22:09
Updated the section header for 'Filtering by Type' to use proper Markdown formatting.
Added 'type' query parameter to filter catalogs or collections.
Formatted parameters section for consistency.
@jonhealy1
Copy link
Contributor Author

@m-mohr Passing :)

README.md Outdated
Comment on lines 233 to 249
{
"rel": "children",
"type": "application/json",
"href": "https://stac-api.example/drones/children"
},
{
"rel": "child",
"type": "application/json",
"title": "Flight 1",
"href": "https://stac-api.example/drones/filght-1"
},
{
"rel": "child",
"type": "application/json",
"title": "Flight 2",
"href": "https://stac-api.example/drones/flight-2"
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The links seem to be duplicate.

@jonhealy1 jonhealy1 requested a review from m-mohr December 11, 2025 04:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants