mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-03-23 11:34:09 +01:00
Improve comments in render-object-table
Just documenting the current situation.
This commit is contained in:
parent
26ce3929b4
commit
55f76570db
|
|
@ -9,11 +9,11 @@
|
||||||
* `properties`: optional dictionary of the properties to list, each given as:
|
* `properties`: optional dictionary of the properties to list, each given as:
|
||||||
`property_name` : `property_data`
|
`property_name` : `property_data`
|
||||||
|
|
||||||
* `additionalProperties`: optional dictionary for properties with undefined
|
* `additionalProperties`: an OpenAPI schema document for additional properties
|
||||||
names, in the same format as `property_data`
|
on the object.
|
||||||
|
|
||||||
* `patternProperties`: optional dictionary for properties with names adhering
|
* `patternProperties`: optional dictionary for properties with names adhering
|
||||||
to a regex pattern, in the same format as `property_data`
|
to a regex pattern. A map from regex pattern to OpenAPI schema document.
|
||||||
|
|
||||||
* `required`: optional array containing the names of required properties.
|
* `required`: optional array containing the names of required properties.
|
||||||
In some cases (such as response body specifications) this isn't used, and
|
In some cases (such as response body specifications) this isn't used, and
|
||||||
|
|
@ -55,6 +55,15 @@
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
{{ else if (or .additionalProperties .patternProperties) }}
|
{{ else if (or .additionalProperties .patternProperties) }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
A special format of table for objects which only have additionalProperties or patternProperties.
|
||||||
|
|
||||||
|
This is only ever used for top-level objects. Nested objects in this situation are just shown
|
||||||
|
as rows within their parent object, and don't get their own table. (They are filtered out in
|
||||||
|
resolve-additional-types.)
|
||||||
|
*/}}
|
||||||
|
|
||||||
<table{{ if .anchor }} id="{{ .anchor }}"{{ end }} class="object-table">
|
<table{{ if .anchor }} id="{{ .anchor }}"{{ end }} class="object-table">
|
||||||
{{ with $title }}
|
{{ with $title }}
|
||||||
<caption>{{ . }}</caption>
|
<caption>{{ . }}</caption>
|
||||||
|
|
@ -113,7 +122,7 @@
|
||||||
{{ else if or (reflect.IsSlice .type) .oneOf }}
|
{{ else if or (reflect.IsSlice .type) .oneOf }}
|
||||||
{{/*
|
{{/*
|
||||||
It's legal to specify an array of types.
|
It's legal to specify an array of types.
|
||||||
|
|
||||||
There are two ways to do that:
|
There are two ways to do that:
|
||||||
- Use an array of strings.
|
- Use an array of strings.
|
||||||
- Use oneOf, with items having a schema.
|
- Use oneOf, with items having a schema.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue