From 6dad0e340a20612b9c13e47fc3541fc5713fd5d4 Mon Sep 17 00:00:00 2001 From: adam jones Date: Thu, 21 Aug 2025 22:20:22 +0100 Subject: [PATCH] Remove requirement of repository.id from server.json (#285) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make repository.id optional by: - Removing 'id' from required fields in JSON schema - Adding omitempty tags to Go model structs - Updating examples to show simpler format without id This fixes publishing failures where the publisher tool doesn't generate repository.id but the schema requires it. Fixes #179 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: adam jones --- docs/server-json/examples.md | 3 +-- docs/server-json/schema.json | 3 +-- internal/model/model.go | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/server-json/examples.md b/docs/server-json/examples.md index fe44ed3..361c76d 100644 --- a/docs/server-json/examples.md +++ b/docs/server-json/examples.md @@ -9,8 +9,7 @@ "status": "active", "repository": { "url": "https://github.com/modelcontextprotocol/servers", - "source": "github", - "id": "abc123de-f456-7890-ghij-klmnopqrstuv" + "source": "github" }, "version_detail": { "version": "1.0.2" diff --git a/docs/server-json/schema.json b/docs/server-json/schema.json index 1d8e3cb..f139f39 100644 --- a/docs/server-json/schema.json +++ b/docs/server-json/schema.json @@ -8,8 +8,7 @@ "type": "object", "required": [ "url", - "source", - "id" + "source" ], "properties": { "url": { diff --git a/internal/model/model.go b/internal/model/model.go index ad38bee..752cde8 100644 --- a/internal/model/model.go +++ b/internal/model/model.go @@ -31,7 +31,7 @@ type PublishRequest struct { type Repository struct { URL string `json:"url" bson:"url"` Source string `json:"source" bson:"source"` - ID string `json:"id" bson:"id"` + ID string `json:"id,omitempty" bson:"id,omitempty"` } // ServerList represents the response for listing servers as defined in the spec