go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
45.3k stars 5.51k forks source link

Package upload APIs should be included in swagger docs #30597

Open Infinoid opened 7 months ago

Infinoid commented 7 months ago

Description

There are many API endpoints for uploading packages of various types. However, these endpoints are not described in the API swagger data, so they are not visible in the swagger UI.

Example: PUT https://gitea.example.com/api/packages/{owner}/debian/pool/{distribution}/{component}/upload is the endpoint for uploading a .deb package to an APT repository. It is described here on docs.gitea.com, but not here in the swagger docs.

Other examples include conda, generic, go.

Are these API endpoints treated differently because they exist under /api/packages/ rather than /api/v1/packages/? If so, can they be aliased?

Gitea Version

1.21.10, 1.23.0+dev-172-geb24d973b0

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

image

Git Version

No response

Operating System

No response

How are you running Gitea?

container image, and try.gitea.io

Database

None

lunny commented 7 months ago

But the protocol is this package's own standard. Should we list them?

KN4CK3R commented 7 months ago

It's not mentioned in swagger because what lunny says. But all packages which use curl in the examples may benefit from swagger because the package type does not have a buildin upload.

Infinoid commented 7 months ago

Yeah, you're both right. I'm thinking of the ones that use curl. The package types which have official and well-defined clients, like docker, don't need explicit documentation as much.

yp05327 commented 7 months ago

I think this is a proposal not a bug