1
1
mirror of https://github.com/go-gitea/gitea synced 2025-09-21 08:08:14 +00:00

fix: add author.name field to Swift Package Registry API response (#35410) (#35431)

Backport #35410 by ahanoff

Fixes #35159

Swift Package Manager expects an 'author.name' field in package
metadata, but Gitea was only providing schema.org format fields
(givenName, middleName, familyName). This caused SPM to fail with
keyNotFound error when fetching package metadata.

Changes:
- Add 'name' field to Person struct (inherited from
https://schema.org/Thing)
- Populate 'name' field in API response using existing String() method
- Maintains backward compatibility with existing schema.org fields
- Provides both formats for maximum compatibility

The fix ensures Swift Package Manager can successfully resolve packages
while preserving full schema.org compliance.

Co-authored-by: Akhan Zhakiyanov <ahanoff@gmail.com>
This commit is contained in:
Giteabot
2025-09-08 03:37:53 +08:00
committed by GitHub
parent 3c7e7a19dd
commit 89c99a4dcb
4 changed files with 89 additions and 1 deletions

View File

@@ -230,6 +230,7 @@ func PackageVersionMetadata(ctx *context.Context) {
},
Author: swift_module.Person{
Type: "Person",
Name: metadata.Author.String(),
GivenName: metadata.Author.GivenName,
MiddleName: metadata.Author.MiddleName,
FamilyName: metadata.Author.FamilyName,