Skip to content

Commit

Permalink
Fix generation of anchors for additional properties (matrix-org#1488)
Browse files Browse the repository at this point in the history
but objects defined under `additionalProperties` missed out on them. This fixes
that.
  • Loading branch information
richvdh authored and clokep committed May 3, 2023
1 parent 413d50d commit 150ca3b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
1 change: 1 addition & 0 deletions changelogs/internal/newsfragments/1488.clarification
@@ -0,0 +1 @@
Fix generation of anchors for additional properties
17 changes: 6 additions & 11 deletions layouts/partials/json-schema/resolve-additional-types.html
Expand Up @@ -43,17 +43,12 @@
*/}}
{{ if $this_object.additionalProperties }}
{{ if reflect.IsMap $this_object.additionalProperties }}
{{ $additional_objects = $additional_objects | append (partial "clean-object" $this_object.additionalProperties) }}

{{ range $key, $property := $this_object.additionalProperties.properties }}
{{ $additional_objects = partial "get-additional-objects" (dict
"this_object" $property
"additional_objects" $additional_objects
"anchor_base" $anchor_base
"name" (printf "%s.%s" $name $key)
) }}
{{ end }}

{{ $additional_objects = partial "get-additional-objects" (dict
"this_object" $this_object.additionalProperties
"additional_objects" $additional_objects
"anchor_base" $anchor_base
"name" (printf "%s.additional" $name)
) }}
{{ end }}
{{ end }}

Expand Down

0 comments on commit 150ca3b

Please sign in to comment.