* Registers a schema in the registry under the given id. * Safe to call multiple times with the same id: first registration wins, subsequent ones are silently skipped.
(id: string, schema: ZodType)
| 217 | * Safe to call multiple times with the same id: first registration wins, subsequent ones are silently skipped. |
| 218 | */ |
| 219 | private registerSchema(id: string, schema: ZodType) { |
| 220 | if (!this.schemaRegistry.has(schema)) { |
| 221 | try { |
| 222 | this.schemaRegistry.add(schema, { id }); |
| 223 | } catch { |
| 224 | // id already taken by a different schema variant (e.g. different options) — skip |
| 225 | } |
| 226 | } |
| 227 | } |
| 228 | |
| 229 | /** |
| 230 | * Returns a JSON Schema document containing all registered Zod schemas as named definitions. |
no outgoing calls
no test coverage detected