You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Related Issue(s):**
- #594
**Description:**
docs: clarify flat canonical URL structure for catalogs
- Explicitly state that nested routes (e.g. /catalogs/a/catalogs/b) are
not supported
- Update README examples to show canonical access pattern
- Fixes#594
**PR Checklist:**
- [x] Code is formatted and linted (run `pre-commit run --all-files`)
- [x] Tests pass (run `make test`)
- [x] Documentation has been updated to reflect changes, if applicable
- [x] Changes are added to the changelog
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
11
11
12
12
### Changed
13
13
14
+
- Updated catalog documentation to clarify that all catalogs use flat canonical endpoints (`/catalogs/{catalog_id}`) regardless of hierarchy depth. Nested routes like `/catalogs/id1/catalogs/id2` are not supported. Child discovery uses `/catalogs/{catalog_id}/catalogs` which returns links to canonical endpoints. [#596](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/596)
15
+
14
16
### Fixed
15
17
16
18
- Fixed bulk_sync_prep_create_item to properly detect duplicates across indexes. [#575](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/575)
Copy file name to clipboardExpand all lines: README.md
+20-5Lines changed: 20 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -418,9 +418,15 @@ To link an **existing** Catalog or Collection to a new parent, simply `POST` it
418
418
2.**If YES (Link):** The API adds the new parent to the resource's `parent_ids` list. No data is duplicated.
419
419
3.**If NO (Create):** The API creates a new resource.
420
420
421
+
#### Important: Flat Catalog URL Structure
422
+
423
+
All catalogs are accessed via the **flat canonical endpoint**`/catalogs/{catalog_id}`, regardless of their position in the hierarchy. Nested routes like `/catalogs/id1/catalogs/id2` are **not supported**. This ensures consistent, cacheable URLs regardless of catalog depth or parent relationships.
424
+
425
+
To discover a catalog's children, use `/catalogs/{catalog_id}/catalogs` or `/catalogs/{catalog_id}/children`, which returns links to the child catalogs' canonical endpoints.
426
+
421
427
#### Example: Creating a "Forestry" Playlist
422
428
423
-
Imagine you have an existing catalog `sentinel-2` stored under `providers/esa`. You want to create a curated "Forestry" catalog that includes this existing data.
429
+
Imagine you have an existing catalog `sentinel-2`. You want to create a curated "Forestry" catalog that includes this existing data.
424
430
425
431
```bash
426
432
# 1. Create the new Forestry catalog
@@ -445,13 +451,22 @@ curl -X POST "http://localhost:8081/catalogs/forestry/catalogs" \
445
451
"description": "Sentinel-2 satellite imagery",
446
452
"title": "Sentinel-2"
447
453
}'
454
+
455
+
# 3. Access the sentinel-2 catalog via its canonical endpoint
# This returns links to /catalogs/sentinel-2 (canonical endpoint)
448
461
```
449
462
450
-
**Result:** The sentinel-2 catalog is now accessible via both paths:
451
-
-`/catalogs/providers/esa/catalogs/sentinel-2`
452
-
-`/catalogs/forestry/catalogs/sentinel-2`
463
+
**Result:** The sentinel-2 catalog now has multiple parents (including forestry). It is always accessed via its canonical endpoint:
464
+
-`/catalogs/sentinel-2`
465
+
466
+
You can discover it as a child of forestry via:
467
+
-`/catalogs/forestry/catalogs` (lists sentinel-2 with a link to `/catalogs/sentinel-2`)
453
468
454
-
Because you are linking the node (the Catalog), the entire sub-tree attached to that node is automatically shared. If sentinel-2 contains millions of items and sub-catalogs, they are all instantly visible under the new forestry path without needing to re-link individual items.
469
+
Because you are linking the node (the Catalog), the entire sub-tree attached to that node is automatically shared. If sentinel-2 contains millions of items and sub-catalogs, they are all instantly visible under the new forestry parent without needing to re-link individual items.
455
470
456
471
> **Configuration**: The catalogs route can be enabled or disabled by setting the `ENABLE_CATALOGS_ROUTE` environment variable to `true` or `false`. By default, this endpoint is **disabled**.
0 commit comments