feat(schema): implement Phase 12 String Format Schemas#23
Merged
viniciusdacal merged 1 commit intomainfrom Feb 6, 2026
Merged
Conversation
Add 16 format schemas: email, uuid, url, hostname, ipv4, ipv6, base64, hex, jwt, cuid, ulid, nanoid, iso.date, iso.time, iso.datetime, iso.duration. Extracted FormatSchema base class for shared validation pattern. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
viniciusdacal
commented
Feb 6, 2026
Contributor
Author
viniciusdacal
left a comment
There was a problem hiding this comment.
Code Review — Phase 12: String Format Schemas
Overview
Adds 16 format schema validators with a shared FormatSchema base class. All extend StringSchema and add format-specific validation.
Architecture
- FormatSchema base (
format-schema.ts) — excellent extraction. Subclasses only need_validate(),_errorMessage, and optionally_jsonSchemaExtra(). The generic_clone()usingthis.constructoreliminates boilerplate across all 16 schemas. - Each format file is 11-17 lines. Clean separation of concerns.
Validation Quality
- Email: RFC 5322 simplified regex, tested for ReDoS — completes adversarial input in < 100ms
- UUID: Case-insensitive, standard format
- URL: Native
URLconstructor — safe, standards-compliant - IPv4: Regex with octet range check AND leading zero rejection (fixed during review)
- IPv6: Comprehensive regex covering full, abbreviated, link-local, and mapped-IPv4 forms
- ISO dates: Proper calendar validation using
Dateconstructor (fixed during review — rejects Feb 31, non-leap Feb 29) - Base64: Regex + length % 4 check
- ID formats (cuid, ulid, nanoid): Correct character sets and lengths
Issues Fixed During Review
- ISO date accepted impossible dates (Feb 31, Apr 31) — fixed with
Dateconstructor validation - IPv4 accepted leading zeros (001.002.003.004) — fixed with stricter regex
No remaining blocking issues.
Verdict: Approve ✅
viniciusdacal
added a commit
that referenced
this pull request
Feb 22, 2026
Add 16 format schemas: email, uuid, url, hostname, ipv4, ipv6, base64, hex, jwt, cuid, ulid, nanoid, iso.date, iso.time, iso.datetime, iso.duration. Extracted FormatSchema base class for shared validation pattern. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
19 tasks
viniciusdacal
added a commit
that referenced
this pull request
Apr 5, 2026
…2053) Phase 1 of runtime feature parity tests: - Test skeleton: main.rs, common.rs (shared helpers), checklist_meta.rs (report validation) - HTTP serving tests: API delegation (#5), proxy rules (#6), logging middleware (#7) - Compilation tests: import.meta.env (#19), CSS→JS (#20), tsconfig paths (#22), /@deps endpoint (#23), /@css endpoint (#24), theme CSS injection (#25) - PARITY_REPORT.md with all 55 included + 12 deferred feature rows - Test fixtures: env-app, css-app, tsconfig-paths-app, theme-app Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
viniciusdacal
added a commit
that referenced
this pull request
Apr 5, 2026
* test(runtime): add Phase 1 parity tests — infra, HTTP, compilation (#2053) Phase 1 of runtime feature parity tests: - Test skeleton: main.rs, common.rs (shared helpers), checklist_meta.rs (report validation) - HTTP serving tests: API delegation (#5), proxy rules (#6), logging middleware (#7) - Compilation tests: import.meta.env (#19), CSS→JS (#20), tsconfig paths (#22), /@deps endpoint (#23), /@css endpoint (#24), theme CSS injection (#25) - PARITY_REPORT.md with all 55 included + 12 deferred feature rows - Test fixtures: env-app, css-app, tsconfig-paths-app, theme-app Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * test(runtime): add Phase 2 parity tests — SSR, HMR, watcher, module graph (#2053) Phase 2 of runtime feature parity tests: - SSR: verify SSR-enabled server serves HTML shell for page routes (#34) - HMR Tier 1: WebSocket update message delivery via hmr_hub.broadcast (#37) - HMR Tier 1: CSS-only update message (not full-reload) (#38) - HMR Tier 2: FileWatcher detects entry file changes in tempdir (#39) - Module graph: transitive dependency invalidation A→B→C (#40) - Shared helpers: copy_fixture() for tempdir-based watcher tests Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * test(runtime): add Phase 3 parity tests — errors, diagnostics, MCP, auto features (#2053) Phase 3 of runtime feature parity tests: - Error overlay: client error reporting via POST endpoint (#47) - Console log: ring buffer endpoint returns stored entries (#50) - MCP: Streamable HTTP responds to tools/list with 7 registered tools (#51) - MCP: tool invocation returns diagnostics result (#52) - MCP: events WebSocket delivers initial server status (#53) - Auto-install: blacklist/dedup coordination logic (#54) - Dep watcher: detects file changes in linked package dist/ (#55) All 22 parity tests passing. Full cargo test --all clean. Clippy clean. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(runtime): address review findings in parity tests (#2053) - Fix ~25 incorrect EXISTING test location references in PARITY_REPORT.md to match actual function names in static_serving.rs, client_render.rs, ssr_render.rs, and error_overlay.rs - Rename misleading ssr_redirect_returns_302_with_location_header to ssr_enabled_server_returns_html_shell_for_page_routes (test asserts 200, not 302) - Add import.meta.env.SECRET_KEY reference to env-app fixture so the non-public env var assertion actually validates the code path Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_parse,_toJSONSchema, and_clonelogic. Subclasses only implement_validate(),_errorMessage, and optionally_jsonSchemaExtra()Dateconstructor for proper calendar validation (rejects Feb 31, non-leap-year Feb 29). IPv4 rejects leading zeros in octetsTest plan
🤖 Generated with Claude Code