MCPcopy Index your code
hub / github.com/microsoft/data-formulator / json_ok

Function json_ok

py-src/data_formulator/error_handler.py:205–216  ·  view source on GitHub ↗

Build a unified success JSON response. Returns ``(Response, status_code)`` for Flask. The envelope uses ``"status": "success"`` (not legacy ``"ok"``) and wraps the payload in the ``"data"`` key:: {"status": "success", "data": {...}} The response body must not include endp

(data: object = None, *, status_code: int = 200)

Source from the content-addressed store, hash-verified

203# ---------------------------------------------------------------------------
204
205def json_ok(data: object = None, *, status_code: int = 200) -> tuple:
206 """Build a unified success JSON response.
207
208 Returns ``(Response, status_code)`` for Flask. The envelope uses
209 ``"status": "success"`` (not legacy ``"ok"``) and wraps the payload
210 in the ``"data"`` key::
211
212 {"status": "success", "data": {...}}
213
214 The response body must not include endpoint-specific top-level fields.
215 """
216 return jsonify({"status": "success", "data": data}), status_code
217
218
219def stream_preflight_error(error: AppError) -> tuple:

Callers 15

list_data_loadersFunction · 0.90
pick_local_directoryFunction · 0.90
list_connectorsFunction · 0.90
create_connectorFunction · 0.90
delete_connectorFunction · 0.90
connector_connectFunction · 0.90
connector_disconnectFunction · 0.90
connector_get_statusFunction · 0.90
connector_get_catalogFunction · 0.90

Calls

no outgoing calls

Tested by 1

test_modelFunction · 0.72