- Sort Score
- Num 10 results
- Language All
Results 1 - 10 of 152 for serialize (0.08 seconds)
-
docs/en/docs/advanced/json-base64-bytes.md
"content": "hello" } ``` ## Pydantic `bytes` for Output Data { #pydantic-bytes-for-output-data } You can also use `bytes` fields with `ser_json_bytes` in the model config for output data, and Pydantic will *serialize* the bytes as base64 when generating the JSON response. {* ../../docs_src/json_base64_bytes/tutorial001_py310.py ln[1:2,12:16,29,38:41] hl[16] *}
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 2.4K bytes - Click Count (0) -
fastapi/responses.py
category=FastAPIDeprecationWarning, stacklevel=2, ) class UJSONResponse(JSONResponse): """JSON response using the ujson library to serialize data to JSON. **Deprecated**: `UJSONResponse` is deprecated. FastAPI now serializes data directly to JSON bytes via Pydantic when a return type or response model is set, which is faster and doesn't need a custom response class. Read more in theCreated: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Mar 01 09:21:52 GMT 2026 - 3.6K bytes - Click Count (0) -
docs/en/docs/advanced/custom-response.md
With a response model, FastAPI will use Pydantic to serialize the data to JSON, without using intermediate steps, like converting it with `jsonable_encoder`, which would happen in any other case. And under the hood, Pydantic uses the same underlying Rust mechanisms as `orjson` to serialize to JSON, so you will already get the best performance with a response model.
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 11K bytes - Click Count (0) -
docs/en/docs/advanced/response-directly.md
When you create a **FastAPI** *path operation* you can normally return any data from it: a `dict`, a `list`, a Pydantic model, a database model, etc. If you declare a [Response Model](../tutorial/response-model.md) FastAPI will use it to serialize the data to JSON, using Pydantic. If you don't declare a response model, FastAPI will use the `jsonable_encoder` explained in [JSON Compatible Encoder](../tutorial/encoder.md) and put it in a `JSONResponse`.
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 4K bytes - Click Count (0) -
src/main/java/org/codelibs/core/io/SerializeUtil.java
return ObjectInputFilter.Status.REJECTED; }; /** * Tests if the object can be serialized. * * @param obj the object to be serialized (must not be {@literal null}) * @return the deserialized object */ public static Object serialize(final Object obj) { assertArgumentNotNull("obj", obj); final byte[] binary = fromObjectToBinary(obj);Created: Fri Apr 03 20:58:12 GMT 2026 - Last Modified: Thu Feb 12 12:10:45 GMT 2026 - 8.9K bytes - Click Count (0) -
docs/en/docs/tutorial/server-sent-events.md
If you declare the return type as `AsyncIterable[Item]`, FastAPI will use it to **validate**, **document**, and **serialize** the data using Pydantic. {* ../../docs_src/server_sent_events/tutorial001_py310.py ln[1:25] hl[10:12,23] *} /// tip As Pydantic will serialize it in the **Rust** side, you will get much higher **performance** than if you don't declare a return type. ///Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 4.6K bytes - Click Count (0) -
docs/en/docs/tutorial/stream-json-lines.md
If you declare the return type, FastAPI will use it to **validate** the data, **document** it in OpenAPI, **filter** it, and **serialize** it using Pydantic. /// tip As Pydantic will serialize it in the **Rust** side, you will get much higher **performance** than if you don't declare a return type. ///
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 4.3K bytes - Click Count (0) -
fastapi/.agents/skills/fastapi/SKILL.md
@app.post("/items/") async def create_item(item: Item, project_id: Annotated[int, Query(...)]): ... ``` ## Return Type or Response Model When possible, include a return type. It will be used to validate, filter, document, and serialize the response. ```python from fastapi import FastAPI from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str description: str | None = None
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Mar 01 10:05:57 GMT 2026 - 10.1K bytes - Click Count (0) -
architecture/standards/0002-avoid-using-java-serialization.md
* Existing usages of Serializer outside of this infrastructure should be migrated to use it. * Existing usages of Java serialization should be migrated to use it. * It is ok for Serializer to be used as a replacement for Java serialization as a migration step.
Created: Wed Apr 01 11:36:16 GMT 2026 - Last Modified: Thu Mar 05 14:05:45 GMT 2026 - 2.3K bytes - Click Count (0) -
docs/en/docs/reference/responses.md
However, they are now deprecated as you will now get better performance by using a [Response Model - Return Type](https://fastapi.tiangolo.com/tutorial/response-model/). That way, Pydantic will serialize the data into JSON bytes on the Rust side, which will achieve better performance than these custom JSON responses.
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Feb 22 16:34:59 GMT 2026 - 4.4K bytes - Click Count (0)