File tree 1 file changed +16
-4
lines changed
1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -154,11 +154,23 @@ objects pass the URI to a callable, set with the keyword argument ``loader``.
154
154
This callable must take the URI as an argument, and return the parsed JSON
155
155
referred to by that URI.
156
156
157
- The :class: `JsonLoader ` class is provided to fill this role, and a default
158
- instance of it will be used for all refs unless a custom one is specified.
157
+ The :func: `jsonloader ` function is provided to fill this role. It handles http, https,
158
+ and file references.
159
+
160
+ .. autofunction :: jsonloader
161
+
162
+ If you wish to pass extra arguments to :func: `json.loads ` call, they can be passed
163
+ through kwargs to this function. e.g.::
164
+
165
+ import decimal
166
+ import functools
167
+
168
+ import jsonref
169
+
170
+
171
+ loader = functools.partial(jsonref.jsonloader, parse_float=decimal.Decimal)
172
+ result = jsonref.load_uri("https://my_doc_uri", loader=loader)
159
173
160
- .. autoclass :: JsonLoader
161
- :members: __call__
162
174
163
175
Custom Loaders
164
176
----------
You can’t perform that action at this time.
0 commit comments