Incomplete / Misleading Hooks section documentation in Swagger #4337

Closed
opened 2025-11-02 05:46:45 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @pecastro on GitHub (Nov 15, 2019).

HI,

  • Gitea version 1.9.3
  • Git version: Not relevant
  • Operating system:
  • Database (use [x]):
    • [x ] PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • [x ] Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

The swagger definitions for all of the hooks API's are incomplete and wrong.

curl -H "accept: application/json" -X GET "http://user:password@gitea.xxx.xxx/api/v1/repos/TestOrg/TestRepo/hooks/1" | jq .
{
  "id": 1,
  "type": "gitea",
  "config": {
    "content_type": "json",
    "url": "http://jenkins.xxx.xxx/gitea-webhook/post"
  },
  "events": [
    "push"
  ],
  "active": true,
  "updated_at": "2019-11-03T23:15:32Z",
  "created_at": "2019-11-03T23:09:59Z"
}

Screenshots

image

content_type is a required field also not mentioned in Swagger.

Originally created by @pecastro on GitHub (Nov 15, 2019). HI, - Gitea version 1.9.3 - Git version: Not relevant - Operating system: - Database (use `[x]`): - [x ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [x ] Yes (provide example URL) - [ ] No - [ ] Not relevant - Log gist: ## Description The swagger definitions for all of the hooks API's are incomplete and wrong. ``` curl -H "accept: application/json" -X GET "http://user:password@gitea.xxx.xxx/api/v1/repos/TestOrg/TestRepo/hooks/1" | jq . { "id": 1, "type": "gitea", "config": { "content_type": "json", "url": "http://jenkins.xxx.xxx/gitea-webhook/post" }, "events": [ "push" ], "active": true, "updated_at": "2019-11-03T23:15:32Z", "created_at": "2019-11-03T23:09:59Z" } ``` ## Screenshots ![image](https://user-images.githubusercontent.com/352625/68982118-a08df680-07fd-11ea-9ebd-523f8f82c022.png) content_type is a required field also not mentioned in Swagger.
GiteaMirror added the type/docs label 2025-11-02 05:46:45 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#4337