Partial serialization
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 38/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- java
调研方向
首先追踪 AbstractBomGenerator、其实现以及 Parser 实现中的 ObjectMapper 创建和自定义 serializer 注册。检查当前每个 Version 的序列化和反序列化配置方式,然后定义 public accessor 和缓存行为。当部分 BOM 对象可以使用同一个已配置的 mapper,并且重复的文档循环不会创建多余的 ObjectMapper 实例时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Currently the AbstractBomGenerator and it's implementations use several custom serializers, which are registered in an always new ObjectMapper.
Handling partial serialization of a BOM is not cleanly possible (e.g. serializing a single vulnerability or a list of components), since the ObjectMapper is not exposed and the AbstractBomGenerator signatures do not match. The only way of achieving this, while serializing exactly as this reference implementation is either using reflection hacks or by full on copy pasting the code.
Additionally, the Jackson ObjectMapper isn't a lightweight object. For a simple parse-modify-writeback loop of a cyclonedx document two separate ObjectMappers are created on every such loop, which is fully unnecessary.
Feature request / proposal:
- Decouple ObjectMapper creation and configuration from AbstractBomGenerator and Parser implementations
- Expose the ObjectMapper in a public accessor
- While at it, memorize/cache the ObjectMapper instance per Version, so that a single instance of an ObjectMapper is used for serialization and deserialization
Benefits of the change:
- enables partial serialization of BOMs and cleanly working directly with document parts.
- reduces / stabilizes memory footprint when (de-)serializing multiple documents
- improves performance when (de-)serializing from the second document onward (when the ObjectMapper has been created)
Context of this request:
I'm currently working on a private project (private for now, currently too raw / alpha) which stores and queries CycloneDX. I'm heavily using Postgres JSONB support, and being able to properly work with partial objects is a requirement for me.
Is there interest in a feature like that? I'll build that for myself anyway, but having it integrated in the core lib would be cleaner for me, and might benefit a few other people, so I gladly can make a PR.
Just wanted to ask before dropping a rather big change out of the blue.
- 主要语言
- Java
- 星标
- 122
- 派生
- 92
- 平均合并
- 1 天 11 小时
- 30 天内合并 PR
- 36
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
CycloneDX/cyclonedx-core-java 的其他 Issue
-
breaking change
难度 2/5 1-3 小时 新手友好度 72/100
CycloneDX/cyclonedx-core-java#917 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 55/100
CycloneDX/cyclonedx-core-java#902 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 58/100
CycloneDX/cyclonedx-core-java#848 ·
维护者通常 1 天内回复
-
Additional license names可能已有人在做 @bilak 于 242 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 48/100
CycloneDX/cyclonedx-core-java#792 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 48/100
CycloneDX/cyclonedx-core-java#682 ·
维护者通常 1 天内回复
查看 CycloneDX/cyclonedx-core-java 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
QuicksilverMC/Argentum#31 ·
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
navikt/mock-oauth2-server#1129 ·
维护者通常 1 天内回复
-
bug main ui
难度 2/5 1-3 小时 新手友好度 65/100
openhab/openhab-webui#4600 ·
维护者通常 4 天内回复
-
26.4 area: tags enhancement
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
`DeepSeekChatModel` streaming returns no content when chunks have no `id`可能已有人在做 @lejuho 今天认领。 未关闭status: waiting-for-triage
难度 2/5 1-3 小时 新手友好度 78/100
spring-projects/spring-ai#7214 ·
维护者通常 2 天内回复