Files
brapi-java/docs/problem_fix/03-fix-doing/02-get-attributevalues.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 /attributevalues
> 来源BrAPI v2.1 校验报告03-fix.md
## 概要
| 项 | 值 |
| --- | --- |
| 状态 | warning |
| 方法 | GET |
| URL | `/brapi/v2/attributevalues` |
| 完整 URL | `http://localhost:8081/brapi/v2/attributevalues` |
| 路径模板 | `GET /attributevalues` |
| 模块 | Germplasm Attribute Values |
| 响应时间 | 7992 ms |
## 校验详情
```
GET /attributevalues
Germplasm Attribute Values
7992 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/GermplasmAttributeValues/getAttributevaluesResponse.json (schema mismatch) — Schema: schemas/v2.1/GermplasmAttributeValues/getAttributevaluesResponse.json
Server response is not valid JSON.
```
---
## 修复说明
- **根因**:种子数据在 `additional_info.value` 中以 Java 序列化形式存储 `Boolean.TRUE``GermplasmAttributeValueService.convertFromEntity()` 通过 `entity.getAdditionalInfoMap()` 映射 `additionalInfo`,原先直接返回反序列化后的 `Boolean`Jackson 输出 JSON boolean与 BrAPI schema`additionalInfo` 值须为 string不符校验器报 schema mismatch / not valid JSON。
- **修复**:在 `BrAPIPrimaryEntity.getAdditionalInfoMap()` 中对每个值使用 `String.valueOf()`,使 `dummyData` 等字段以 `"true"` 字符串返回(与 #8 crossingprojects 等共用修复)。
- **验证**`GET /brapi/v2/attributevalues` 返回 20025 条记录中 3 条含 `dummyData`,均为 JSON 字符串 `"dummyData":"true"`,无 boolean 类型。
---
**状态:已完成**