Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions data/json/ssvc_object_registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "SSVC Object Registry",
"definition": "A registry for SSVC objects organized by type, namespace, key, and version.",
"schemaVersion": "2.0.0",
"generatedAt": "2026-09-09T15:10:13.388981Z",
"types": {
"DecisionPoint": {
"type": "DecisionPoint",
Expand Down
6 changes: 6 additions & 0 deletions data/schema/v2/SsvcObjectRegistry_2_0_0.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,12 @@
"description": "The schema version of this selection list.",
"type": "string"
},
"generatedAt": {
"title": "Generatedat",
"description": "RFC 3339 timestamp indicating when the registry was generated.",
"format": "date-time",
"type": "string"
},
"types": {
"title": "Types",
"additionalProperties": {
Expand Down
11 changes: 11 additions & 0 deletions src/ssvc/registry/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
# DM24-0278

import logging
from datetime import datetime, timezone
from typing import Any, ClassVar, Literal, Optional, Union

import semver
Expand Down Expand Up @@ -137,6 +138,16 @@ class _NsType(BaseModel):

class SsvcObjectRegistry(_SchemaVersioned, _Base, BaseModel):
_schema_version: ClassVar[str] = SCHEMA_VERSION
generatedAt: str = Field(
default_factory=lambda: datetime.now(timezone.utc).isoformat().replace("+00:00", "Z"),
description="RFC 3339 timestamp indicating when the registry was generated.",
json_schema_extra={"format": "date-time"},
)
Comment thread
Copilot marked this conversation as resolved.
Resolved

def model_dump_json(self, *args, **kwargs) -> str:
# Refresh at serialization time so singleton registries record actual generation time.
self.generatedAt = datetime.now(timezone.utc).isoformat().replace("+00:00", "Z")
return super().model_dump_json(*args, **kwargs)
schemaVersion: Literal[SCHEMA_VERSION] = Field(
...,
description="The schema version of this selection list.",
Expand Down
Loading