Strongly Typed Content Item Converter does not support mapping name from an Option
还没有人认领这个 Issue。
- #75 来自 @cunhazera —— 已关闭,未合并
评估
调研方向
先阅读 MultipleChoiceElement.java 和 Option.java,然后定位强类型内容项转换器及其现有的元素映射测试。确认当前如何将一个 Option 分配给字段,并定义拟议 annotation 的预期名称映射;当示例映射能够正常工作且现有转换行为保持不变时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Motivation
When rendering a multiple choice elements in a strongly typed model, one must access the List<Option> value property of the MultipleChoiceElement class, which might be tedious. There should be a more straightforward path to the names of options.
One potential way to handle this would be like the following:
@ContentItemMapping("product")
public class Product {
@ElementMapping("product_categories")
List<Option> productCategories;
//New feature
@ElementMappingOption(elementCodeName = "product_categories", optionCodeName = "footwear")
Boolean isFootwear;
}
Original description
If an Option is mapped to a field, the name from the option should be used.
- 主要语言
- Java
- 星标
- 17
- 派生
- 27
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
kontent-ai/java-packages 的其他 Issue
-
hacktoberfest refactoring
难度 2/5 1-3 小时 新手友好度 45/100
kontent-ai/java-packages#142 · 1 条评论 ·
-
hacktoberfest
难度 4/5 3-5 天 新手友好度 35/100
kontent-ai/java-packages#140 · 3 条评论 ·
-
难度 4/5 3-5 天 新手友好度 25/100
kontent-ai/java-packages#135 · 1 条评论 ·
-
难度 3/5 1-2 天 新手友好度 45/100
kontent-ai/java-packages#134 ·
-
enhancement
难度 4/5 3-5 天 新手友好度 35/100
kontent-ai/java-packages#128 · 3 条评论 ·
查看 kontent-ai/java-packages 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
openhab/openhab-addons#22512 ·
维护者通常 1 天内回复
-
help wanted maintenance
难度 2/5 1-3 小时 新手友好度 84/100
apache/maven-project-info-reports-plugin#704 ·
维护者通常 1 天内回复
-
help wanted maintenance
难度 2/5 1-3 小时 新手友好度 78/100
apache/maven-ejb-plugin#261 ·
维护者通常 1 天内回复
-
help wanted maintenance
难度 2/5 1-3 小时 新手友好度 78/100
apache/maven-archetype#1086 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 77/100
维护者通常 1 天内回复