From 1d4682fac967b3aef58670a320f6f49bacc6ebb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Wed, 13 Sep 2023 10:35:59 +0200 Subject: [PATCH] Display enums as strings 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 | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/layouts/partials/openapi/render-object-table.html b/layouts/partials/openapi/render-object-table.html index 0f5841a4..0de9d2d1 100644 --- a/layouts/partials/openapi/render-object-table.html +++ b/layouts/partials/openapi/render-object-table.html @@ -53,13 +53,6 @@ {{ $type = delimit (slice "[" $inner_type "]") "" }} {{ end }} - {{/* - If the property is an enum, indicate this. - */}} - {{ if (and (eq $property.type "string") ($property.enum)) }} - {{ $type = "enum" }} - {{ end }} - {{/* Handle two ways of indicating "required", one for simple parameters, the other for request and response body objects. @@ -72,7 +65,7 @@ {{ if $required }}Required: {{end -}} {{ $property.description | markdownify -}} - {{ if eq $type "enum"}}

One of: [{{ delimit $property.enum ", " }}].

{{ end -}} + {{ if $property.enum }}

One of: [{{ delimit $property.enum ", " }}].

{{ end -}} {{ if (index $property "x-addedInMatrixVersion") }}{{ partial "added-in" (dict "v" (index $property "x-addedInMatrixVersion")) }}{{ end -}} {{ if (index $property "x-changedInMatrixVersion") }}{{ partial "changed-in" (dict "changes_dict" (index $property "x-changedInMatrixVersion")) }}{{ end -}}