-
-
Notifications
You must be signed in to change notification settings - Fork 148
add model-json-tag to cmd arguments #499
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
base: master
Are you sure you want to change the base?
Conversation
cmd/jet/main.go
Outdated
@@ -94,6 +100,10 @@ func main() { | |||
printErrorAndExit("ERROR: required flag(s) missing") | |||
} | |||
|
|||
if modelJsonTag != "" && !slices.Contains([]string{"none", "snake-case", "pascal-case", "camel-case"}, modelJsonTag) { |
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.
""
can be moved to Contains([]string{
?
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
Thanks, looks good. To wrap it up, it would be good to have at least one test here - https://github.com/go-jet/jet/blob/master/tests/postgres/generator_test.go. |
|
||
var jsonTag string | ||
switch modelJsonTag { | ||
case "": |
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.
Tests are probably failing because of this line, since it adds a empty tag in default case. Check: https://app.circleci.com/pipelines/github/go-jet/jet/1131/workflows/590c63e5-ce37-4f5b-9c67-58dd5c09e178/jobs/1314
Test also. |
add options to generate json tags, as mentioned in #486