Skip to content

Commit e606fa0

Browse files
committed
DotNet: Fix the mapping of XML attribute names
For mapping attribute (not node) names, the JacksonXmlProperty instead of the JsonProperty annotation must be used. Signed-off-by: Sebastian Schuberth <sebastian.schuberth@here.com>
1 parent db58e3a commit e606fa0

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

analyzer/src/main/kotlin/managers/DotNet.kt

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ class DotNet(
5858

5959
itemGroups.forEach { itemGroup ->
6060
itemGroup.packageReference?.forEach {
61-
if (!it.Include.isNullOrEmpty()) {
62-
map[it.Include] = it.Version ?: " "
61+
if (!it.include.isNullOrEmpty()) {
62+
map[it.include] = it.version ?: " "
6363
}
6464
}
6565
}
@@ -76,12 +76,10 @@ class DotNet(
7676

7777
@JsonIgnoreProperties(ignoreUnknown = true)
7878
data class PackageReference(
79-
@JsonProperty(value = "Include")
80-
@JacksonXmlProperty(isAttribute = true)
81-
val Include: String?,
82-
@JsonProperty(value = "Version")
83-
@JacksonXmlProperty(isAttribute = true)
84-
val Version: String?
79+
@JacksonXmlProperty(isAttribute = true, localName = "Include")
80+
val include: String?,
81+
@JacksonXmlProperty(isAttribute = true, localName = "Version")
82+
val version: String?
8583
)
8684
}
8785

0 commit comments

Comments
 (0)