From 5c7d5eb3dbe9df41fa665a8039eec84df3762719 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Tue, 19 Nov 2024 11:19:59 +0100 Subject: [PATCH] Fix regression introduced when inlining "Required" with description MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the description is not set in the object definition, Hugo generates a weird string after "Required": `%!s()`. To avoid that, we default the description to an empty string when it is not set. Signed-off-by: Kévin Commaille --- layouts/partials/openapi/render-object-table.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/openapi/render-object-table.html b/layouts/partials/openapi/render-object-table.html index bae7a3d9..08dd5790 100644 --- a/layouts/partials/openapi/render-object-table.html +++ b/layouts/partials/openapi/render-object-table.html @@ -313,7 +313,7 @@ resolve-additional-types.) Prepend "Required:" to make it part of the first paragraph of the description. */}} - {{- $description = printf "Required: %s" $description -}} + {{- $description = printf "Required: %s" (default "" $description) -}} {{ end -}} {{/* Force the rendering as a block so the description is always inside a