-
Notifications
You must be signed in to change notification settings - Fork 21
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
Custom jumpo type sunset #744
Conversation
7229554
to
bd8993c
Compare
// optionalAsNull is used in conjunction with the `typeString` parameter | ||
// `outerOptional` to ensure types line up. | ||
// In general, `outerOptional` <=> `!optionalAsNull`. | ||
func emptyTypeInitializer(ctx *classFileContext, t schema.Type, optionalAsNull bool) 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.
This seems like a win to me! I had doubts this is fully corret in all cases.
} public CompositePathResponse build() { | ||
return new CompositePathResponse(order, path); | ||
} | ||
public CompositePathResponse build() { |
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! So this removed the situation with "too many constructors".
Observing that since class fields are no longer final, it's possible to shorten the builder code further by keeping an instance of the class.
@CustomType.Builder
public static final class Builder {
private @Nullable CompositePathResponse $;
}
@CustomType.Setter
public Builder path(@Nullable String path) {
$.path = path;
return this;
}
public CompositePathResponse build() {
return $;
}
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.
yes, correct, I've noticed it too, just didn't want to make unrelated changes
@@ -773,6 +773,9 @@ | |||
}, | |||
"bar256": { | |||
"type": "string" | |||
}, | |||
"default": { |
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.
Curious why add this one? To test name mangling?
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.
yes, I wanted to test the default
-> default_
and that one or the other will appear in all the correct places
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 🚢
Description
Use
@CustomType.Builder
in codegen.Part of #390
Checklist