[PR #4845] [MERGED] Fix Swagger JSON autogeneration issues. #17516

Closed
opened 2025-11-02 13:49:33 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/4845
Author: @zeripath
Created: 9/2/2018
Status: Merged
Merged: 10/21/2018
Merged by: @techknowlogick

Base: masterHead: swagger-json-autogeneration-fixes


📝 Commits (7)

  • f6aa0e3 Fix Swagger JSON.
  • 28edf7e Fix swagger API for CreateAccessToken
  • ea3112c Fix admin create org swagger
  • 77b05bf Fix swagger for adminCreateRepo
  • fd231f7 More swagger fixes
  • d7e86e6 Fix swagger description of GET /repos/{owner}/{repo}/pulls
  • 9d1a4ee Merge branch 'master' into swagger-json-autogeneration-fixes

📊 Changes

23 files changed (+298 additions, -66 deletions)

View changed files

📝 routers/api/v1/admin/org.go (+4 -0)
📝 routers/api/v1/admin/repo.go (+4 -0)
📝 routers/api/v1/admin/user.go (+5 -0)
📝 routers/api/v1/org/hook.go (+12 -0)
📝 routers/api/v1/org/member.go (+0 -12)
📝 routers/api/v1/org/team.go (+8 -2)
📝 routers/api/v1/repo/hook.go (+4 -0)
📝 routers/api/v1/repo/issue.go (+3 -4)
📝 routers/api/v1/repo/issue_comment.go (+6 -0)
📝 routers/api/v1/repo/issue_label.go (+6 -0)
📝 routers/api/v1/repo/issue_tracked_time.go (+2 -0)
📝 routers/api/v1/repo/key.go (+2 -0)
📝 routers/api/v1/repo/label.go (+3 -0)
📝 routers/api/v1/repo/milestone.go (+3 -0)
📝 routers/api/v1/repo/pull.go (+31 -4)
📝 routers/api/v1/repo/release.go (+3 -0)
📝 routers/api/v1/repo/release_attachment.go (+8 -0)
📝 routers/api/v1/repo/repo.go (+2 -0)
📝 routers/api/v1/user/app.go (+10 -0)
📝 routers/api/v1/user/gpg_key.go (+2 -0)

...and 3 more files

📄 Description

When autogenerating a swager client from the current swagger.v1.json, at least in Java, there is an issue whereby the use of schema references for the forbidden and empty responses leads to a broken client being created due to swagger believing that these represent an unspecified object. This pull requests removes these unnecessary schema references for the API references where a description for the empty/forbidden responses is provided.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/gitea/pull/4845 **Author:** [@zeripath](https://github.com/zeripath) **Created:** 9/2/2018 **Status:** ✅ Merged **Merged:** 10/21/2018 **Merged by:** [@techknowlogick](https://github.com/techknowlogick) **Base:** `master` ← **Head:** `swagger-json-autogeneration-fixes` --- ### 📝 Commits (7) - [`f6aa0e3`](https://github.com/go-gitea/gitea/commit/f6aa0e3775f547ee70f954ba5a84cbdd4b16c188) Fix Swagger JSON. - [`28edf7e`](https://github.com/go-gitea/gitea/commit/28edf7e203a89f25524f5c435fe20318758c2542) Fix swagger API for CreateAccessToken - [`ea3112c`](https://github.com/go-gitea/gitea/commit/ea3112cde720472ef203ef19507c6ff0a98bce3b) Fix admin create org swagger - [`77b05bf`](https://github.com/go-gitea/gitea/commit/77b05bf57271c54b2908dc752b89b9119545df11) Fix swagger for adminCreateRepo - [`fd231f7`](https://github.com/go-gitea/gitea/commit/fd231f7aae3ce39883ebbdfd5dabab3cb5ccae90) More swagger fixes - [`d7e86e6`](https://github.com/go-gitea/gitea/commit/d7e86e6b02702cfe52051ecf45c7aef87cefd71b) Fix swagger description of GET /repos/{owner}/{repo}/pulls - [`9d1a4ee`](https://github.com/go-gitea/gitea/commit/9d1a4ee9dcbf078aeb285876ce446b50bba5e7d9) Merge branch 'master' into swagger-json-autogeneration-fixes ### 📊 Changes **23 files changed** (+298 additions, -66 deletions) <details> <summary>View changed files</summary> 📝 `routers/api/v1/admin/org.go` (+4 -0) 📝 `routers/api/v1/admin/repo.go` (+4 -0) 📝 `routers/api/v1/admin/user.go` (+5 -0) 📝 `routers/api/v1/org/hook.go` (+12 -0) 📝 `routers/api/v1/org/member.go` (+0 -12) 📝 `routers/api/v1/org/team.go` (+8 -2) 📝 `routers/api/v1/repo/hook.go` (+4 -0) 📝 `routers/api/v1/repo/issue.go` (+3 -4) 📝 `routers/api/v1/repo/issue_comment.go` (+6 -0) 📝 `routers/api/v1/repo/issue_label.go` (+6 -0) 📝 `routers/api/v1/repo/issue_tracked_time.go` (+2 -0) 📝 `routers/api/v1/repo/key.go` (+2 -0) 📝 `routers/api/v1/repo/label.go` (+3 -0) 📝 `routers/api/v1/repo/milestone.go` (+3 -0) 📝 `routers/api/v1/repo/pull.go` (+31 -4) 📝 `routers/api/v1/repo/release.go` (+3 -0) 📝 `routers/api/v1/repo/release_attachment.go` (+8 -0) 📝 `routers/api/v1/repo/repo.go` (+2 -0) 📝 `routers/api/v1/user/app.go` (+10 -0) 📝 `routers/api/v1/user/gpg_key.go` (+2 -0) _...and 3 more files_ </details> ### 📄 Description When autogenerating a swager client from the current swagger.v1.json, at least in Java, there is an issue whereby the use of schema references for the forbidden and empty responses leads to a broken client being created due to swagger believing that these represent an unspecified object. This pull requests removes these unnecessary schema references for the API references where a description for the empty/forbidden responses is provided. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-02 13:49:33 -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#17516