mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-03-13 15:04:10 +01:00
Only show empty examples if the object is suppoed to be empty
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
This commit is contained in:
parent
a5c9f91927
commit
b83bc65850
|
|
@ -37,7 +37,9 @@
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ $examples = slice $example }}
|
{{ if (or $example (not $this_object.properties)) }}
|
||||||
|
{{ $examples = slice $example }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
{{ else if eq $this_object.type "array" }}
|
{{ else if eq $this_object.type "array" }}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -58,11 +58,13 @@
|
||||||
{{ partial "openapi/render-object-table" . }}
|
{{ partial "openapi/render-object-table" . }}
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
|
{{ $examples := partial "json-schema/resolve-examples" $definition }}
|
||||||
|
{{ if $examples }}
|
||||||
<h2>Examples</h2>
|
<h2>Examples</h2>
|
||||||
|
|
||||||
{{ $examples := partial "json-schema/resolve-examples" $definition }}
|
{{ range $examples }}
|
||||||
{{ range $examples }}
|
{{ partial "render-example" (dict "example" .) }}
|
||||||
{{ partial "render-example" (dict "example" .) }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue