Skip to content

Commit

Permalink
Fix regression introduced when inlining "Required" (#2005)
Browse files Browse the repository at this point in the history
If the description is not set in the object definition, Hugo generates a weird string after "Required": `%!s(<nil>)`.

To avoid that, we default the description to an empty string when it is not set.

Signed-off-by: Kévin Commaille <[email protected]>
  • Loading branch information
zecakeh authored Nov 26, 2024
1 parent c16788f commit f3130f7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelogs/internal/newsfragments/2005.clarification
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Enforce consistent vertical spacing between paragraphs in endpoint definitions.
2 changes: 1 addition & 1 deletion layouts/partials/openapi/render-object-table.html
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@
Prepend "Required:" to make it part of the first paragraph of the
description.
*/}}
{{- $description = printf "<strong>Required: </strong>%s" $description -}}
{{- $description = printf "<strong>Required: </strong>%s" (default "" $description) -}}
{{ end -}}
{{/*
Force the rendering as a block so the description is always inside a
Expand Down

0 comments on commit f3130f7

Please sign in to comment.