1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Add package version api endpoints (#34173)

Fixes #33544

Adds two new api endpoints to list a versions of a package and to get
the latest version of a package by API.

⚠️ BREAKING ⚠️ 
the `size` field for this endpoint changes from `Size` to `size`.
This commit is contained in:
KN4CK3R
2025-04-13 22:00:44 +02:00
committed by GitHub
parent 34349c085c
commit bec9233c29
5 changed files with 334 additions and 80 deletions

View File

@@ -3339,6 +3339,104 @@
}
}
},
"/packages/{owner}/{type}/{name}": {
"get": {
"produces": [
"application/json"
],
"tags": [
"package"
],
"summary": "Gets all versions of a package",
"operationId": "listPackageVersions",
"parameters": [
{
"type": "string",
"description": "owner of the package",
"name": "owner",
"in": "path",
"required": true
},
{
"type": "string",
"description": "type of the package",
"name": "type",
"in": "path",
"required": true
},
{
"type": "string",
"description": "name of the package",
"name": "name",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "page number of results to return (1-based)",
"name": "page",
"in": "query"
},
{
"type": "integer",
"description": "page size of results",
"name": "limit",
"in": "query"
}
],
"responses": {
"200": {
"$ref": "#/responses/PackageList"
},
"404": {
"$ref": "#/responses/notFound"
}
}
}
},
"/packages/{owner}/{type}/{name}/-/latest": {
"get": {
"produces": [
"application/json"
],
"tags": [
"package"
],
"summary": "Gets the latest version of a package",
"operationId": "getLatestPackageVersion",
"parameters": [
{
"type": "string",
"description": "owner of the package",
"name": "owner",
"in": "path",
"required": true
},
{
"type": "string",
"description": "type of the package",
"name": "type",
"in": "path",
"required": true
},
{
"type": "string",
"description": "name of the package",
"name": "name",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"$ref": "#/responses/Package"
},
"404": {
"$ref": "#/responses/notFound"
}
}
}
},
"/packages/{owner}/{type}/{name}/-/link/{repo_name}": {
"post": {
"tags": [
@@ -24386,10 +24484,6 @@
"description": "PackageFile represents a package file",
"type": "object",
"properties": {
"Size": {
"type": "integer",
"format": "int64"
},
"id": {
"type": "integer",
"format": "int64",
@@ -24414,6 +24508,11 @@
"sha512": {
"type": "string",
"x-go-name": "HashSHA512"
},
"size": {
"type": "integer",
"format": "int64",
"x-go-name": "Size"
}
},
"x-go-package": "code.gitea.io/gitea/modules/structs"