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
Added implementation of x-json-ignore #390
Conversation
Hi @deepmap-marcinr, could you please suggest who can check the PR? If it's good - I can work on the tests and other required improvements to make sure it will fit perfectly. |
I'm traveling on vacation right now, I'll take a look soon. |
Hi @deepmap-marcinr could you please check this one? |
pkg/codegen/schema.go
Outdated
@@ -465,6 +472,7 @@ func GenFieldsFromProperties(props []Property) []string { | |||
tags[i] = fmt.Sprintf(`%s:"%s"`, k, fieldTags[k]) | |||
} | |||
field += "`" + strings.Join(tags, " ") + "`" | |||
|
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.
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
pkg/codegen/extension.go
Outdated
@@ -51,3 +52,18 @@ func extExtraTags(extPropValue interface{}) (map[string]string, error) { | |||
} | |||
return tags, nil | |||
} | |||
|
|||
func extParseGoJsonIgnore(extPropValue interface{}) (bool, error) { | |||
|
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.
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
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.
Looking good! Would you mind updating the branch, to make sure CI is happy?
We will look at confirming functionality wise it looks good / whether we need any new tests
I actually thought this change will never be here... That probably will be a pain, but let me try to recall what happened here. |
ddfe504
to
8eb671e
Compare
Ok, I removed the logic optimization and left just the code related to the json-ignore. @jamietanna could you please approve the workflows? |
I hope it's not another year to wait... |
@jamietanna may I ask you to check this again? The workflows seems doesn't want to start until someone will approve them. |
The implementation of x-go-json-ignore to use with GORM when we don't need to serialize specific fields (when ObjectID and Object fields is in the same struct).