我在" zip2ndPart"的骆驼路线中将json的大小写转换为xml有问题。当我创建元素时,一切都运行正常,但后来我意识到用户想要属性。
如果我这样做
@XmlElement
String zip2ndPart
它工作正常。但是,
@XmlAttribute
String zip2ndPart
正在利用" N"在" 2"之后。我试过添加一个没有运气的二传手。 json相当新,有点困惑。
还尝试了@JsonProperty(' zip2ndPart')其他几个答案,例如https://stackoverflow.com/questions/15303110/jackson-json-field-mapping-capitalization
,但没有快乐。
答案 0 :(得分:0)
对于映射的新手,我不知何故认为我需要使用@JsonProperty,但它当然是@XmlAttribute(name =' zip2ndPart')。