{%- if is_reference(schema) -%} {%- with type_name = schema["$ref"].replace("#/components/schemas/", "") -%} [{{type_name}}](#{{type_name.lower()}}) {%- endwith -%} {%- endif -%} {%- if schema.type -%} {%- with type_name = schema["type"], nullable = schema.get("nullable") -%} {%- if type_name == "object" -%} {%- if schema.example -%} _{{texts.example}}: _`{{schema.example}}` {%- elif schema.properties -%} _{{texts.properties}}: _`{{", ".join(schema.properties.keys())}}` {%- endif -%} {%- endif -%} {# Scalar types #} {%- if type_name in scalar_types -%} {{type_name}} {%- if schema.format -%} ({{schema.format}}) {%- endif -%} {%- if nullable -%} | null {%- endif -%} {%- endif -%} {%- if type_name == "array" -%} {%- with schema = schema["items"] -%} Array<{%- include "partial/schema-repr.html" -%}> {%- endwith -%} {%- endif -%} {%- if type_name == "null" -%} null {%- endif -%} {%- endwith -%} {%- endif -%}