When changing or adding public API in schema/validation libraries, prioritize a stable, user-controlled surface:
options (e.g., allow selectively disabling specific validation checks) instead of bundling all behaviors unconditionally.exemplify() should constrain the example to the schema’s output type so changes break at compile time).Example (options-based control idea):
// Don’t hard-code all hostname checks; allow opt-out per consumer need.
const schema = z.string().hostname({
allowIPv4: true,
allowIPv6: false,
allowPunycode: true,
});
Enter the URL of a public GitHub repository