MCPcopy
hub / github.com/fastapi/fastapi / render

Method render

docs_src/custom_response/tutorial009c_py310.py:12–14  ·  view source on GitHub ↗
(self, content: Any)

Source from the content-addressed store, hash-verified

10 media_type = "application/json"
11
12 def render(self, content: Any) -> bytes:
13 assert orjson is not None, "orjson must be installed"
14 return orjson.dumps(content, option=orjson.OPT_INDENT_2)
15
16
17@app.get("/", response_class=CustomORJSONResponse)

Callers

nothing calls this directly

Calls 1

dumpsMethod · 0.45

Tested by

no test coverage detected