{% from "macro_restriction.html" import restriction with context %}
{%- macro tabbed_section(operator, current_node) -%}
{% include "tabbed_section.html" %}
{%- endmacro -%}
{%- macro content(schema, skip_headers=False) -%}
{% set keys = schema.keywords %}
{# Resolve type #}
{%- set type_name = schema.type_name -%}
{%- if type_name.startswith("object") -%}
{%- set type_name = schema.type_name + ' (' + schema.name_for_breadcrumbs + ')' -%}
{%- else -%}
{%- set type_name = schema.type_name -%}
{%- endif -%}
{% if not skip_headers %}
{%- if config.show_breadcrumbs -%}
{%- include "breadcrumbs.html" -%}
{%- endif -%}
{# Display type #}
{%- if not schema is combining -%}
Type: {{ type_name }}
{%- endif -%}
{# Display default #}
{%- set default_value = schema.default_value -%}
{%- if default_value -%}
{{ " " }}Default: {{ default_value }}
{%- endif -%}
{%- set description = (schema | get_description) -%}
{%- include "section_description.html" -%}
{%- endif -%}
{%- if schema.should_be_a_link(config) -%}
Same definition as {{ schema.links_to.link_name }}
{%- elif schema.refers_to -%}
{{ content(schema.refers_to_merged, True) }}
{%- else -%}
{# Handle having oneOf or allOf with only one condition #}
{%- if schema.kw_all_of and (schema.kw_all_of.array_items | length) == 1 -%}
{{ content(schema.kw_all_of.array_items[0]) }}
{%- elif schema.kw_any_of and (schema.kw_any_of.array_items | length) == 1 -%}
{{ content(schema.kw_any_of.array_items[0]) }}
{%- else -%}
{%- if schema.explicit_no_additional_properties -%}
{{ " " }}No Additional Properties
{%- endif -%}
{# Combining: allOf, anyOf, oneOf, not #}
{%- if schema.kw_all_of -%}
{{ schema.kw_const.raw | python_to_json }}
{%- endif -%}
{# Pattern (Regular Expression) #}
{%- if schema.kw_pattern -%}
Must match regular expression: {{ schema.kw_pattern.literal | escape }}
{%- endif -%}
{# cti.type-id #}
{%- if 'x-cti.type-id' in schema.keywords -%}