-
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
Default required #1181
Default required #1181
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1181 +/- ##
==========================================
+ Coverage 94.96% 94.97% +0.01%
==========================================
Files 12 12
Lines 2520 2527 +7
==========================================
+ Hits 2393 2400 +7
Misses 69 69
Partials 58 58
Continue to review full report at Codecov.
|
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
cmd/swag/main.go
Outdated
@@ -26,6 +26,7 @@ const ( | |||
codeExampleFilesFlag = "codeExampleFiles" | |||
parseInternalFlag = "parseInternal" | |||
generatedTimeFlag = "generatedTime" | |||
defaultRequiredFlag = "defaultRequired" |
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.
I think "requiredByDefault" sounds better.
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.
Fixed
@AndreyAndreevich I don't like the idea to have a switch that will turn all the generated documentation upside down, but it may be useful to lazy developers. |
@AndreyAndreevich we can't merge this due to conflicts. |
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
Describe the PR
Added new option (defaultRequired) for swag init
Additional context
I ran into a problem that I have to put validate required next to each field. This is not very convenient when a lot of code has already been written and you have to add the same thing to the tags for each field. I decided that this option will help not only me, but also the community.
Also added the ability to add validate optional fields.
Please merge it)