splunk-soar-sdk 2.0.0__py3-none-any.whl → 2.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -182,20 +182,29 @@ class ActionOutput(BaseModel):
182
182
  field_type = field.annotation
183
183
  datapath = parent_datapath + f".{field_name}"
184
184
 
185
- # Handle list types, even nested ones
186
- while get_origin(field_type) is list:
187
- field_type = get_args(field_type)[0]
188
- datapath += ".*"
189
-
190
- if get_origin(field_type) is Union or get_origin(field_type) is Optional:
185
+ # Handle lists and optional types, even nested ones
186
+ origin = get_origin(field_type)
187
+ while origin in [list, Union, Optional]:
191
188
  type_args = [
192
- arg for arg in get_args(field_type) if arg is not type(None)
189
+ arg
190
+ for arg in get_args(field_type)
191
+ if arg is not type(None) and arg is not None
193
192
  ]
194
- if len(type_args) > 1:
195
- raise TypeError(
196
- f"Output field {field_name} is invalid: the only valid Union type is Optional, or Union[X, None]."
197
- )
193
+
194
+ if origin is list:
195
+ if len(type_args) != 1:
196
+ raise TypeError(
197
+ f"Output field {field_name} is invalid: List types must have exactly one non-null type argument."
198
+ )
199
+ datapath += ".*"
200
+ else:
201
+ if len(type_args) != 1:
202
+ raise TypeError(
203
+ f"Output field {field_name} is invalid: the only valid Union type is Optional, or Union[X, None]."
204
+ )
205
+
198
206
  field_type = type_args[0]
207
+ origin = get_origin(field_type)
199
208
 
200
209
  if issubclass(field_type, ActionOutput):
201
210
  # If the field is another ActionOutput, recursively call _to_json_schema
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: splunk-soar-sdk
3
- Version: 2.0.0
3
+ Version: 2.0.1
4
4
  Summary: The official framework for developing and testing Splunk SOAR Apps
5
5
  Project-URL: Homepage, https://github.com/phantomcyber/splunk-soar-sdk
6
6
  Project-URL: Documentation, https://github.com/phantomcyber/splunk-soar-sdk
@@ -1,6 +1,6 @@
1
1
  soar_sdk/__init__.py,sha256=RzAng-ARqpK01SY82lNy4uYJFVG0yW6Q3CccEqbToJ4,726
2
2
  soar_sdk/abstract.py,sha256=jGXs2Fv5TRpnh5Duz3mWjY8_DAOpY4RSSzvw_z4XN4I,7950
3
- soar_sdk/action_results.py,sha256=VJaBzXY0CW1Ncvo0E1ospxYi1buGER6JhL2BoQ4Dbwo,9770
3
+ soar_sdk/action_results.py,sha256=7uEl1KidC2gkNOuBzOq2_3EiAGfRQYrDYD3CR-G6DKg,10116
4
4
  soar_sdk/actions_manager.py,sha256=wJCyfzkI_6OKZ-Kmll4vRJpGvYdL93Uw-JyEEGnKcw0,5779
5
5
  soar_sdk/app.py,sha256=mFzfGTtsCdlrp5Q0amj53s07oXC5Zhy7ym7U0zFPjQs,32580
6
6
  soar_sdk/app_cli_runner.py,sha256=fJoozhyAt7QUMuc02nE5RL_InpsjQBpr6U4rF9sey3E,11627
@@ -96,8 +96,8 @@ soar_sdk/views/components/pie_chart.py,sha256=LVTeHVJN6nf2vjUs9y7PDBhS0U1fKW750l
96
96
  soar_sdk/webhooks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
97
97
  soar_sdk/webhooks/models.py,sha256=-rjuFA9cRX5zTLp7cHSHVTkt5eVJD6BdESGbj_qkyHI,4540
98
98
  soar_sdk/webhooks/routing.py,sha256=BKbURSrBPdOTS5UFL-mHzFEr-Fj04mJMx9KeiPrZ2VQ,6872
99
- splunk_soar_sdk-2.0.0.dist-info/METADATA,sha256=GiFXmEsBHTw7YBcnk8OV5U48usWYNpd-djWhMy_eeiI,7361
100
- splunk_soar_sdk-2.0.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
101
- splunk_soar_sdk-2.0.0.dist-info/entry_points.txt,sha256=CgBjo2ZWpYNkt9TgvToL26h2Tg1yt8FbvYTb5NVgNuc,51
102
- splunk_soar_sdk-2.0.0.dist-info/licenses/LICENSE,sha256=gNCGrGhrSQb1PUzBOByVUN1tvaliwLZfna-QU2r2hQ8,11345
103
- splunk_soar_sdk-2.0.0.dist-info/RECORD,,
99
+ splunk_soar_sdk-2.0.1.dist-info/METADATA,sha256=tnW-I6l9Ff-Osh2mY41naJNMltUCu9AK2p7xdKe1KeE,7361
100
+ splunk_soar_sdk-2.0.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
101
+ splunk_soar_sdk-2.0.1.dist-info/entry_points.txt,sha256=CgBjo2ZWpYNkt9TgvToL26h2Tg1yt8FbvYTb5NVgNuc,51
102
+ splunk_soar_sdk-2.0.1.dist-info/licenses/LICENSE,sha256=gNCGrGhrSQb1PUzBOByVUN1tvaliwLZfna-QU2r2hQ8,11345
103
+ splunk_soar_sdk-2.0.1.dist-info/RECORD,,