mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-03-26 04:54:10 +01:00
Remove redundant call to resolve-allof
All of the callers to resolve-additional-types already call resolve-allof (or if not, they should), so this is redundant.
This commit is contained in:
parent
f9028acf8e
commit
16b3cc1617
|
|
@ -7,6 +7,9 @@
|
||||||
Given a schema object, this template finds all nested objects under that
|
Given a schema object, this template finds all nested objects under that
|
||||||
schema.
|
schema.
|
||||||
|
|
||||||
|
Assumes that "resolve-refs" and "resolve-allof" has already been called on the
|
||||||
|
input schema.
|
||||||
|
|
||||||
It "cleans" each object by copying only the parts of the objects that
|
It "cleans" each object by copying only the parts of the objects that
|
||||||
the renderer needs, and adds the result to an array, `additional_objects`.
|
the renderer needs, and adds the result to an array, `additional_objects`.
|
||||||
|
|
||||||
|
|
@ -16,7 +19,7 @@
|
||||||
|
|
||||||
*/}}
|
*/}}
|
||||||
|
|
||||||
{{ $this_object := partial "json-schema/resolve-allof" . }}
|
{{ $this_object := . }}
|
||||||
{{ $additional_objects := slice }}
|
{{ $additional_objects := slice }}
|
||||||
|
|
||||||
{{ if eq $this_object.type "object" }}
|
{{ if eq $this_object.type "object" }}
|
||||||
|
|
@ -71,7 +74,11 @@
|
||||||
{{ define "partials/get-additional-objects" }}
|
{{ define "partials/get-additional-objects" }}
|
||||||
{{ $additional_objects := .additional_objects }}
|
{{ $additional_objects := .additional_objects }}
|
||||||
|
|
||||||
|
/* although we expect resolve-allof to be called on the input, resolve-allof does not recurse into
|
||||||
|
* nested objects, so we have to call it again.
|
||||||
|
*/
|
||||||
{{ $this_object := partial "json-schema/resolve-allof" .this_object }}
|
{{ $this_object := partial "json-schema/resolve-allof" .this_object }}
|
||||||
|
|
||||||
{{ $more_objects := partial "json-schema/resolve-additional-types" $this_object }}
|
{{ $more_objects := partial "json-schema/resolve-additional-types" $this_object }}
|
||||||
{{/*
|
{{/*
|
||||||
As far as I know we don't have something like Array.concat(), so add them one at a time
|
As far as I know we don't have something like Array.concat(), so add them one at a time
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue