-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Specific docs file type write #577
Conversation
Codecov Report
@@ Coverage Diff @@
## master #577 +/- ##
==========================================
+ Coverage 94.47% 94.53% +0.05%
==========================================
Files 9 9
Lines 2316 2341 +25
==========================================
+ Hits 2188 2213 +25
Misses 67 67
Partials 61 61
Continue to review full report at Codecov.
|
@jodlajodla Is there any open issue for this feature? I'm happy to see our users contributing to swag project, but i don't see any benefit here
As a workaround, I propose you should use a .gitignore into your project . or if you use a bash/makefile , you can run |
@ubogdan There is no any open issue for this as I checked. I contributed this because of my own needs for such feature. Your two points are completely valid, but the tests can be improved and the default generating of files is preserved after improvements - I see the generating of specific file as an advantage since additional code doesn't add much to code size and complexity. I implemented this feature just to get rid of the workaround you proposed, but if this doesn't get merged also no problem, I will keep using my fork - just sent this here in good faith if anyone else would need that. |
@easonlin404 what's your input regarding this. |
Just chiming in to say that this feature may be useful when documentation serving and generation is done "out of scope". In our use case we just require a Right now we are just removing those extraneous files using our Makefile, but it might be nice to be able to just target which type of file we want to generate. Just wanted to let you know a use-case for this feature, right now we are happy to just remove the useless files ourselves after generation. Do not feel obligated to act on this at all. Just wanted to give you some insights. |
@jodlajodla I will like to do a CR on your work, but I can't until the branch conflicts and imports like "github.com/jodlajodla/swag" get fixed. |
@ubogdan This should be resolved now. I see there were some changes to the files where I added the code. Will you merge them or can you wait for me to do this by the end of the week? |
@jodlajodla Please fix all the conflicts so I can review your PR. Take your time. |
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.
LGTM
@jodlajodla Thanks for your contribution! |
Would you mind updating the README.md regarding this new feature? |
I will do that tomorrow (Sunday). |
@jodlajodla That's fine. Take your time. |
@jodlajodla Thanks for your contribution. |
This PR propose one new feature and fix:
go
orjson
oryaml
. Defaults preserved to all file types.Reason for implemented feature:
Needed because I created my own handler for serving static files and the only file I need to show Swagger UI for my API is
docs.go
. I don't need other files, because I'm setting basic project/docs variables (name, version, description, ...) dynamically at the start of API/Docs server and afterswag init
they are not fully correct (as expected).