(schema: JSONSchema7)
| 642 | * also picked up. |
| 643 | */ |
| 644 | export function collectInternalSymbols(schema: JSONSchema7): { |
| 645 | typeNames: Set<string>; |
| 646 | fieldsByType: Map<string, Set<string>>; |
| 647 | } { |
| 648 | const typeNames = new Set<string>(); |
| 649 | const fieldsByType = new Map<string, Set<string>>(); |
| 650 | const { definitions, $defs } = collectDefinitionCollections(schema as Record<string, unknown>); |
| 651 | const allDefs: Record<string, JSONSchema7Definition> = { ...definitions, ...$defs }; |
| 652 | for (const [name, def] of Object.entries(allDefs)) { |
| 653 | if (!def || typeof def !== "object") continue; |
| 654 | const d = def as Record<string, unknown>; |
| 655 | if (d.visibility === "internal") typeNames.add(name); |
| 656 | const props = d.properties; |
| 657 | if (props && typeof props === "object" && !Array.isArray(props)) { |
| 658 | for (const [propName, propSchema] of Object.entries(props as Record<string, unknown>)) { |
| 659 | if (propSchema && typeof propSchema === "object" && (propSchema as Record<string, unknown>).visibility === "internal") { |
| 660 | if (!fieldsByType.has(name)) fieldsByType.set(name, new Set()); |
| 661 | fieldsByType.get(name)!.add(propName); |
| 662 | } |
| 663 | } |
| 664 | } |
| 665 | } |
| 666 | return { typeNames, fieldsByType }; |
| 667 | } |
| 668 | |
| 669 | /** |
| 670 | * Post-process a Python module so that types marked `visibility: "internal"` |
no test coverage detected
searching dependent graphs…