fix(objectql): surface human validation messages in ValidationError.message#2577
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 14 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
…essage An object-level validation rule's author-written message (often localized, e.g. 最小水深不能大于最大水深。) was buried in fields[] while the top-level Error.message — what the console toast, CLI, and SDK callers display — only said "Validation failed for 1 field(s): _record (rule_violation)". Build the top-level message from the per-field human messages (joined with '; '), falling back to "field (code)" when a message is blank. code/fields[] stay unchanged for programmatic consumers.
os-zhuang
added a commit
that referenced
this pull request
Jul 16, 2026
…ntract in detail-shapes e2e (#3047) Last mile of the #2548 follow-up series: the vendored console pin moves past objectui#2577 so `objectstack dev --ui` gets the detail-page UX fixes, and detail-shapes e2e now pins that contract (strip title dedupe, group icon svg + description, currencyConfig symbols, no dangling footer). Local run against the rebuilt vendored console: 3/3 green (check:console-sha ✓).
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.
问题
项目反馈:对象级校验规则(ADR-0020
validations[])拦截保存时,console 右下角报错 toast 只显示通用英文文案:而规则作者写的本地化
message(如最小水深不能大于最大水深。)完全没有露出,用户不知道哪里填错了。根因
作者的 message 全链路都在
ValidationError.fields[].message里(rule-validator → REST 400 信封fields[]→ client SDKerror.details),但所有通用 UI(console toast、CLI、SDK 调用方)显示的是顶层Error.message,而它此前只包含field (code)摘要。修复
在唯一的咽喉点 ——
ValidationError构造函数 —— 把顶层 message 改为由各 field error 的人类可读 message 拼接(;分隔),message 为空时才回退到field (code)。code(VALIDATION_FAILED)和fields[]机读契约不变,REST 信封形状不变测试
ValidationError — top-level message is human-readable(4 例:单条 verbatim/多条拼接/空 message 回退/机读契约不变)packages/objectql:60 文件 749 用例全绿packages/rest:8 文件 198 用例全绿(信封断言 code,不受影响)