8
8
from __future__ import annotations
9
9
10
10
import json
11
+ import warnings
11
12
from pathlib import Path , PosixPath , WindowsPath
12
13
from typing import TYPE_CHECKING , Any , Callable
13
14
@@ -82,14 +83,20 @@ def __init__(
82
83
you don't need the full data as it can be infered again
83
84
using the base data. If you want to feed a non-Python
84
85
tool instead, dump the full data.
85
- docstring_parser: The docstring parser to use. By default, no parsing is done.
86
- docstring_options: Additional docstring parsing options.
86
+ docstring_parser: Deprecated. The docstring parser to use. By default, no parsing is done.
87
+ docstring_options: Deprecated. Additional docstring parsing options.
87
88
**kwargs: See [`json.JSONEncoder`][].
88
89
"""
89
90
super ().__init__ (* args , ** kwargs )
90
91
self .full : bool = full
92
+
93
+ # TODO: Remove at some point.
91
94
self .docstring_parser : Parser | None = docstring_parser
92
95
self .docstring_options : dict [str , Any ] = docstring_options or {}
96
+ if docstring_parser is not None :
97
+ warnings .warn ("Parameter `docstring_parser` is deprecated and has no effect." , stacklevel = 1 )
98
+ if docstring_options is not None :
99
+ warnings .warn ("Parameter `docstring_options` is deprecated and has no effect." , stacklevel = 1 )
93
100
94
101
def default (self , obj : Any ) -> Any :
95
102
"""Return a serializable representation of the given object.
@@ -101,7 +108,7 @@ def default(self, obj: Any) -> Any:
101
108
A serializable representation.
102
109
"""
103
110
try :
104
- return obj .as_dict (full = self .full , docstring_parser = self . docstring_parser , ** self . docstring_options )
111
+ return obj .as_dict (full = self .full )
105
112
except AttributeError :
106
113
return _json_encoder_map .get (type (obj ), super ().default )(obj )
107
114
0 commit comments