We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 389d237 + 13ef711 commit 2190e36Copy full SHA for 2190e36
detectors/built_in/app.py
@@ -1,3 +1,4 @@
1
+import json
2
import logging
3
4
from fastapi import HTTPException, Request
@@ -72,5 +73,11 @@ def get_registry():
72
73
raise TypeError(f"Detector {detector_type} is not a valid BaseDetectorRegistry")
74
result[detector_type] = {}
75
for detector_name, detector_fn in detector_registry.get_registry().items():
- result[detector_type][detector_name] = detector_fn.__doc__
76
+ docstring = detector_fn.__doc__
77
+ try:
78
+ # Try to parse as JSON
79
+ parsed = json.loads(docstring)
80
+ result[detector_type][detector_name] = parsed
81
+ except Exception:
82
+ result[detector_type][detector_name] = docstring
83
return result
0 commit comments