Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: attributes and sub-attributes naming in aggregation #19

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ public static LinkedHashMap<String, ArrayList<JsonElement>> cropLinkedHashMap(Li

public void aggregateInitialAttributes(String attributePrefix, ArrayList<AttributesLD> attributes, LinkedHashMap<String, ArrayList<JsonElement>> aggregation ) {
for (AttributesLD attribute : attributes) {
String attrName = (attributePrefix.isEmpty() ? attribute.getAttrName() : attributePrefix + "_") + attribute.getAttrName();
String attrName = (attributePrefix.isEmpty() ? attributePrefix : attributePrefix + "_") + attribute.getAttrName();
aggregation.put(attrName, new ArrayList<>());
aggregation.put(attrName + NGSIConstants.AUTOGENERATED_ATTR_TYPE, new ArrayList<>());
if (attribute.isHasSubAttrs()) {
Expand All @@ -333,7 +333,7 @@ public void aggregateInitialAttributes(String attributePrefix, ArrayList<Attribu

public void aggregateAttributeValues(String attributePrefix, ArrayList<AttributesLD> attributes, LinkedHashMap<String, ArrayList<JsonElement>> aggregation) {
for (AttributesLD attribute : attributes) {
String attrName = (attributePrefix.isEmpty() ? attribute.getAttrName() : attributePrefix + "_") + attribute.getAttrName();
String attrName = (attributePrefix.isEmpty() ? attributePrefix : attributePrefix + "_") + attribute.getAttrName();
String attrType = attribute.getAttrType();
JsonElement attrValue = new JsonPrimitive(attribute.getAttrValue());
if (aggregation.containsKey(attrName)) {
Expand Down
Loading