Skip to content

Nsr/580/missing collection error#1029

Merged
naterubin merged 7 commits intostac-utils:mainfrom
naterubin:nsr/580/missing-collection-error
Feb 5, 2026
Merged

Nsr/580/missing collection error#1029
naterubin merged 7 commits intostac-utils:mainfrom
naterubin:nsr/580/missing-collection-error

Conversation

@naterubin
Copy link
Collaborator

Related Issue(s):

Proposed Changes:

  1. isItem throws an error if the collection field is not set. This logs a more helpful message than before, when this caused an OpenSearch error.
  2. Updated Quick Links section of README to point to valid links.

PR Checklist:

  • I have added my changes to the CHANGELOG or a CHANGELOG entry is not required.

Copy link
Collaborator

@theodorehreuter theodorehreuter left a comment

Choose a reason for hiding this comment

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

one minor nitpick regarding error message composition

export function isItem(record) {
return record && record.type === 'Feature'
if (record && record.type === 'Feature') {
if ('collection' in record) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm assuming we can't do any model validation and are just directly checking for the key since this is just vanilla JS?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Pretty much, yeah. There is a library (that is used in other places in stac-server) called zod that is pretty similar to pydantic in the JS world, but there isn't the level of integration with the web framework in this case as in the FastAPI world. I definitely thought about adding full on payload model validation, but that would be a significant addition and it felt like a lot for a small bugfix. Definitely open to creating a ticket suggesting adding it...

Copy link
Collaborator

Choose a reason for hiding this comment

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

I feel like all the model stuff should probably come with the typescript change over. I know that's gonna be a substantial move so not sure where that fits on the roadmap.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, that's a good point, the model/typing integration could work really well.

@naterubin naterubin added this pull request to the merge queue Feb 5, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 5, 2026
@naterubin naterubin added this pull request to the merge queue Feb 5, 2026
github-merge-queue bot pushed a commit that referenced this pull request Feb 5, 2026
* require Items to have collection

* Update invalid quick links in README

* update changelog

* update error message

* fix audit errors
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 5, 2026
@naterubin naterubin added this pull request to the merge queue Feb 5, 2026
Merged via the queue into stac-utils:main with commit 1a1936c Feb 5, 2026
1 check passed
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