Open danielsobrado opened 2 years ago
Hi,
The following function on FilterService is creating duplicated maps when converting snake case to camel case, and both the snake case and camel case remain in the map, causing it to fail:
private HashMap<String, Object> convertToCamelCase(HashMap<String, Object> snakeCaseMap) { Set<String> keys = snakeCaseMap.keySet(); HashMap<String, Object> camelCaseMap = new HashMap<>(snakeCaseMap); for (String key : keys) { Object val = snakeCaseMap.get(key); camelCaseMap.put(convertToCamelCase(key), val); --> camelCaseMap.remove(key); } return camelCaseMap; }
I included camelCaseMap.remove(key); to properly replace the key instead of adding a new one.
camelCaseMap.remove(key);
@danielsobrado good point - can you please make a pull request so I can merge it? Thanks
Sure, let me create a test case and a PR.
Hi,
The following function on FilterService is creating duplicated maps when converting snake case to camel case, and both the snake case and camel case remain in the map, causing it to fail:
I included
camelCaseMap.remove(key);
to properly replace the key instead of adding a new one.