mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-03-23 19:44:09 +01:00
Do not use title for objects containing only additionalProperties or patternProperties
Previously, titles would appear that do not link to a subchema definition. It would also mean that named subschemas would appear without being clearly referenced. Now, the type clearly shows the nesting of objects and subschema definitions should be clearly referenced. Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
This commit is contained in:
parent
26ce3929b4
commit
07645fc1ad
|
|
@ -155,12 +155,10 @@
|
||||||
adhering to a regex pattern
|
adhering to a regex pattern
|
||||||
|
|
||||||
* `anchor`: optional HTML element id for the target type, which will be used to link to it.
|
* `anchor`: optional HTML element id for the target type, which will be used to link to it.
|
||||||
|
|
||||||
The title has a higher priority than anything else.
|
|
||||||
*/}}
|
*/}}
|
||||||
{{ define "partials/object-type-or-title" }}
|
{{ define "partials/object-type-or-title" }}
|
||||||
{{ $type := "object" }}
|
{{ $type := "object" }}
|
||||||
{{ if .title }}
|
{{ if and .title (or .properties (not (or .additionalProperties .patternProperties))) }}
|
||||||
{{/*
|
{{/*
|
||||||
If the property has a `title`, use that rather than `type`.
|
If the property has a `title`, use that rather than `type`.
|
||||||
This means we can write things like `EventFilter` rather than `object`.
|
This means we can write things like `EventFilter` rather than `object`.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue