Do not generate anchors for objects which will not have a table

pull/1724/head
Richard van der Hoff 4 months ago
parent 4043c1fc58
commit 83bbc23e30

@ -24,8 +24,9 @@
* `resolve-allof` is called on the top-level `schema` beforehand,
* `resolve-allof` doesn't recurse down to subschemas).
*
* * If `anchor_base` is set, each object with a `title` is given an `anchor`,
* which is a string suitable for using as an html anchor for that object schema.
* * If `anchor_base` is set, each object with a `title` and `properties`
* is given an `anchor`, which is a string suitable for using as an html
* anchor for that object schema.
*
* * With the *exception* of the top-level `schema` (if it is an object),
* properties outside the following list are removed:
@ -64,8 +65,8 @@
{{ $all_objects := slice }}
{{ if eq $this_object.type "object" }}
/* Give this object an anchor, if it has a name */
{{ if (and $anchor_base $this_object.title) }}
/* Give this object an anchor, if it has a name and properties */
{{ if (and $anchor_base $this_object.title $this_object.properties) }}
{{ $this_object = merge $this_object (dict "anchor" (printf "%s_%s" $anchor_base (anchorize $this_object.title))) }}
{{ end }}

Loading…
Cancel
Save