dryvPacks

@dryv/schema-examplesv0.1.0

Canonical schema examples exported as JSON fixtures for tests and tooling.

Schema ExamplesTestingInjectPublished 7 days ago2 downloads

dryv pack add @dryv/schema-examples
761 BRaw ↗
jinja
{
  "application": {
    "id": {{ application.id | tojson }},
    "name": {{ application.name.qualified | tojson }}
  },
  "schemas": [
{%- for schema in schemas %}
{%- set artifact = namespace(path=null) %}
{%- for dependency in file.dependencies %}
{%- if dependency.target.id == schema.id %}
{%- set artifact.path = dependency.path.relative %}
{%- endif %}
{%- endfor %}
    {
      "id": {{ schema.id | tojson }},
      "name": {{ schema.name.qualified | tojson }},
      "role": {% if schema.role %}{{ schema.role | tojson }}{% else %}null{% endif %},
      "exampleCount": {{ schema.examples | length }},
      "file": {% if artifact.path %}{{ artifact.path | tojson }}{% else %}null{% endif %}
    }{% if not loop.last %},{% endif %}
{%- endfor %}
  ]
}