{{/* Render a table listing the properties of an object, given: * `title`: optional caption for the table * `anchor`: optional HTML element id for the table * `properties`: optional dictionary of the properties to list, each given as: `property_name` : `property_data` * `additionalProperties`: optional dictionary for properties with undefined names, in the same format as `property_data` * `patternProperties`: optional dictionary for properties with names adhering to a regex pattern, in the same format as `property_data` * `required`: optional array containing the names of required properties. In some cases (such as response body specifications) this isn't used, and instead properties have a `required` boolean attribute. We support this too. */}} {{ $title := .title }} {{ $properties := .properties}} {{ $required := .required}} {{ if $properties }}
Name | Type | Description | {{ range $property_name, $property := $properties }} {{ $property := partial "json-schema/resolve-allof" $property }} {{/* Handle two ways of indicating "required", one for simple parameters, the other for request and response body objects. */}} {{ $required := cond (or (in $required $property_name) ( eq $property.required true )) true false }}
---|---|---|
{{ $property_name }} |
{{ partial "partials/property-type" $property }} |
{{ partial "partials/property-description" (dict "property" $property "required" $required) }} |
Type | Description | {{ $property := partial "json-schema/resolve-allof" . }}
---|---|
{{ partial "partials/property-type" $property }} |
{{ partial "partials/property-description" (dict "property" $property) }} |
One of: [{{ delimit .property.enum ", " }}]
.