mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-03-26 13:04:10 +01:00
Use phrasing "Notes on additional properties"
Ignore `true` values for additionalProperties. Error on `false` values.
This commit is contained in:
parent
9bc952ef03
commit
3398cf0f63
|
|
@ -94,24 +94,21 @@
|
||||||
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{/* NB: the OpenAPI spec says "Consistent with JSON Schema, additionalProperties
|
{{/* Additional properties should either be an OpenAPI schema object, or a
|
||||||
defaults to true." Our schemas tend to omit additionalProperties; I think we
|
boolean. If it's the former, look for a `description` and render it as a note.
|
||||||
effectively assume it defaults to false. Therefore: we only output regarding
|
If it's `true`, do nothing. If it's `false`, raise a build-time error:
|
||||||
additionalProperties if it is explicitly set (i.e. is non-nil). */}}
|
"Everything is extensible in Matrix unless otherwise noted". */}}
|
||||||
{{ if (ne $additionalProperties nil )}}
|
{{ if (ne $additionalProperties nil )}}
|
||||||
<tr class="row-additional-properties">
|
<tr class="row-additional-properties">
|
||||||
<td colspan="3">
|
<td colspan="3">
|
||||||
{{ if (and (reflect.IsMap $additionalProperties)) -}}
|
{{ if (and (reflect.IsMap $additionalProperties)) -}}
|
||||||
{{ if (index $additionalProperties "description") -}}
|
{{ if (index $additionalProperties "description") -}}
|
||||||
May have additional properties: {{ $additionalProperties.description }}
|
Notes on additional properties: {{ $additionalProperties.description }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{/* TODO: should we handle the case where additional properties are permitted,
|
{{/* TODO: should we handle the case where additional properties are
|
||||||
but must follow an explicit schema? */}}
|
permitted, but must follow an explicit schema? */}}
|
||||||
{{ else if $additionalProperties -}}
|
|
||||||
May have additional properties.
|
|
||||||
{{ else if (not $additionalProperties) -}}
|
{{ else if (not $additionalProperties) -}}
|
||||||
{{/* At present we don't have any schema with additionalProperties: false.
|
{{ errorf "Unexpected additionalProperties=false for %s" $caption }}
|
||||||
But if we ever do, let's support it. */}}
|
|
||||||
May **not** have additional properties.
|
May **not** have additional properties.
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</td>
|
</td>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue