Using `@XmlAttribute` for property with non-scalar type prevents serialization as attribute for other properties
まだ誰も着手していません。
評価
調査の方向性
Start with the Bug2.main reproducer and run the two XmlMapper serialization cases shown in the issue. Trace how the JAXB @XmlAttribute annotations are handled for the non-scalar Bean field, then verify that the behavior for start, bean, and end matches an explicitly agreed outcome and add a regression test if the project’s test location is identified.
索引モデルが issue の本文から書いたものです。
説明
Look at the last line of this class.
Incorrect using @XmlAttribute for a bean serialization breaks a serialization of other properties.
I excepted to see an error or bean value as an attribute value.
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.dataformat.xml.JacksonXmlModule;
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
import com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
public class Bug2 {
@XmlRootElement(name = "bean")
public static class Bean {
}
@XmlRootElement(name = "root")
public static class Container {
@XmlAttribute(name = "start")
public String start;
@XmlAttribute(name = "bean")
public Bean bean;
@XmlAttribute(name = "end")
public String end;
}
public static void main(String[] args) throws JsonProcessingException {
XmlMapper xmlMapper = new XmlMapper();
xmlMapper.registerModule(new JaxbAnnotationModule());
xmlMapper.registerModule(new JacksonXmlModule());
Container container = new Container();
container.start = "!start";
container.end = "!end";
System.out.println(xmlMapper.writeValueAsString(container)); // print <root xmlns="" start="!start" end="!end"></root>
Bean bean = new Bean();
container.bean = bean;
System.out.println(xmlMapper.writeValueAsString(container)); // print <root xmlns="" start="!start"><bean></bean><end>!end</end></root>
}
}
- 主要言語
- Java
- スター
- 636
- フォーク
- 250
- 平均マージ
- 7時間 10分
- マージ済み PR(30日)
- 8
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
FasterXML/jackson-dataformat-xml のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
FasterXML/jackson-dataformat-xml#931 · コメント 3 件 ·
-
XmlMapper with `FAIL_ON_UNKNOWN_PROPERTIES` fails on whitespace-only element対応中かも @arimu1 が 89 日前に担当しました。 オープンto-evaluate
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
-
3.x
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
FasterXML/jackson-dataformat-xml#787 · コメント 1 件 ·
FasterXML/jackson-dataformat-xml の issue をすべて見る
似ている issue
-
Cleanup: restore the interrupt flag in AiFailureAnalyzer対応中かも @Rishankgupta08 が今日担当しました。 オープンgood first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
seleniumboot/selenium-boot#258 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
dense-analysis/ale#5181 ·
-
bug subsystem:agent-harness triage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
ShaftHQ/SHAFT_ENGINE#8043 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
johanhaleby/occurrent#1505 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信