Skip to content

Commit

Permalink
feat(uniquet): bring sorting and pretty print feature (#3700)
Browse files Browse the repository at this point in the history
  • Loading branch information
mathias-vandaele authored Nov 26, 2024
1 parent bfdf01e commit 1de0802
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion element-template-generator/uniquet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ Executables for Windows and Unix systems are provided (`.bat` and Shell scripts,
`--git-repository` or `-g` is the location of the git repository.

```shell
uniquet --destination ~/Desktop/singlefile.json --branch main
./element-template-generator/uniquet/target/appassembler/bin/uniquet --destination ./connectors-file.json --branch main
```
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,14 @@
package io.camunda.connector.uniquet.core;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import io.camunda.connector.uniquet.dto.Engine;
import io.camunda.connector.uniquet.dto.OutputElementTemplate;
import io.camunda.connector.uniquet.dto.VersionValue;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.*;
import java.util.stream.Collectors;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.Repository;
Expand Down Expand Up @@ -108,9 +106,11 @@ private void analyzeCommit(RevCommit commit) {
}

public GitCrawler persist(String location) {

ObjectMapper objectMapper = new ObjectMapper();
objectMapper.configure(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS, true);
try (FileWriter myWriter = new FileWriter(location)) {
myWriter.write(new ObjectMapper().writeValueAsString(fromMap(this.result)));
myWriter.write(
objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(fromMap(this.result)));
} catch (Exception e) {
throw new RuntimeException(e);
}
Expand Down

0 comments on commit 1de0802

Please sign in to comment.