-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Description
Description
I am using a local Gitea server to host a Swift Package registry. I successfully uploaded a binary Swift package to the registry, but when attempting to fetch the package, the operation fails with the following error:
Computing version for controller.Redacted
error: failed fetching controller.Redacted version 25.4100.267 release information from https://redacted/api/packages/redaced/swift: keyNotFound(CodingKeys(stringValue: "name", intValue: nil), Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "metadata", intValue: nil), CodingKeys(stringValue: "author", intValue: nil)], debugDescription: "No value associated with key CodingKeys(stringValue: "name", intValue: nil) ("name").", underlyingError: nil))
Issue Details
- The error message indicates that the
"author"
field is missing the"name"
subfield. - When I upload metadata containing
"author.name"
, it is not reflected in the server’s response. - If I provide
"author.givenName"
in the format specified by schema.org , it appears in the server response, but the Swift Package Manager (SPM) does not recognize it. - By editing SPM’s source code to use
"givenName"
instead of"name"
, everything works as expected.
Root Cause
There is a mismatch between the JSON schema references in different documentation sources:
- The Gitea documentation follows a schema that uses
"givenName"
,"familyName"
, and"additionalName"
fields for the author. - In contrast, the Swift Package Registry documentation specifies a simpler schema with just the
"name"
field for the author.
Expected Behavior
Gitea’s Swift Package Registry implementation should conform to the schema expected by Swift Package Manager, specifically providing an "author.name"
field in the package metadata. Gitea documentation should also be updated.
Steps to Reproduce
- Host a Swift Package Registry using Gitea.
- Upload a binary Swift package with metadata including
"author.name"
.
swift package-registry publish --metadata-path metadata.json scope.packageName 25.4100.267
- Attempt to fetch the package using Swift Package Manager.
swift package resolve
Gitea Version
1.24.3
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots
No response
Git Version
–
Operating System
macOS 15.5
How are you running Gitea?
I am using self-hosted version of Gitea installed via Homebrew
Database
None