Skip to content

Commit 24a67da

Browse files
Fix collectted variable bug (#500)
* fix bug in convertListVar * Update CHANGELOG.md
1 parent 7ce9e6f commit 24a67da

2 files changed

Lines changed: 15 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# Changelog
2+
## 2.6.10 [TODO]
3+
### Fixed
4+
- Aligned the conversion logic for multi-iteration variables with single-value variables during collectedVariables creation to avoid unexpected xxx.0 values for INTEGER variables.
5+
26
## 2.6.9 [2026-06-11]
37
### Fixed
48
- Delete only expired V2 schedules from dataProcessingContext

src/main/java/fr/insee/genesis/domain/converter/rawdata/RawResponseConverter.java

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -164,16 +164,19 @@ private static void convertListVar(
164164
VariablesMap variablesMap,
165165
List<VariableModel> destination
166166
) {
167-
List<String> values = JsonUtils.asStringList(valuesForState);
167+
if (!(valuesForState instanceof List<?> values)) {
168+
throw new IllegalArgumentException("Object is not a List");
169+
}
168170

169-
if (!values.isEmpty()) {
170-
int iteration = 1;
171-
for (String value : values) {
172-
if (value != null && !value.isEmpty()) {
173-
convertOneVar(variableEntry, value, variablesMap, iteration, destination);
174-
}
175-
iteration++;
171+
int iteration = 1;
172+
for (Object rawValue : values) {
173+
String value = rawValue == null ? null : getValueString(rawValue);
174+
175+
if (value != null && !value.isEmpty()) {
176+
convertOneVar(variableEntry, value, variablesMap, iteration, destination);
176177
}
178+
179+
iteration++;
177180
}
178181
}
179182

0 commit comments

Comments
 (0)