Files
brapi-java/docs/problem_fix/03-fix-doing/10-get-germplasm.md

42 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# GET /germplasm
> 来源BrAPI v2.1 校验报告03-fix.md
## 概要
| 项 | 值 |
| --- | --- |
| 状态 | warning |
| 方法 | GET |
| URL | `/brapi/v2/germplasm` |
| 完整 URL | `http://localhost:8081/brapi/v2/germplasm` |
| 路径模板 | `GET /germplasm` |
| 模块 | Germplasm |
| 响应时间 | 14334 ms |
## 校验详情
```
GET /germplasm
Germplasm
14334 ms
schema mismatch
schema mismatch
Json matches schema: schemas/v2.1/metadata.json (schema mismatch) — Schema: schemas/v2.1/metadata.json
Server response is not valid JSON.
Json matches schema: schemas/v2.1/Germplasm/getGermplasmResponse.json (schema mismatch) — Schema: schemas/v2.1/Germplasm/getGermplasmResponse.json
Server response is not valid JSON.
```
---
## 修复说明
- **根因**:种子数据在 `additional_info.value` 中以 Java 序列化形式存储 `Boolean.TRUE``GermplasmService.convertFromEntity()``UpdateUtility.convertFromEntity()` 调用 `entity.getAdditionalInfoMap()` 映射 `additionalInfo`,原先直接返回反序列化后的 `Boolean`Jackson 序列化为 JSON boolean与 BrAPI schema`additionalInfo` 各值须为 string不符校验器报 schema mismatch / not valid JSON。
- **修复**:在 `BrAPIPrimaryEntity.getAdditionalInfoMap()` 中对每个值使用 `String.valueOf()`,使 `dummyData` 等字段以 `"true"` 字符串返回(与 #2 attributevalues、#8 crossingprojects 等共用修复)。
- **验证**`GET /brapi/v2/germplasm` 返回 20030 条记录中 3 条含 `dummyData`,均为 JSON 字符串 `"dummyData":"true"`,响应体可正常解析为 JSON。
---
**状态:已完成**