From 52da0752637f8244fa1a56423096963a3258e229 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Wed, 24 Apr 2024 14:40:11 +0200 Subject: [PATCH] Improve docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kévin Commaille --- layouts/partials/openapi/render-object-table.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/layouts/partials/openapi/render-object-table.html b/layouts/partials/openapi/render-object-table.html index 175ba038..17bed313 100644 --- a/layouts/partials/openapi/render-object-table.html +++ b/layouts/partials/openapi/render-object-table.html @@ -160,8 +160,12 @@ {{ $type := "object" }} {{ if and .title (or .properties (not (or .additionalProperties .patternProperties))) }} {{/* - If the property has a `title`, use that rather than `type`. - This means we can write things like `EventFilter` rather than `object`. + We only want to use the title in two cases: + + * The object is rendered as a separate table that will use the same + title, which means that the object must have `properties`. + * The object doesn't define any properties, because showing the title + (like `EventFilter`) is better than showing `object`. */}} {{ $type = .title | htmlEscape }} {{ if .anchor }}