restraml

TypeScript โญ 59 ยท Updated Apr 27, 2026
diff2html mikrotik monoco-editor oas3 oas30 openapi-specification openapi3 picocss postman raml rest routeros routeros-v7 schema

RouterOS Web Tools (`diff`, /app YAML Editor, command lookup by version, REST API Explorer) + Schemas (RAML 1.0, OpenAPI 3.0, RouterOS /app YAML) & more

RouterOS API Schema Tools

tikoci.github.io/restraml โ€” schema downloads, side-by-side version diffs, an interactive API explorer, a command lookup tool, and a browser-based /app YAML editor for the MikroTik RouterOS REST API. No install needed, runs in your browser.

For RouterOS 7.22+: JSON Schema files for /app container YAML are also published there, ready to plug into VSCode โ€” setup details below.

Auto-generated API schemas for the MikroTik RouterOS REST API, built automatically by GitHub Actions โ€” you can watch the sausage being made.

RouterOS diff tool screenshot

Download Schemas

Pre-built schema files for the RouterOS REST API are available at https://tikoci.github.io/restraml/

Tip

Missing a version? Need a feature? Spot a bug? Open an issue โ€” builds run automatically for new RouterOS releases via GitHub Actions, and requests are welcome.

Each RouterOS version includes:

  • RAML โ€” RAML 1.0 schema, usable in Postman, MuleSoft, and other API tools
  • OpenAPI 3 โ€” OpenAPI 3.0 schema (7.21.1+), viewable in the API Explorer with enriched descriptions from MikroTik documentation
  • JSON โ€” raw /console/inspect output from RouterOS, useful for data analysis and diffs
  • MIB โ€” link to the official MikroTik MIB for SNMP

There may be a base and +extra download for each version:

  • base โ€” just the routeros.npk system package
  • +extra โ€” all x86 packages: routeros, dude, container, rose-storage, gps, lora, calea, user-manager, ups, iot, wifiwave2, tr069-client
API Explorer

An interactive API explorer at tikoci.github.io/restraml/openapi.html lets you browse the RouterOS REST API using the OpenAPI 3 schema. Powered by Scalar, it provides endpoint documentation enriched with descriptions from MikroTik's official documentation, request/response examples, and a built-in HTTP client for testing.

diff RouterOS Commands

The project website includes a diff tool that compares the /console/inspect output between any two RouterOS versions โ€” useful for tracking new commands, removed attributes, and API changes across releases.

lookup RouterOS Commands

A command lookup tool at tikoci.github.io/restraml/lookup.html lets you search RouterOS commands and attributes across versions, with filtering by path and attribute name.

/app YAML Editor

A browser-based YAML editor at tikoci.github.io/restraml/tikapp.html lets you write and validate RouterOS /app YAML directly in your browser using Monaco editor (the same editor that powers VS Code). Features include:

  • Schema validation against any versioned schema (7.22+) or the latest schema
  • Built-in examples from MikroTik's app library, filterable by category
  • Dirty-state tracking โ€” edit examples safely with Stash / Recall / Discard workflow
  • app-store-urls= toggle that auto-converts single app โ†” array format
  • Custom YAML autosaved to browser local storage (restored on reload)
  • Support for both single /app definitions and app-store-urls= array format
  • Download as .tikapp.yaml / .tikappstore.yaml, or copy YAML to clipboard
  • Copy directly as a RouterOS /app add yaml= command
  • Shareable URLs โ€” version, schema mode, and YAML content encoded on explicit Share

๐Ÿ“– Full user manual โ†’


RouterOS /app YAML Schema

RouterOS 7.22+ includes /app โ€” a YAML format (similar to docker-compose but RouterOS-specific) for defining custom container applications. This project provides JSON Schema files to validate /app YAML in editors like VSCode.

Schema URLs
Schema URL Purpose
Single /app routeros-app-yaml-schema.latest.json Validates a single /app YAML definition
App Store routeros-app-yaml-store-schema.latest.json Validates the array format used by /app/settings's app-store-urls=
Per-version https://tikoci.github.io/restraml/{version}/routeros-app-yaml-schema.json Version-specific schema (available for 7.22+)

Per-version schemas are automatically validated against MikroTik's built-in /app entries for each new RouterOS release to verify accuracy.

Note

Each schema build boots a RouterOS CHR in QEMU directly on a GitHub Actions runner (with KVM acceleration), installs extra packages, then validates all ~80 built-in /app YAMLs from the live router against the schema. See appyamlschemas.yaml for the workflow.

Using the /app YAML Schema in VSCode

Install the Red Hat YAML extension for VSCode, then use either approach:

Option 1: Inline schema comment (per-file)

Add a yaml-language-server comment at the top of your YAML file. The YAML extension will detect it automatically โ€” no settings changes needed.

For a single /app definition:

# yaml-language-server: $schema=https://tikoci.github.io/restraml/routeros-app-yaml-schema.latest.json

