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>
pull/1801/head
Kévin Commaille 3 weeks ago
parent 26ce3929b4
commit 07645fc1ad
No known key found for this signature in database
GPG Key ID: 29A48C1F03620416

@ -155,12 +155,10 @@
adhering to a regex pattern
* `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" }}
{{ $type := "object" }}
{{ if .title }}
{{ if and .title (or .properties (not (or .additionalProperties .patternProperties))) }}
{{/*
If the property has a `title`, use that rather than `type`.
This means we can write things like `EventFilter` rather than `object`.

Loading…
Cancel
Save