From 12d7ea3f63077fccf5861646f15391373a8bb3b2 Mon Sep 17 00:00:00 2001 From: Paul Hildebrandt Date: Tue, 17 Dec 2024 12:15:08 +0100 Subject: [PATCH] mediatype-for-existing-index Signed-off-by: Paul Hildebrandt --- src/registry.py | 2 ++ src/schemas.py | 1 + 2 files changed, 3 insertions(+) diff --git a/src/registry.py b/src/registry.py index 9e3e0c1..84a714b 100644 --- a/src/registry.py +++ b/src/registry.py @@ -195,6 +195,8 @@ def get_index(self, allowed_media_type: Optional[list[str]] = None): try: self._check_200_response(response) index = response.json() + # Ensure mediaType is set for existing indices + index["mediaType"] = "application/vnd.oci.image.index.v1+json" return index except ValueError: diff --git a/src/schemas.py b/src/schemas.py index dcb5624..b6306af 100644 --- a/src/schemas.py +++ b/src/schemas.py @@ -33,6 +33,7 @@ "required": [ "schemaVersion", "manifests", + "mediaType", ], "properties": indexProperties, "additionalProperties": True,