name: my-app
descr: My custom RouterOS app
services:
  server:
    image: myimage:latest
    ports:
      - 8080:80:web

For an app store file (array of /app definitions, used with app-store-urls=):

# yaml-language-server: $schema=https://tikoci.github.io/restraml/routeros-app-yaml-store-schema.latest.json

- name: app-one
  services:
    server:
      image: app1:latest
- name: app-two
  services:
    server:
      image: app2:latest
Option 2: VSCode settings (automatic for matching filenames)

Add to your .vscode/settings.json to apply the schema automatically to any file whose name matches the glob pattern. Files must be named using the configured ending (e.g. my-app.tikapp.yaml for a single /app definition, or my-store.tikappstore.yaml for a store file):

{
  "yaml.schemas": {
    "https://tikoci.github.io/restraml/routeros-app-yaml-schema.latest.json": "*.tikapp.yaml",
    "https://tikoci.github.io/restraml/routeros-app-yaml-store-schema.latest.json": "*.tikappstore.yaml"
  }
}

Tip

You can also use a version-specific schema URL (e.g., .../7.22/routeros-app-yaml-schema.json) if you need validation matched to a particular RouterOS release.


Usage with Postman

The RAML 1.0 schema can be imported into Postman (download here) to explore the RouterOS REST API:

  1. Copy the URL of the version-specific RAML file from the Schema Downloads table (right-click the base or +extra link under RAML)
  2. In Postman, go to File โ†’ Import and paste the URL
  3. On the next screen, select Postman Collection โ€” note this may take several minutes for the full schema

Warning

The generated schema is more for convenience than strict validation. Generation is limited to the data available from /console/inspect. For example, all parameters are marked as optional in the schema even though some are required in practice.


Repository Layout

restraml/
โ”œโ”€โ”€ rest2raml.js              # Main script: RouterOS REST API โ†’ RAML 1.0
โ”œโ”€โ”€ validraml.cjs             # RAML 1.0 validator
โ”œโ”€โ”€ appyamlvalidate.js        # /app YAML schema validator (Bun)
โ”œโ”€โ”€ deep-inspect.ts           # Deep API tree inspection (Bun)
โ”œโ”€โ”€ ros-api-protocol.ts       # Vendored RouterOS native API wire protocol
โ”œโ”€โ”€ enrich-openapi.ts         # Enriches OpenAPI schemas with descriptions
โ”œโ”€โ”€ validate-openapi.ts       # OpenAPI 3.0 schema validator
โ”œโ”€โ”€ *.test.ts                 # Unit + integration tests (bun test)
โ”œโ”€โ”€ Dockerfile.chr-qemu       # Local dev: RouterOS CHR in QEMU via Docker
โ”œโ”€โ”€ scripts/
โ”‚   โ”œโ”€โ”€ entrypoint.sh         # QEMU launcher for local Docker use
โ”‚   โ”œโ”€โ”€ test-with-qemu.sh     # Integration tests (deep-inspect) against local CHR
โ”‚   โ”œโ”€โ”€ test-ros-api.sh       # Integration + stress tests (ros-api-protocol) against local CHR
โ”‚   โ””โ”€โ”€ benchmark-qemu.sh     # REST vs native API benchmark suite against local CHR
โ”œโ”€โ”€ docs/                     # GitHub Pages root (one subdirectory per version)
โ”‚   โ”œโ”€โ”€ index.html            # Main website: version list, diff tool, downloads
โ”‚   โ”œโ”€โ”€ openapi.html          # Interactive API Explorer (Scalar-based)
โ”‚   โ”œโ”€โ”€ lookup.html           # Command search tool
โ”‚   โ”œโ”€โ”€ diff.html             # Schema diff tool
โ”‚   โ”œโ”€โ”€ tikapp.html           # /app YAML editor (Monaco-based)
โ”‚   โ”œโ”€โ”€ routeros-app-yaml-schema.latest.json
โ”‚   โ”œโ”€โ”€ routeros-app-yaml-store-schema.latest.json
โ”‚   โ””โ”€โ”€ {version}/            # Per-version schemas (RAML, OpenAPI 3, inspect JSON)
โ”œโ”€โ”€ CLAUDE.md                 # Full architecture guide for AI agents
โ”œโ”€โ”€ AGENTS.md                 # GitHub Copilot agent instructions
โ””โ”€โ”€ .github/workflows/
    โ”œโ”€โ”€ auto.yaml             # Daily cron: detect new versions, trigger builds
    โ”œโ”€โ”€ manual-using-docker-in-docker.yaml
    โ”œโ”€โ”€ manual-using-extra-docker-in-docker.yaml
    โ”œโ”€โ”€ appyamlschemas.yaml   # Validate and publish /app YAML schemas
    โ””โ”€โ”€ manual-from-secrets.yaml

Architecture & Development

For full architecture details, CI/CD pipeline documentation, and development instructions, see:

  • CLAUDE.md โ€” comprehensive architecture guide
  • AGENTS.md โ€” GitHub Copilot agent instructions