Display enums as strings

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
This commit is contained in:
Kévin Commaille 2023-09-13 10:35:59 +02:00
parent 5d4f8aa4cf
commit 1d4682fac9
No known key found for this signature in database
GPG key ID: 29A48C1F03620416

View file

@ -53,13 +53,6 @@
{{ $type = delimit (slice "[" $inner_type "]") "" }} {{ $type = delimit (slice "[" $inner_type "]") "" }}
{{ end }} {{ 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, Handle two ways of indicating "required", one for simple parameters,
the other for request and response body objects. the other for request and response body objects.
@ -72,7 +65,7 @@
<td> <td>
{{ if $required }}<strong>Required: </strong>{{end -}} {{ if $required }}<strong>Required: </strong>{{end -}}
{{ $property.description | markdownify -}} {{ $property.description | markdownify -}}
{{ if eq $type "enum"}}<p>One of: <code>[{{ delimit $property.enum ", " }}]</code>.</p>{{ end -}} {{ if $property.enum }}<p>One of: <code>[{{ delimit $property.enum ", " }}]</code>.</p>{{ end -}}
{{ if (index $property "x-addedInMatrixVersion") }}{{ partial "added-in" (dict "v" (index $property "x-addedInMatrixVersion")) }}{{ 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 -}} {{ if (index $property "x-changedInMatrixVersion") }}{{ partial "changed-in" (dict "changes_dict" (index $property "x-changedInMatrixVersion")) }}{{ end -}}
</td> </td>