Remove requirement of repository.id from server.json (#285)

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 <domdomegg@users.noreply.github.com>
This commit is contained in:
adam jones 2025-08-21 22:20:22 +01:00 • committed by GitHub
commit 6dad0e340a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 5 deletions

View file

@ -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"

View file

@ -8,8 +8,7 @@
"type": "object",
"required": [
"url",
"source",
"id"
"source"
],
"properties": {
"url": {

View file

@ -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