-
Notifications
You must be signed in to change notification settings - Fork 84
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
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.73% 72.71% -0.02%
==========================================
Files 190 190
Lines 13101 13101
==========================================
- Hits 9529 9527 -2
- Misses 3021 3022 +1
- Partials 551 552 +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.
Sure, i will get from work and fix it. Thank you! |
Done |
add semicolon to template response encode. This fixes my issue during code generation