or run

npx @tessl/cli init
Log in

Version

Files

docs

index.md
tile.json

task.mdevals/scenario-1/

JSON Schema Visitor

Build a utility that visits all schema objects in a JSON Schema document and collects information about them in depth-first pre-order.

Capabilities

Schema collection and traversal

  • Collects all schema objects from a JSON Schema document into an array @test
  • Visits the root schema first, then child schemas in depth-first order @test
  • Correctly traverses schemas within standard keywords like properties, items, allOf, and anyOf @test
  • Does not traverse validation-only keywords like enum, const, or required @test

Implementation

@generates

API

/**
 * Visits all schema objects in a JSON Schema document and collects them.
 * Traversal follows depth-first pre-order: parent visited before children.
 *
 * @param {object} schema - The root JSON Schema to traverse
 * @returns {object[]} Array of all schema objects visited in traversal order
 */
function collectSchemas(schema) {
  // IMPLEMENTATION HERE
}

module.exports = {
  collectSchemas
};

Dependencies { .dependencies }

json-schema-traverse { .dependency }

Provides JSON Schema traversal capabilities

@satisfied-by