Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion lib/getScopesOfParsedJsonSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@ export type JsonSchemaPathWithScope = {
jsonPath: string;
scope: JsonSchemaScope;
};

/**
* Recursively parses a JSON Schema to map JSON paths to their corresponding scope types.
* This is primarily used to bind interactive UI elements to specific schema definitions
* in the schema editor.
*
* @param parsedJsonSchema - The parsed JSON Schema object or sub-schema.
* @param jsonPath - The current JSON path prefix (defaults to the root '$').
* @returns An array of objects mapping the calculated JSON paths to their scopes.
*/
export default function getScopesOfParsedJsonSchema(
parsedJsonSchema: any,
jsonPath = '$',
Expand Down
Loading