Skip to content

Commit c0ef624

Browse files
authored
fix issue causing stixifier to fail when no content_check (#131)
1 parent 6c10710 commit c0ef624

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

txt2stix/utils.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import re
44
from pathlib import Path
55
from typing import Dict
6-
from pydantic import BaseModel
6+
from pydantic import BaseModel, Field
77
import bs4
88
import mistune
99
from mistune.renderers.markdown import MarkdownRenderer
@@ -49,10 +49,10 @@ def inline_html(self, token: Dict[str, dict], state: mistune.BlockState) -> str:
4949

5050

5151
class Txt2StixData(BaseModel):
52-
content_check: DescribesIncident
53-
extractions: dict
54-
relationships: list[dict]
55-
attack_flow: AttackFlowList
52+
content_check: DescribesIncident = Field(default=None)
53+
extractions: dict = Field(default=None)
54+
relationships: list[dict] = Field(default_factory=list)
55+
attack_flow: AttackFlowList = Field(default=None)
5656

5757

5858
def remove_links(input_text: str, remove_images: bool, remove_anchors: bool):

0 commit comments

Comments
 (0)