Foundation-free Swift value types for GitHub REST API contracts.
This package belongs to the Swift Institute Standards layer. It preserves GitHub's published wire vocabulary while leaving transport, authentication, retries, and application persistence to higher layers.
| Product | Module | Purpose |
|---|---|---|
| GitHub Standard | GitHub_Standard |
GitHub request, response, identifier, OAuth, user, repository, traffic, and stargazer contracts |
Add the package and depend on the GitHub Standard product:
dependencies: [
.package(
url: "https://github.com/swift-standards/swift-github-standard.git",
branch: "main"
)
].target(
name: "YourTarget",
dependencies: [
.product(
name: "GitHub Standard",
package: "swift-github-standard"
)
]
)Repository traffic and stargazer history are distinct GitHub domains:
import GitHub_Standard
let views = GitHub.Repository.Traffic.Views.Request(
owner: .init(rawValue: "swiftlang"),
repository: .init(rawValue: "swift"),
interval: .day
)
let stargazers = GitHub.Repository.Stargazers.Request(
owner: .init(rawValue: "swiftlang"),
repository: .init(rawValue: "swift"),
page: .first,
size: .maximum
)Traffic counts use UInt64, timestamps use RFC_3339.DateTime, and provider
URIs use RFC_3986.URI. The package does not normalize those values into
Foundation or application persistence types.
Repository metadata is returned by both
GitHub.Repository.Get and GitHub.User.Repositories. The latter models the
authenticated-user repository collection, including GitHub's visibility, type,
sort, direction, and timestamp filters.
GitHub's OAuth authorization and token exchange contracts live under
GitHub.OAuth. The authenticated profile and email endpoints retain the
provider's Users API vocabulary under GitHub.User.Authenticated; they are
consumed by OAuth flows but are not token endpoints.
GitHub_Standard defines contracts only. Typed clients live in
swift-github, and the HTTP
binding lives in
swift-github-http.
No deprecated GitHub Types, GitHub Traffic, GitHub Stargazers, or
GitHub Repositories compatibility products are provided.
This package is available under the MIT license.