{% import 'macros/schema.html' as schema_macros %} {% set schemas = datacontract.schema_ if datacontract.schema_ is defined and datacontract.schema_ is not callable else [] %} {% if schemas is mapping %} {% set schemas = [schemas] %} {% elif schemas is not sequence or schemas is string %} {% set schemas = [] %} {% endif %} {% if schemas and schemas|length > 0 %}

Schema

Schema supports both a business representation and physical implementation

{% for schema in schemas %} {% set schema_name = schema.name if schema.name is defined and schema.name else "schema" %} {% set schema_business_name = schema.businessName if schema.businessName is defined and schema.businessName else none %} {% set schema_description = schema.description if schema.description is defined and schema.description else none %} {% set schema_type = schema.type if schema.type is defined and schema.type else (schema.physicalType if schema.physicalType is defined and schema.physicalType else none) %} {% set schema_physical_name = schema.physicalName if schema.physicalName is defined and schema.physicalName else none %} {% set schema_properties = schema.properties if schema.properties is defined and schema.properties is not callable else [] %} {% set schema_tags = schema.tags if schema.tags is defined and schema.tags and schema.tags is sequence and schema.tags is not string else [] %} {% set schema_custom_properties = schema.customProperties if schema.customProperties is defined else none %} {% set schema_quality = schema.quality if schema.quality is defined and schema.quality and schema.quality is sequence and schema.quality is not string else [] %}
{% if schema_properties and schema_properties|length > 0 %} {{ schema_macros.render_nested_properties(schema_properties, schema_name, 0) }} {% else %} {% endif %}
{% if schema_business_name and schema_business_name != schema_name %} {{ schema_business_name }} {% endif %} {{ schema_name }} {% if schema_physical_name %} {% endif %} {% if schema_type %} {{ schema_type }} {% endif %} {% if schema_description %}
{{ schema_description }}
{% else %}
No description
{% endif %} {% if schema_custom_properties %}
{% if schema_custom_properties is mapping %} {% for key, value in schema_custom_properties.items() %} {{ key }}:{{ value }} {% endfor %} {% elif schema_custom_properties is sequence and schema_custom_properties is not string %} {% for cp in schema_custom_properties %} {% if cp.property is defined and cp.value is defined %} {{ cp.property }}:{{ cp.value }} {% endif %} {% endfor %} {% endif %}
{% endif %} {% if schema_tags and schema_tags|length > 0 %}
{% for tag in schema_tags %} {{ tag }} {% endfor %}
{% endif %} {% if schema_quality and schema_quality|length > 0 %}
{% for q in schema_quality %} {% set q_title = "" %} {% if q.description is defined and q.description %}{% set q_title = q.description %}{% endif %} {% if q.type is defined and q.type %}{% set q_title = q_title ~ ("\n" if q_title else "") ~ "type: " ~ q.type %}{% endif %} {% if q.dimension is defined and q.dimension %}{% set q_title = q_title ~ ("\n" if q_title else "") ~ "dimension: " ~ q.dimension %}{% endif %} {% if q.metric is defined and q.metric %}{% set q_title = q_title ~ ("\n" if q_title else "") ~ "metric: " ~ q.metric %}{% endif %} {{ q.name if q.name is defined and q.name else "qualityCheck" }} {% endfor %}
{% endif %}
No properties
{% endfor %}
{% endif %}