-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Separate generate swagger + fix sed os specific #1791
Separate generate swagger + fix sed os specific #1791
Conversation
For the build failing it seems that it's #1766 that change a func names and so any PR not rebased over that will failed (so not swagger). We can still separate swagger from go generate for overhead. |
Makefile
Outdated
@hash swagger > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ | ||
go get -u github.com/go-swagger/go-swagger/cmd/swagger; \ | ||
fi | ||
go generate $(PACKAGES) | ||
swagger generate spec -o ./public/swagger.v1.json | ||
sed -i "s;\".ref\": \"#/definitions/GPGKey\";\"type\": \"object\";g" ./public/swagger.v1.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to support sed
command for MacOS
version.
See https://github.com/appleboy/golang-testing/blob/master/coverage.sh#L130-L131
for compatibility with mac os default sed version. This is a little hacky a better solution could be use.
depending of platform detection
4b65a21
to
d1b6739
Compare
Ok this was rebase and ready to ship. @lunny can you confirm that this sed command works on mac os ? |
I confirmed that this fixed #1665 on macOS. LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work. I can confirm this PR working in Mac.
LGTM |
I suggest to remove generation of swagger file via
go generate
and make a separate make task.Making it in go generate permit that any change in comments would update the docs but it add some overhead and seems to failed on CI build (maybe from change introduce in go-swagger ?). :-(
With this change, people redacting api docs would have to do
make generate-swagger
to rebuild the swagger.json file.Related to : #1785 #1665