Browse documentation

Schema and editor setup

DNML files are TOML. Add the DNML JSON Schema to your editor to find key and type errors.

Schema URL

The DNML 1.1 schema uses JSON Schema draft 2020-12. It validates DNML 1.0 and 1.1 request files and the collection.dnml marker.

Text
https://dynomate.io/schemas/dnml-1.1.schema.json

The DNML 1.0 schema at https://dynomate.io/schemas/dnml-1.0.schema.json still works, but it does not include the Amazon Aurora DSQL operations.

What the schema checks

The schema checks the structure of a file:

  • Top-level keys, and the [variables], [defaults] and [execution] tables.
  • Unknown keys, except extension keys under x or with the prefix x-.
  • Required keys, value types and valid values.
  • Typed values, table ARNs, cluster ARNs and S3 locations.
  • ${...} expressions where DNML accepts them.

The app and the CLI also check these items before each run:

  • The value and type of each expression. See Templates.
  • The order of blocks of different operation types. See Operation blocks.
  • Duplicate normalized names, unknown dependencies and cycles. See Naming rules and Dependencies.
  • Destructive operations, endpoints, guards and deadlines. See Safety and Deadlines.
  • The AWS Region of each Aurora DSQL operation, which must match its cluster ARN.
  • Sets in Aurora DSQL parameters, which are not permitted. See Aurora DSQL parameters.

To check a file fully, open it in the app or run it with the CLI. See Error codes.

Editor setup

VS Code

  1. Install the Even Better TOML extension.
  2. Open your user or workspace settings.json.
  3. Add these settings:
JSON
settings.json
{  "files.associations": {    "*.dnml": "toml"  },  "evenBetterToml.schema.associations": {    ".*\\.dnml$": "https://dynomate.io/schemas/dnml-1.1.schema.json"  }}

The key under evenBetterToml.schema.associations is a regular expression for the file path.

For one file only, add this directive on the first line:

DNML
#:schema https://dynomate.io/schemas/dnml-1.1.schema.jsonversion = "1.0"name = "find-and-update-order"

The app removes all comments when it saves a request. If you edit requests in the app, use the settings.

JetBrains IDEs

  1. Make sure that TOML support is active in your IDE.
  2. Open Settings and go to Editor › File Types.
  3. Add *.dnml to the file name patterns of TOML.
  4. Go to Languages & Frameworks › Schemas and DTDs › JSON Schema Mappings.
  5. Add a mapping.
  6. Enter the schema URL as the schema file or URL.
  7. Add the file pattern *.dnml.