- Sort Score
- Num 10 results
- Language All
Results 21 - 30 of 146 for 4064 (0.03 seconds)
-
docs/ru/docs/advanced/additional-responses.md
**FastAPI** возьмёт эту модель, сгенерирует для неё JSON‑схему и включит её в нужное место в OpenAPI. Например, чтобы объявить ещё один ответ со статус-кодом `404` и Pydantic-моделью `Message`, можно написать: {* ../../docs_src/additional_responses/tutorial001_py310.py hl[18,22] *} /// note | Примечание Имейте в виду, что необходимо возвращать `JSONResponse` напрямую. ///Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 17:56:20 GMT 2026 - 12.2K bytes - Click Count (0) -
docs_src/sql_databases/tutorial001_py310.py
hero = session.get(Hero, hero_id) if not hero: raise HTTPException(status_code=404, detail="Hero not found") return hero @app.delete("/heroes/{hero_id}") def delete_hero(hero_id: int, session: Session = Depends(get_session)): hero = session.get(Hero, hero_id) if not hero: raise HTTPException(status_code=404, detail="Hero not found") session.delete(hero) session.commit()
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Wed Oct 09 19:44:42 GMT 2024 - 1.7K bytes - Click Count (0) -
internal/config/api/api.go
if maxVerStr == "" { maxVerStr = env.Get(EnvAPIObjectMaxVersionsLegacy, kvs.Get(apiObjectMaxVersions)) } if maxVerStr != "" { maxVersions, err := strconv.ParseInt(maxVerStr, 10, 64) if err != nil { return cfg, err } if maxVersions <= 0 { return cfg, fmt.Errorf("invalid object max versions value: %v", maxVersions) } cfg.ObjectMaxVersions = maxVersions } else {Created: Sun Apr 05 19:28:12 GMT 2026 - Last Modified: Fri Aug 29 02:39:48 GMT 2025 - 11.5K bytes - Click Count (1) -
docs/uk/docs/advanced/additional-responses.md
**FastAPI** візьме цю модель, згенерує її Схему JSON і додасть у відповідне місце в OpenAPI. Наприклад, щоб оголосити іншу відповідь з кодом статусу `404` і Pydantic-моделлю `Message`, ви можете написати: {* ../../docs_src/additional_responses/tutorial001_py310.py hl[18,22] *} /// note | Примітка Майте на увазі, що потрібно повертати `JSONResponse` безпосередньо.Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 18:27:41 GMT 2026 - 11.7K bytes - Click Count (0) -
docs_src/additional_responses/tutorial004_py310.py
from fastapi import FastAPI from fastapi.responses import FileResponse from pydantic import BaseModel class Item(BaseModel): id: str value: str responses = { 404: {"description": "Item not found"}, 302: {"description": "The item was moved"}, 403: {"description": "Not enough privileges"}, } app = FastAPI() @app.get( "/items/{item_id}", response_model=Item,
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Wed Dec 10 08:55:32 GMT 2025 - 669 bytes - Click Count (0) -
docs/pt/docs/advanced/additional-responses.md
O **FastAPI** pegará este modelo, gerará o esquema JSON dele e incluirá no local correto do OpenAPI. Por exemplo, para declarar um outro retorno com o status code `404` e um modelo do Pydantic chamado `Message`, você pode escrever: {* ../../docs_src/additional_responses/tutorial001_py310.py hl[18,22] *} /// note | Nota Lembre-se que você deve retornar o `JSONResponse` diretamente.Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 18:20:43 GMT 2026 - 9.4K bytes - Click Count (0) -
tests/test_no_swagger_ui_redirect.py
print(client.base_url) assert "oauth2RedirectUrl" not in response.text def test_swagger_ui_no_oauth2_redirect(): response = client.get("/docs/oauth2-redirect") assert response.status_code == 404, response.text def test_response(): response = client.get("/items/")
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Wed Apr 08 04:37:38 GMT 2020 - 786 bytes - Click Count (0) -
docs/zh-hant/docs/advanced/additional-responses.md
它接收一個 `dict`:鍵是各回應的狀態碼(例如 `200`),值是另一個 `dict`,其中包含每個回應的資訊。 每個回應的 `dict` 都可以有一個鍵 `model`,包含一個 Pydantic 模型,與 `response_model` 類似。 **FastAPI** 會取用該模型、產生其 JSON Schema,並把它放到 OpenAPI 中正確的位置。 例如,要宣告一個狀態碼為 `404` 的額外回應,並使用 Pydantic 模型 `Message`,你可以這樣寫: {* ../../docs_src/additional_responses/tutorial001_py310.py hl[18,22] *} /// note | 注意 請記住你必須直接回傳 `JSONResponse`。 /// /// info | 說明Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:05:38 GMT 2026 - 8.6K bytes - Click Count (0) -
src/test/java/org/codelibs/fess/exception/WebApiExceptionTest.java
public class WebApiExceptionTest extends UnitFessTestCase { @Test public void test_constructor_withStatusCodeAndMessage() { // Test constructor with status code and message int statusCode = 404; String message = "Resource not found"; WebApiException exception = new WebApiException(statusCode, message); assertEquals(statusCode, exception.getStatusCode());Created: Tue Mar 31 13:07:34 GMT 2026 - Last Modified: Sun Jan 11 08:43:05 GMT 2026 - 9.5K bytes - Click Count (0) -
docs/ko/docs/advanced/additional-responses.md
각 응답 `dict`에는 `response_model`처럼 Pydantic 모델을 담는 `model` 키가 있을 수 있습니다. **FastAPI**는 그 모델을 사용해 JSON Schema를 생성하고, OpenAPI의 올바른 위치에 포함합니다. 예를 들어, 상태 코드 `404`와 Pydantic 모델 `Message`를 사용하는 다른 응답을 선언하려면 다음과 같이 작성할 수 있습니다: {* ../../docs_src/additional_responses/tutorial001_py310.py hl[18,22] *} /// note | 참고 `JSONResponse`를 직접 반환해야 한다는 점을 기억하세요. ///Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 14:06:26 GMT 2026 - 9.6K bytes - Click Count (0)