mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-03-13 06:54:10 +01:00
Fix parsing of nested slices in resolve-refs and resolve-allof partials
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
This commit is contained in:
parent
cabe846d23
commit
d94e0ae8c2
|
|
@ -24,6 +24,14 @@
|
|||
|
||||
{{ range $original }}
|
||||
{{ $resolved := partial "json-schema/resolve-allof" . }}
|
||||
{{ if reflect.IsSlice $resolved }}
|
||||
{{/*
|
||||
If $resolved is a slice, `append` will add the items of $resolved to
|
||||
$ret, but we want to add $resolved itself to $ret, so we always wrap
|
||||
it into another slice.
|
||||
*/}}
|
||||
{{ $resolved = slice $resolved }}
|
||||
{{ end }}
|
||||
{{ $ret = $ret | append $resolved }}
|
||||
{{ end }}
|
||||
{{ else if reflect.IsMap $original }}
|
||||
|
|
|
|||
|
|
@ -69,6 +69,14 @@
|
|||
|
||||
{{ range $schema }}
|
||||
{{ $resolved := partial "json-schema/resolve-refs" (dict "schema" . "path" $path) }}
|
||||
{{ if reflect.IsSlice $resolved }}
|
||||
{{/*
|
||||
If $resolved is a slice, `append` will add the items of $resolved to
|
||||
$result_slice, but we want to add $resolved itself to $result_slice,
|
||||
so we wrap it into another slice.
|
||||
*/}}
|
||||
{{ $resolved = slice $resolved }}
|
||||
{{ end }}
|
||||
{{ $result_slice = $result_slice | append $resolved }}
|
||||
{{ end }}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue