Traverse JSON Schema passing each schema object to callback
94
Build a utility that extracts all JSON Pointer paths from a JSON Schema document using schema traversal.
Create a function extractPaths that takes a JSON Schema object and returns an array of all JSON Pointer paths found in the schema.
The function should:
@generates
/**
* Extracts all JSON Pointer paths from a JSON Schema.
*
* @param {object} schema - A JSON Schema object
* @returns {string[]} Array of JSON Pointer paths, sorted alphabetically
*/
function extractPaths(schema) {
// IMPLEMENTATION HERE
}
module.exports = { extractPaths };Provides schema traversal functionality.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-json-schema-traversedocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10