1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448
|
openapi: 3.0.0
info:
title: Swift Package Registry
version: "1"
externalDocs:
description: Swift Evolution Proposal SE-0292
url: https://github.com/apple/swift-evolution/blob/main/proposals/0292-package-registry-service.md
servers:
- url: https://packages.swift.org
paths:
"/{scope}/{name}":
parameters:
- $ref: "#/components/parameters/scope"
- $ref: "#/components/parameters/name"
get:
tags:
- Package
summary: List package releases
operationId: listPackageReleases
parameters:
- name: Content-Type
in: header
schema:
type: string
enum:
- application/vnd.swift.registry.v1+json
responses:
"200":
description: ""
headers:
Content-Version:
$ref: "#/components/headers/contentVersion"
Content-Length:
schema:
type: integer
content:
application/json:
schema:
$ref: "#/components/schemas/releases"
examples:
default:
$ref: "#/components/examples/releases"
4XX:
$ref: "#/components/responses/problemDetails"
"/{scope}/{name}/{version}":
parameters:
- $ref: "#/components/parameters/scope"
- $ref: "#/components/parameters/name"
- $ref: "#/components/parameters/version"
get:
tags:
- Release
summary: Fetch release metadata
operationId: fetchReleaseMetadata
parameters:
- name: Content-Type
in: header
schema:
type: string
enum:
- application/vnd.swift.registry.v1+json
responses:
"200":
description: ""
headers:
Content-Version:
$ref: "#/components/headers/contentVersion"
Content-Length:
schema:
type: integer
content:
application/json:
schema:
type: object
examples:
default:
$ref: "#/components/examples/metadata"
4XX:
$ref: "#/components/responses/problemDetails"
put:
tags:
- Release
summary: Publish package release
operationId: publishPackageRelease
parameters:
- name: Content-Type
in: header
schema:
type: string
enum:
- multipart/form-data
responses:
"100":
description: ""
"201":
description: ""
headers:
Content-Version:
$ref: "#/components/headers/contentVersion"
Content-Length:
schema:
type: integer
content:
application/json:
schema:
$ref: "#/components/schemas/releases"
examples:
default:
$ref: "#/components/examples/releases"
"202":
description: ""
headers:
Content-Version:
$ref: "#/components/headers/contentVersion"
Location:
schema:
type: string
Retry-After:
schema:
type: integer
4XX:
$ref: "#/components/responses/problemDetails"
"/{scope}/{name}/{version}/Package.swift":
parameters:
- $ref: "#/components/parameters/scope"
- $ref: "#/components/parameters/name"
- $ref: "#/components/parameters/version"
get:
tags:
- Release
summary: Fetch manifest for a package release
operationId: fetchManifestForPackageRelease
parameters:
- name: Content-Type
in: header
schema:
type: string
enum:
- application/vnd.swift.registry.v1+swift
- $ref: "#/components/parameters/swift_version"
responses:
"200":
description: ""
headers:
Cache-Control:
schema:
type: string
Content-Disposition:
schema:
type: string
Content-Length:
schema:
type: integer
Content-Version:
$ref: "#/components/headers/optionalContentVersion"
Link:
schema:
type: string
content:
text/x-swift:
schema:
type: string
examples:
default:
$ref: "#/components/examples/manifest"
4XX:
$ref: "#/components/responses/problemDetails"
"/{scope}/{name}/{version}.zip":
parameters:
- $ref: "#/components/parameters/scope"
- $ref: "#/components/parameters/name"
- $ref: "#/components/parameters/version"
get:
tags:
- Release
summary: Download source archive
operationId: downloadSourceArchive
parameters:
- name: Content-Type
in: header
schema:
type: string
enum:
- application/vnd.swift.registry.v1+zip
responses:
"200":
description: ""
headers:
Accept-Ranges:
schema:
type: string
Cache-Control:
schema:
type: string
Content-Disposition:
schema:
type: string
Content-Length:
schema:
type: integer
Content-Version:
$ref: "#/components/headers/optionalContentVersion"
Digest:
required: true
schema:
type: string
Link:
schema:
type: string
content:
application/zip:
schema:
type: string
format: binary
3XX:
$ref: "#/components/responses/redirect"
4XX:
$ref: "#/components/responses/problemDetails"
/identifiers:
parameters:
- $ref: "#/components/parameters/url"
get:
tags:
- Package
summary: Lookup package identifiers registered for a URL
operationId: lookupPackageIdentifiersByURL
parameters:
- name: Content-Type
in: header
schema:
type: string
enum:
- application/vnd.swift.registry.v1+json
responses:
"200":
description: ""
headers:
Content-Version:
$ref: "#/components/headers/contentVersion"
content:
application/json:
schema:
$ref: "#/components/schemas/identifiers"
examples:
default:
$ref: "#/components/examples/identifiers"
4XX:
$ref: "#/components/responses/problemDetails"
components:
schemas:
releases:
type: object
example:
releases:
1.1.0: https://swift.pkg.github.com/mona/LinkedList/1.1.0
properties:
releases:
type: object
required:
- releases
identifiers:
type: object
example:
identifiers:
- "mona.LinkedList"
properties:
identifiers:
type: array
items:
type: string
required:
- identifiers
problem:
type: object
externalDocs:
url: https://tools.ietf.org/html/rfc7807
example:
instance: /account/12345/msgs/abc
balance: 30
type: https://example.com/probs/out-of-credit
title: You do not have enough credit.
accounts:
- /account/12345
- /account/67890
detail: Your current balance is 30, but that costs 50.
properties:
type:
type: string
format: uriref
title:
type: string
status:
type: number
instance:
type: string
detail:
type: string
required:
- detail
- instance
- status
- title
- type
responses:
problemDetails:
description: A client error.
headers:
Content-Version:
$ref: "#/components/headers/contentVersion"
Content-Language:
schema:
type: string
Content-Length:
schema:
type: integer
content:
application/problem+json:
schema:
$ref: "#/components/schemas/problem"
redirect:
description: A server redirect.
headers:
Content-Version:
$ref: "#/components/headers/contentVersion"
Location:
schema:
type: string
Digest:
schema:
type: string
Content-Length:
schema:
type: integer
parameters:
scope:
name: scope
in: path
required: true
schema:
type: string
example: "mona"
pattern: \A[a-zA-Z\d](?:[a-zA-Z\d]|-(?=[a-zA-Z\d])){0,38}\z
name:
name: name
in: path
required: true
schema:
type: string
example: LinkedList
pattern: \A[a-zA-Z0-9](?:[a-zA-Z0-9]|[-_](?=[a-zA-Z0-9])){0,99}\z
version:
name: version
in: path
required: true
schema:
type: string
externalDocs:
description: Semantic Version number
url: https://semver.org
example: 1.0.0-beta.1
pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
swift_version:
name: swift-version
in: query
schema:
type: string
example: 1.2.3
pattern: \d+(?:\.(\d+)){0,2}
url:
name: url
in: query
required: true
schema:
type: string
format: url
example: https://github.com/mona/LinkedList
examples:
releases:
value:
releases:
1.1.1:
url: https://swift.pkg.github.com/mona/LinkedList/1.1.1
1.1.0:
problem:
status: 410
title: Gone
detail: this release was removed from the registry
url: https://swift.pkg.github.com/mona/LinkedList/1.1.0
1.0.0:
url: https://swift.pkg.github.com/mona/LinkedList/1.0.0
manifest:
value: >-
// swift-tools-version:5.0
import PackageDescription
let package = Package(
name: "LinkedList",
products: [
.library(name: "LinkedList", targets: ["LinkedList"])
],
targets: [
.target(name: "LinkedList"),
.testTarget(name: "LinkedListTests", dependencies: ["LinkedList"]),
],
swiftLanguageVersions: [.v4, .v5]
)
metadata:
value:
keywords:
- data-structure
- collection
version: 1.1.1
"@type": SoftwareSourceCode
author:
"@type": Person
"@id": https://github.com/mona
middleName: Lisa
givenName: Mona
familyName: Octocat
license: https://www.apache.org/licenses/LICENSE-2.0
programmingLanguage:
url: https://swift.org
name: Swift
"@type": ComputerLanguage
codeRepository: https://github.com/mona/LinkedList
"@context":
- http://schema.org/
description: One thing links to another.
name: LinkedList
identifiers:
value:
identifiers:
- "mona.LinkedList"
headers:
contentVersion:
required: true
schema:
type: string
enum:
- "1"
optionalContentVersion:
required: false
schema:
type: string
enum:
- "1"
|