Skip to content

Commit 7ce7066

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 f41e481 commit 7ce7066

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
@@ -56,8 +56,8 @@ class DotNet(
5656

5757
itemGroups.forEach { itemGroup ->
5858
itemGroup.packageReference?.forEach {
59-
if (!it.Include.isNullOrEmpty()) {
60-
map[it.Include] = it.Version ?: " "
59+
if (!it.include.isNullOrEmpty()) {
60+
map[it.include] = it.version ?: " "
6161
}
6262
}
6363
}
@@ -74,12 +74,10 @@ class DotNet(
7474

7575
@JsonIgnoreProperties(ignoreUnknown = true)
7676
data class PackageReference(
77-
@JsonProperty(value = "Include")
78-
@JacksonXmlProperty(isAttribute = true)
79-
val Include: String?,
80-
@JsonProperty(value = "Version")
81-
@JacksonXmlProperty(isAttribute = true)
82-
val Version: String?
77+
@JacksonXmlProperty(isAttribute = true, localName = "Include")
78+
val include: String?,
79+
@JacksonXmlProperty(isAttribute = true, localName = "Version")
80+
val version: String?
8381
)
8482
}
8583

0 commit comments

Comments
 (0)