-
Notifications
You must be signed in to change notification settings - Fork 78
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
fix: issue 1327 during code generation #1328
base: main
Are you sure you want to change the base?
Conversation
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.
Let's fix it here instead:
ogen/gen/_template/json/encode.tmpl
Line 73 in 62691ab
{{- if or ($t.NilSemantic.Invalid) ($t.NilSemantic.Optional) -}} |
{{/* Encode value that implements jx.Encoder with respect to nil semantic */}}
{{- define "json/enc_value" -}}
{{- $t := $.Type -}}
-{{- if or ($t.NilSemantic.Invalid) ($t.NilSemantic.Optional) -}}
+{{- if or ($t.NilSemantic.Invalid) ($t.NilSemantic.Optional) }}
if {{ $.Var }} != nil {
{{- template "json/enc_field" $ }}
{{ $.Var }}.Encode(e)
Sure |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1328 +/- ##
==========================================
+ Coverage 72.74% 72.76% +0.01%
==========================================
Files 190 190
Lines 13096 13096
==========================================
+ Hits 9527 9529 +2
+ Misses 3017 3016 -1
+ Partials 552 551 -1 ☔ View full report in Codecov by Sentry. |
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.
It seems like our commit linter is not happy about refac:
instead of refactor:
. Could you change your commit message, please?
Everything else LGTM.
add semicolon to template response encode. This fixes my issue during code generation