Add public/swagger.v1.json to .gitignore? #709

Closed
opened 2025-11-02 03:33:48 -06:00 by GiteaMirror · 8 comments
Owner

Originally created by @cez81 on GitHub (May 13, 2017).

Description

Should public/swagger.v1.json be removed and added to .gitignore? Or should it be checked in after modifying the API? It's modified during compilation even though I haven't changed anything in the current branch.

Originally created by @cez81 on GitHub (May 13, 2017). - Gitea version (or commit ref): 9e627af - Git version: N/A - Operating system: N/A - Database (use `[x]`): N/A - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: N/A - [ ] Yes (provide example URL) - [ ] No - [ ] Not relevant - Log gist: https://gist.github.com/cez81/c5248b900e4588285806c4f854aeadc5 ## Description Should public/swagger.v1.json be removed and added to .gitignore? Or should it be checked in after modifying the API? It's modified during compilation even though I haven't changed anything in the current branch.
GiteaMirror added the type/bug label 2025-11-02 03:33:48 -06:00
Author
Owner

@sapk commented on GitHub (May 13, 2017):

I think that swagger file should be in git. It's generated via go generate and based on specific comments and if no change are made there it should stay the same. I think of it like css and less file but maybe we could separate it build from go generate and have a specific make task. Can you give a example of what trigger a change in the json ? (because it hasn't occur in PR since it was introduce)

@sapk commented on GitHub (May 13, 2017): I think that swagger file should be in git. It's generated via go generate and based on specific comments and if no change are made there it should stay the same. I think of it like css and less file but maybe we could separate it build from go generate and have a specific make task. Can you give a example of what trigger a change in the json ? (because it hasn't occur in PR since it was introduce)
Author
Owner

@cez81 commented on GitHub (May 13, 2017):

I didn't change anything in the branch. Just built on fresh branch from master today. You can see the difference in the linked gist. Might just be some recent PRs that should have checked in new revisions.

@cez81 commented on GitHub (May 13, 2017): I didn't change anything in the branch. Just built on fresh branch from master today. You can see the difference in the linked gist. Might just be some recent PRs that should have checked in new revisions.
Author
Owner

@sapk commented on GitHub (May 14, 2017):

Quickly looking that should come from go-gitea/gitea#1687 and go-gitea/go-sdk#58 that updated some api response format and not regenerated swagger (make generate). I will make a quick PR to fix that.

@sapk commented on GitHub (May 14, 2017): Quickly looking that should come from go-gitea/gitea#1687 and go-gitea/go-sdk#58 that updated some api response format and not regenerated swagger (make generate). I will make a quick PR to fix that.
Author
Owner

@sapk commented on GitHub (May 14, 2017):

Also go-gitea/gitea#1668 go-gitea/go-sdk#56.
When all structs will be documented it will be easier to catch when documentation need to be updated/generated

@sapk commented on GitHub (May 14, 2017): Also go-gitea/gitea#1668 go-gitea/go-sdk#56. When all structs will be documented it will be easier to catch when documentation need to be updated/generated
Author
Owner

@cez81 commented on GitHub (May 14, 2017):

I'm still still getting a few differences when compiling 91417e9715
Could this be cause of different versions or something? I've got Swagger a699dd8235f59a65ff532686f97bb6701baec671 and go1.8.1 linux/amd64

✔ ~/go/src/code.gitea.io/gitea [master|✚ 1⚑ 2] 
12:16 $ git diff public/swagger.v1.json
diff --git a/public/swagger.v1.json b/public/swagger.v1.json
index 6f8f30fc..6dd62471 100644
--- a/public/swagger.v1.json
+++ b/public/swagger.v1.json
@@ -953,15 +953,12 @@
           "x-go-name": "OpenIssues"
         },
         "owner": {
-          "x-go-name": "Owner",
           "$ref": "#/definitions/User"
         },
         "parent": {
-          "x-go-name": "Parent",
           "$ref": "#/definitions/Repository"
         },
         "permissions": {
-          "x-go-name": "Permissions",
           "$ref": "#/definitions/Permission"
         },
         "private": {

@cez81 commented on GitHub (May 14, 2017): I'm still still getting a few differences when compiling 91417e971553ca0a4862fb42188a816a2ea86277 Could this be cause of different versions or something? I've got Swagger a699dd8235f59a65ff532686f97bb6701baec671 and go1.8.1 linux/amd64 ``` ✔ ~/go/src/code.gitea.io/gitea [master|✚ 1⚑ 2] 12:16 $ git diff public/swagger.v1.json diff --git a/public/swagger.v1.json b/public/swagger.v1.json index 6f8f30fc..6dd62471 100644 --- a/public/swagger.v1.json +++ b/public/swagger.v1.json @@ -953,15 +953,12 @@ "x-go-name": "OpenIssues" }, "owner": { - "x-go-name": "Owner", "$ref": "#/definitions/User" }, "parent": { - "x-go-name": "Parent", "$ref": "#/definitions/Repository" }, "permissions": { - "x-go-name": "Permissions", "$ref": "#/definitions/Permission" }, "private": { ```
Author
Owner

@sapk commented on GitHub (May 14, 2017):

You are right updating go-swagger result to have the same change in json ...

@sapk commented on GitHub (May 14, 2017): You are right updating go-swagger result to have the same change in json ...
Author
Owner

@sapk commented on GitHub (May 14, 2017):

And since repo contain link to a other repo i think i will have to do the same fix to limit recursive bug in swagger.

@sapk commented on GitHub (May 14, 2017): And since repo contain link to a other repo i think i will have to do the same fix to limit recursive bug in swagger.
Author
Owner

@sapk commented on GitHub (May 14, 2017):

Change made in go-swagger/go-swagger#994. I will have to do an other PR. sorry ^^

@sapk commented on GitHub (May 14, 2017): Change made in go-swagger/go-swagger#994. I will have to do an other PR. sorry ^^
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#709