Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
7 tasks
cez81 opened this issue May 13, 2017 · 8 comments · Fixed by #1722
Closed
7 tasks

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

cez81 opened this issue May 13, 2017 · 8 comments · Fixed by #1722
Labels
Milestone

Comments

@cez81
Copy link
Contributor

cez81 commented 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.

@sapk
Copy link
Member

sapk commented 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)

@cez81
Copy link
Contributor Author

cez81 commented 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.

@sapk
Copy link
Member

sapk commented May 14, 2017

Quickly looking that should come from #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
Copy link
Member

sapk commented May 14, 2017

Also #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 sapk mentioned this issue May 14, 2017
@lunny lunny added the type/bug label May 14, 2017
@lunny lunny added this to the 1.2.0 milestone May 14, 2017
@cez81
Copy link
Contributor Author

cez81 commented May 14, 2017

I'm still still getting a few differences when compiling 91417e9
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": {

@sapk
Copy link
Member

sapk commented May 14, 2017

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

@sapk
Copy link
Member

sapk commented 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
Copy link
Member

sapk commented May 14, 2017

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

@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants