Skip to content

Collection validation accepts invalid renders as long as one render is valid #38

Open

Description

@chuckwondo

In Collections, the schema accepts a renders object as long as at least one of its renders is valid, so every render but one can be invalid, yet still pass validation.

For example, the following Collection passes the render schema's validation (v2.1.0 here, and v1.0.0 behaves the same), but shouldn't because its invalid render assigns bidx an integer instead of an array:

{
  "type": "Collection",
  "stac_extensions": ["https://stac-extensions.github.io/render/v2.1.0/schema.json"],
  "item_assets": {"data": {}},
  "renders": {
    "valid": {"assets": ["data"], "bidx": [1]},
    "invalid": {"assets": ["data"], "bidx": 1}
  }
}

Remove the valid render, and the Collection fails validation, as expected.

The schema's oneOf alternative for Collections wraps the render check in a double negation, which reads as "not every render fails", i.e., at least one passes:

"renders": {
  "type": "object",
  "not": {
    "additionalProperties": {
      "not": {
        "allOf": [
          {"$ref": "#/definitions/require_any_field"},
          {"$ref": "#/definitions/fields"}
        ]
      }
    }
  }
}

The alternative for Items validates every render:

"renders": {
  "type": "object",
  "additionalProperties": {"$ref": "#/definitions/fields"}
}

The Collection rule, $comment included, matches the one the extension template used for Collection assets from stac-extensions/template@c0f506b until stac-extensions/template#36 replaced it. For assets, "at least one" made sense, because not every asset has to use an extension. Every entry in renders is a render object, though.

Suggested fix: Use the Items alternative's renders rule for Collections too.

Activity

  1. chuckwondo commented on Nov 10, 2026

    @chuckwondo
    Author

    @emmanuelmathot, @vincentsarago, or @m-mohr, any thoughts on this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions