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.0 schema uses JSON Schema draft 2020-12. It covers request files and the collection.dnml marker.
https://dynomate.io/schemas/dnml-1.0.schema.json 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
xor with the prefixx-. - Required keys, value types and valid values.
- Typed values, table 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.
- Destructive operations, endpoints, guards and deadlines. See Dependencies and execution.
To check a file fully, open it in the app or run it with the CLI. See Error codes.
Editor Setup
VS Code
- Install the Even Better TOML extension.
- Open your user or workspace
settings.json. - Add these settings:
{
"files.associations": {
"*.dnml": "toml"
},
"evenBetterToml.schema.associations": {
".*\\.dnml$": "https://dynomate.io/schemas/dnml-1.0.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:
#:schema https://dynomate.io/schemas/dnml-1.0.schema.json
version = "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
- Make sure that TOML support is active in your IDE.
- Open Settings and go to Editor › File Types.
- Add
*.dnmlto the file name patterns of TOML. - Go to Languages & Frameworks › Schemas and DTDs › JSON Schema Mappings.
- Add a mapping.
- Enter the schema URL as the schema file or URL.
- Add the file pattern
*.dnml.