(
variant: JSONSchema7 | boolean,
definitions: Record<string, unknown>
)
| 3609 | } |
| 3610 | |
| 3611 | function resolveSharedAnyOfVariant( |
| 3612 | variant: JSONSchema7 | boolean, |
| 3613 | definitions: Record<string, unknown> |
| 3614 | ): JSONSchema7 | undefined { |
| 3615 | if (typeof variant !== "object" || variant === null) return undefined; |
| 3616 | if (typeof variant.$ref === "string") { |
| 3617 | // Local $ref like "#/$defs/AttachmentFile" or "#/definitions/AttachmentFile". |
| 3618 | const localMatch = /^#\/(?:\$defs|definitions)\/(.+)$/.exec(variant.$ref); |
| 3619 | if (!localMatch) return undefined; |
| 3620 | const target = definitions[decodeURIComponent(localMatch[1])]; |
| 3621 | if (!target || typeof target !== "object" || Array.isArray(target)) return undefined; |
| 3622 | return target as JSONSchema7; |
| 3623 | } |
| 3624 | return variant; |
| 3625 | } |
| 3626 | |
| 3627 | /** |
| 3628 | * Scan hand-written `.go` files under `go/` and return every top-level exported |
no test coverage detected
searching dependent graphs…