Documentation
Workflow Execution Service (WES)
I/O Schemas

I/O Schemas

The WES components understand the GA4GH IO Schema Profile (opens in a new tab) (docs (opens in a new tab)): JSON Schema 2020-12 with x-ga4gh-* keywords that describe the inputs and outputs of a workflow, for example to render input forms and to show outputs.

Profile version

The package supports version 0.3.0 of the profile, pinned at commit 2c3dc49 (opens in a new tab). Its meta-schema and vocabularies are bundled with the package; scripts/sync-io-schema.mjs in the package copies them, the conformance suite and the example schemas from a checkout of the profile's repository at the pinned commit.

Checks

Before ecc-client-ga4gh-wes-io-form uses an IO schema, it checks it offline, as the profile asks:

  1. $schema must name the profile's meta-schema.
  2. The schema must pass the meta-schema, with formats asserted.
  3. Every $ref in inputs, outputs, the top-level $defs and annotation schemas (contentSchema, x-ga4gh-tabular-schema) must resolve within the schema or to the JSON Schema meta-schemas. Nothing is fetched over the network: a schema that refers to a remote schema is rejected. Embedded resources may not reuse the $id of a schema in use (such as the profile's meta-schema). Names with # work everywhere except inside an embedded $id resource, where hyperjump can't address them.

Input values are then validated against the schema's inputs with the semantics of JSON Schema 2020-12. Failures are reported with the JSON Pointer of the value, the keyword that failed and a message.

The checks pass the profile's conformance suite (every valid case is accepted, every invalid one rejected) and accept the profile's example schemas.

Validator and Content Security Policy

The checks use @hyperjump/json-schema (opens in a new tab), which doesn't compile schemas into code, so pages that embed the components need no 'unsafe-eval' in their Content Security Policy.

hyperjump's settings are global to the page: the package turns off its retrieval of schemas over HTTP(S) and turns on format assertion. Pages that use hyperjump themselves get these settings, too.

The validator sits behind a small interface (IoSchemaValidator), so that another library could replace it without changing the components. Apps can use the checks themselves and replace the validator through @elixir-cloud/wes/utils:

import { checkIoSchema, setIoSchemaValidator } from '@elixir-cloud/wes/utils';
 
const result = await checkIoSchema(schema);
if (result.valid) {
  const { valid, errors } = result.validateInputs(values);
}

Checks run one after the other, because hyperjump's registry of schemas is global.

File references

JSON Schema can't check the values of file references (x-ga4gh-file), so the components check them by the profile's rules (see Values (opens in a new tab)) before a value is used:

  • A URI must have a scheme on the deployment's allow-list (allowedSchemes of the components, default drs https), narrowed by the file reference's own schemes, which never extend it. javascript, data, file and other schemes that run code or refer to local data are always refused.
  • Inputs may also be relative paths (files attached to the run request), but only where the file reference has no schemes: no .. segments (also not percent-encoded), no leading ~, // or \\, and no absolute paths.
  • Control characters and leading or trailing whitespace are refused, as they could hide a scheme.

Outputs must be absolute URIs. The checks pass the profile's test vectors for file reference values (tests/vectors/file-values).

Descriptions

Titles, descriptions and enum values of IO schemas are always shown as text, never as markup.

Descriptions with "x-ga4gh-description-format": "markdown" are shown as plain text, which the profile allows. The package also has a renderer for the profile's Markdown subset (raw HTML shown as escaped text, images as their alt text, links only with a scheme from allowedSchemes, which open in a new window; of GFM only tables, strikethrough and autolinks), built on markdown-it (opens in a new tab). It is switched off until the maintainers decide whether the components render Markdown; an app can switch it on for all components with setDescriptionFormat('markdown') from @elixir-cloud/wes/utils, before the components render: components already on the page keep the old format until they render again. markdown-it is part of the package's bundle either way.

Released under Apache 2.0 License.

Copyright © 2023-2026 ELIXIR