Skip to content

Commit a31d484

Browse files
committed
improve api output serialization
for better readability
1 parent 825beaf commit a31d484

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

contentctl/objects/lookup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def serialize_model(self):
5959
model= {
6060

6161
"default_match": "true" if self.default_match is True else "false",
62-
"match_type": self.match_type,
62+
"match_type": self.match_type_to_conf_format,
6363
"min_matches": self.min_matches,
6464
"max_matches": self.max_matches,
6565
"case_sensitive_match": "true" if self.case_sensitive_match is True else "false",

contentctl/output/api_json_output.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
from typing import TYPE_CHECKING
33
if TYPE_CHECKING:
44
from contentctl.objects.detection import Detection
5-
from contentctl.objects.lookup import Lookup, FileBackedLookup
5+
from contentctl.objects.lookup import Lookup
66
from contentctl.objects.macro import Macro
7-
from contentctl.objects.dashboard import Dashboard
87
from contentctl.objects.story import Story
98
from contentctl.objects.baseline import Baseline
109
from contentctl.objects.investigation import Investigation
@@ -215,7 +214,7 @@ def writeLookups(
215214
"name",
216215
"description",
217216
"collection",
218-
"fields_to_fields_list_conf_format",
217+
"fields_list",
219218
"filename",
220219
"default_match",
221220
"match_type",

contentctl/output/json_writer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
class JsonWriter():
44

55
@staticmethod
6-
def writeJsonObject(file_path : str, object_name: str, objs: list[dict[str,Any]],readable_output:bool=False) -> None:
6+
def writeJsonObject(file_path : str, object_name: str, objs: list[dict[str,Any]],readable_output:bool=True) -> None:
77
try:
88
with open(file_path, 'w') as outfile:
99
if readable_output:

0 commit comments

Comments
 (0)