empty string is converted to empty object in LoopBack3
维护者通常 4 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript, mysql, node.js
- 领域
- database
调研方向
首先,使用 LoopBack 3.28.0、loopback-connector-mysql 7.0.5 以及此处描述的 nullable string id 模型复现该行为。跟踪读取该属性时使用的 MySQL connector 路径;完成标准是空字符串仍保持为空字符串,而 null 和非空字符串保持其现有行为。
由索引模型根据 Issue 内容生成。
描述
Steps to reproduce
LookBack version: 3.28.0
loopback-connector-mysql version: 7.0.5
This bug occurred after we upgraded the version of loopback-connector-mysql from 4.1.0 to 7.0.5.
define a nullable property in lb3 model like this:
"properties": {
"id": {
"type": "string",
"required": false,
"length": 255,
"precision": null,
"scale": null,
"default":null,
"mysql": {
"columnName": "id",
"dataType": "VARCHAR",
"dataLength": 255,
"dataPrecision": null,
"dataScale": null,
"nullable": "Y"
}
}
}
And then simply get this model from lb.
Bbserved Result
If id is an empty string, it will be converted to empty object. If id is null or non-empty string, it will be returned directly.
Expected Behavior
Empty string shouldn't be converted to empty object, and should be returned directly as null or non-empty string.
Additional information
node -e 'console.log(process.platform, process.arch, process.versions.node)'
darwin arm64 20.9.0
npm ls --prod --depth 0 | grep loopback
npm WARN config production Use
--omit=devinstead.
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
- 主要语言
- JavaScript
- 星标
- 126
- 派生
- 181
- 平均合并
- 3 天 22 小时
- 30 天内合并 PR
- 11
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
loopbackio/loopback-connector-mysql 的其他 Issue
-
bug
难度 4/5 3-5 天 新手友好度 25/100
loopbackio/loopback-connector-mysql#614 · 1 条评论 · 1 个 reaction ·
维护者通常 4 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 55/100
loopbackio/loopback-connector-mysql#606 · 1 条评论 ·
维护者通常 4 天内回复
-
bug
难度 3/5 1-2 天 新手友好度 35/100
loopbackio/loopback-connector-mysql#592 ·
维护者通常 4 天内回复
-
feature
难度 4/5 3-5 天 新手友好度 35/100
loopbackio/loopback-connector-mysql#517 · 3 条评论 · 3 个 reaction ·
维护者通常 4 天内回复
-
难度 3/5 1-2 天 新手友好度 15/100
loopbackio/loopback-connector-mysql#488 ·
维护者通常 4 天内回复
查看 loopbackio/loopback-connector-mysql 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
ipfs/ipfs-webui#2507 ·
-
Environments table lists page size 5 after 30可能已有人在做 @raus7n 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 90/100
litmuschaos/litmus#5743 ·
维护者通常 2 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 63/100
anothaDev/luci-theme-vantage#143 ·
维护者通常 1 天内回复
-
desktop grp:admin-donors type:graphics-bug ui-admin
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
kingcharleslzy-ai/dsh-purge#282 ·
维护者通常 1 天内回复