{"id":38552,"date":"2024-11-01T18:18:10","date_gmt":"2024-11-01T18:18:10","guid":{"rendered":"http:\/\/atmokpo.com\/w\/?p=38552"},"modified":"2024-11-26T06:44:01","modified_gmt":"2024-11-26T06:44:01","slug":"fastapi-%ec%84%9c%eb%b2%84%ea%b0%9c%eb%b0%9c-fastapi%ec%9d%98-%ec%9e%90%eb%8f%99-%eb%ac%b8%ec%84%9c%ed%99%94-%ea%b8%b0%eb%8a%a5-swagger-ui-%eb%b0%8f-redoc","status":"publish","type":"post","link":"https:\/\/atmokpo.com\/w\/38552\/","title":{"rendered":"FastAPI \uc11c\ubc84\uac1c\ubc1c, FastAPI\uc758 \uc790\ub3d9 \ubb38\uc11c\ud654 \uae30\ub2a5 (Swagger UI \ubc0f ReDoc)"},"content":{"rendered":"<p><body><\/p>\n<p>\n    \ud604\ub300\uc758 \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\uc5d0\uc11c\ub294 API\uc640 \uadf8 \ubb38\uc11c\ud654\uac00 \ub9e4\uc6b0 \uc911\uc694\ud569\ub2c8\ub2e4. FastAPI\ub294<br \/>\n    \ud30c\uc774\uc36c\uc73c\ub85c \uc81c\uc791\ub41c \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, \ub192\uc740 \uc131\ub2a5\uacfc \uc0ac\uc6a9\uc758 \uc6a9\uc774\uc131 \ub355\ubd84\uc5d0 \ub9ce\uc740 \uac1c\ubc1c\uc790\ub4e4 \uc0ac\uc774\uc5d0\uc11c \uac01\uad11\ubc1b\uace0 \uc788\uc2b5\ub2c8\ub2e4.<br \/>\n    \ubcf8 \uae00\uc5d0\uc11c\ub294 FastAPI\uc758 \uc790\ub3d9 \ubb38\uc11c\ud654 \uae30\ub2a5\uc5d0 \ub300\ud574 \ub2e4\ub8f0 \uac83\uc785\ub2c8\ub2e4. \ud2b9\ud788, Swagger UI\uc640 ReDoc\uc744 \uc0ac\uc6a9\ud558\uc5ec<br \/>\n    FastAPI \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc758 API \ubb38\uc11c\ud654\ub97c \uc5b4\ub5bb\uac8c \uc218\ud589\ud558\ub294\uc9c0\uc5d0 \ub300\ud574 \uc790\uc138\ud788 \uc54c\uc544\ubcf4\uaca0\uc2b5\ub2c8\ub2e4.\n<\/p>\n<h2>1. FastAPI \uc18c\uac1c<\/h2>\n<p>\n    FastAPI\ub294 Starlette\uc640 Pydantic\uc744 \uae30\ubc18\uc73c\ub85c \uad6c\ucd95\ub41c \ud604\ub300\uc801\uc778 \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c,<br \/>\n    RESTful API\ub97c \ube60\ub974\uace0 \uc27d\uac8c \uac1c\ubc1c\ud560 \uc218 \uc788\ub3c4\ub85d \uc124\uacc4\ub418\uc5c8\uc2b5\ub2c8\ub2e4. FastAPI\uc758 \uc8fc\uc694 \ud2b9\uc9d5\uc73c\ub85c\ub294<br \/>\n    \ub9e4\uc6b0 \ube60\ub978 \uc131\ub2a5, \uc790\ub3d9\uc801\uc778 \ub370\uc774\ud130 \uac80\uc99d \ubc0f \uc9c1\ub82c\ud654, \uadf8\ub9ac\uace0 \uba40\ud2f0\uc2a4\ub808\ub4dc\ub97c \uc9c0\uc6d0\ud558\ub294 \ube44\ub3d9\uae30 \uae30\ub2a5 \ub4f1\uc774 \uc788\uc2b5\ub2c8\ub2e4.\n<\/p>\n<h3>1.1 FastAPI\uc758 \ud2b9\uc9d5<\/h3>\n<ul>\n<li>\uc131\ub2a5: Starlette\ub97c \uae30\ubc18\uc73c\ub85c \ud558\uc5ec \ube44\ub3d9\uae30 \ucc98\ub9ac\ub97c \ud1b5\ud574 \ub192\uc740 \uc131\ub2a5\uc744 \uc790\ub791\ud569\ub2c8\ub2e4.<\/li>\n<li>\uc790\ub3d9 \ubb38\uc11c\ud654: Swagger UI\uc640 ReDoc\uc744 \ud1b5\ud574 API \ubb38\uc11c\ud654\ub97c \uc790\ub3d9\uc73c\ub85c \uc218\ud589\ud569\ub2c8\ub2e4.<\/li>\n<li>\uc720\ud6a8\uc131 \uac80\uc0ac: Pydantic\uc744 \uc0ac\uc6a9\ud558\uc5ec \ub370\uc774\ud130 \uac80\uc99d\uc744 \uc27d\uac8c \ucc98\ub9ac\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/li>\n<li>\uac04\ud3b8\ud55c \ub77c\uc6b0\ud305 \ubc0f \uacbd\ub85c \ub9e4\ud551: \uc9c1\uad00\uc801\uc778 \uacbd\ub85c \ub9e4\ud551 \uae30\ub2a5\uc744 \uc81c\uacf5\ud569\ub2c8\ub2e4.<\/li>\n<\/ul>\n<h2>2. FastAPI\uc758 \uc124\uce58<\/h2>\n<p>\n    FastAPI\ub97c \uc124\uce58\ud558\uae30 \uc704\ud574\uc11c\ub294 \uba3c\uc800 Python\uc774 \uc124\uce58\ub418\uc5b4 \uc788\uc5b4\uc57c \ud569\ub2c8\ub2e4. \uc774\ud6c4 \ub2e4\uc74c\uc758 \uba85\ub839\uc5b4\ub85c FastAPI\uc640<br \/>\n    Uvicorn(ASGI \uc11c\ubc84)\uc744 \uc124\uce58\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n<\/p>\n<pre><code>pip install fastapi uvicorn<\/code><\/pre>\n<h2>3. FastAPI \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uae30\ubcf8 \uc124\uc815<\/h2>\n<p>\n    FastAPI\ub85c \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \uc0dd\uc131\ud558\uace0 \uae30\ubcf8\uc801\uc778 API\ub97c \uc124\uc815\ud558\ub294 \ubc29\ubc95\uc744 \uc54c\uc544\ubcf4\uaca0\uc2b5\ub2c8\ub2e4.<br \/>\n    \uc544\ub798\ub294 \uae30\ubcf8\uc801\uc778 FastAPI \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc758 \uc608\uc81c \ucf54\ub4dc\uc785\ub2c8\ub2e4.\n<\/p>\n<pre><code>\nfrom fastapi import FastAPI\n\napp = FastAPI()\n\n@app.get(\"\/\")\ndef read_root():\n    return {\"Hello\": \"World\"}\n\n@app.get(\"\/items\/{item_id}\")\ndef read_item(item_id: int, q: str = None):\n    return {\"item_id\": item_id, \"q\": q}\n<\/code><\/pre>\n<p>\n    \uc704 \ucf54\ub4dc\ub294 \uae30\ubcf8\uc801\uc778 FastAPI \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \uc0dd\uc131\ud558\uba70, \ub8e8\ud2b8 \uacbd\ub85c(&#8216;\/&#8217;)\uc640<br \/>\n    \ud30c\ub77c\ubbf8\ud130\uac00 \uc788\ub294 \uacbd\ub85c(&#8216;\/items\/{item_id}&#8217;)\ub97c \uc815\uc758\ud558\uace0 \uc788\uc2b5\ub2c8\ub2e4.<br \/>\n    \uc774\ub97c \uc2e4\ud589\ud558\uae30 \uc704\ud574\uc11c\ub294 \ub2e4\uc74c\uacfc \uac19\uc740 \uba85\ub839\uc5b4\ub97c \uc0ac\uc6a9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n<\/p>\n<pre><code>uvicorn main:app --reload<\/code><\/pre>\n<p>\n    \uc704\uc758 \uba85\ub839\uc5b4\uc5d0\uc11c &#8216;main&#8217;\uc740 \ud30c\uc77c \uc774\ub984\uc774\uba70, &#8216;app&#8217;\uc740 FastAPI \uc778\uc2a4\ud134\uc2a4\uc785\ub2c8\ub2e4.<br \/>\n    &#8211;reload \uc635\uc158\uc744 \ud1b5\ud574 \ucf54\ub4dc \ubcc0\uacbd \uc2dc \uc11c\ubc84\ub97c \uc790\ub3d9\uc73c\ub85c \uc7ac\uc2dc\uc791\ud558\ub3c4\ub85d \uc124\uc815\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n<\/p>\n<h2>4. FastAPI\uc758 \uc790\ub3d9 \ubb38\uc11c\ud654 \uae30\ub2a5<\/h2>\n<p>\n    FastAPI\ub294 Swagger UI\uc640 ReDoc\uc744 \uc0ac\uc6a9\ud558\uc5ec API \ubb38\uc11c\ud654\ub97c \uc790\ub3d9\uc73c\ub85c \uc218\ud589\ud569\ub2c8\ub2e4.<br \/>\n    \uc774\ub7ec\ud55c \uae30\ub2a5\uc740 \uac1c\ubc1c\uc790\uac00 API Endpoint\ub97c \uc815\uc758\ud560 \ub54c, FastAPI\uac00 \uc790\ub3d9\uc73c\ub85c<br \/>\n    \ud574\ub2f9 API\uc5d0 \ub300\ud55c \ubb38\uc11c\ub97c \uc0dd\uc131\ud558\ub3c4\ub85d \ud569\ub2c8\ub2e4.\n<\/p>\n<h3>4.1 Swagger UI<\/h3>\n<p>\n    FastAPI\uc5d0\uc11c Swagger UI\ub97c \uc0ac\uc6a9\ud558\ub294 \uac83\uc740 \ub9e4\uc6b0 \uac04\ub2e8\ud569\ub2c8\ub2e4.<br \/>\n    \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \uc2e4\ud589\ud558\uba74 \uae30\ubcf8\uc801\uc73c\ub85c &#8216;\/docs&#8217; \uacbd\ub85c\uc5d0\uc11c Swagger UI\uc5d0 \uc811\uadfc\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<br \/>\n    Swagger UI\ub294 API\uc758 \uc694\uccad \ubc29\uc2dd(HTTP \uba54\uc11c\ub4dc, URL \ub4f1), \uc694\uccad\/\uc751\ub2f5\uc758 \ub370\uc774\ud130 \uad6c\uc870,<br \/>\n    \uc608\uc81c \ub4f1\uc744 \ud3ec\ud568\ud558\uc5ec \uc9c1\uad00\uc801\uc73c\ub85c API\ub97c \ud14c\uc2a4\ud2b8\ud560 \uc218 \uc788\ub294 \uc778\ud130\ud398\uc774\uc2a4\ub97c \uc81c\uacf5\ud569\ub2c8\ub2e4.\n<\/p>\n<h4>Swagger UI \uc608\uc81c<\/h4>\n<p>\n    FastAPI \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \uc2e4\ud589\ud55c \ud6c4, \uc6f9 \ube0c\ub77c\uc6b0\uc800\uc5d0\uc11c &#8216;http:\/\/localhost:8000\/docs&#8217;\ub97c<br \/>\n    \uc5f4\uc5b4\ubcf4\uc138\uc694. \uadc0\ud558\uc758 API Endpoint\uc5d0 \ub300\ud55c \ubb38\uc11c\uac00 \uc790\ub3d9\uc73c\ub85c \uc0dd\uc131\ub41c \uac83\uc744 \ud655\uc778\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<br \/>\n    \uc608\ub97c \ub4e4\uc5b4 \uc704\uc5d0\uc11c \uc124\uc815\ud55c \ub8e8\ud2b8 \uacbd\ub85c(&#8216;\/&#8217;)\uc640 &#8216;\/items\/{item_id}&#8217; \uacbd\ub85c\uac00<br \/>\n    Swagger UI\uc5d0\uc11c \ub098\uc5f4\ub418\uace0, \uac01 \uacbd\ub85c\uc5d0 \ub300\ud55c \uc694\uccad\uc744 \ubcf4\ub0bc \uc218 \uc788\ub294 \ubc84\ud2bc\uc774 \uc81c\uacf5\ub429\ub2c8\ub2e4.\n<\/p>\n<h3>4.2 ReDoc<\/h3>\n<p>\n    FastAPI\ub294 \ub610\ud55c ReDoc\uc744 \ud1b5\ud574 API \ubb38\uc11c\ud654\ub97c \uc9c0\uc6d0\ud569\ub2c8\ub2e4.<br \/>\n    ReDoc\uc740 \uae54\ub054\ud558\uace0 \ud604\ub300\uc801\uc778 \ub514\uc790\uc778\uc73c\ub85c \ubcf5\uc7a1\ud55c API\ub97c \uc27d\uac8c \ud0d0\uc0c9\ud560 \uc218 \uc788\ub3c4\ub85d \ub3c4\uc640\uc90d\ub2c8\ub2e4.<br \/>\n    ReDoc \ubb38\uc11c\ub294 &#8216;\/redoc&#8217; \uacbd\ub85c\uc5d0\uc11c \ud655\uc778\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n<\/p>\n<h4>ReDoc \uc608\uc81c<\/h4>\n<p>\n    FastAPI \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \uc2e4\ud589\ud55c \ud6c4, \uc6f9 \ube0c\ub77c\uc6b0\uc800\uc5d0\uc11c &#8216;http:\/\/localhost:8000\/redoc&#8217;\ub97c<br \/>\n    \uc5f4\uc5b4\ubcf4\uc138\uc694. ReDoc\uc73c\ub85c \uc0dd\uc131\ub41c API \ubb38\uc11c\ub97c \ud655\uc778\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<br \/>\n    \uac01 API Endpoint\uc5d0 \ub300\ud55c \uc124\uba85\uacfc \uc694\uccad\/\uc751\ub2f5 \ubaa8\ub378\uc744 \uac04\uacb0\ud558\uac8c \ubcf4\uc5ec\uc90d\ub2c8\ub2e4.\n<\/p>\n<h2>5. FastAPI\uc758 \ubb38\uc11c\ud654\uc5d0 \ub300\ud55c \ucd94\uac00\uc801\uc778 \uae30\ub2a5<\/h2>\n<p>\n    FastAPI\ub294 \ubb38\uc11c\ud654 \uae30\ub2a5\uc744 \uac15\ud654\ud558\uae30 \uc704\ud55c \uc5ec\ub7ec \uac00\uc9c0 \uc635\uc158\uc744 \uc81c\uacf5\ud569\ub2c8\ub2e4.<br \/>\n    \uc608\ub97c \ub4e4\uc5b4, API \ubb38\uc11c\ud654 \uc2dc\uc5d0 \uc0ac\uc6a9\ud560 \uc81c\ubaa9, \uc124\uba85 \ubc0f \ubc84\uc804 \uc815\ubcf4\ub97c \uc124\uc815\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n<\/p>\n<h4>\uc608\uc81c \ucf54\ub4dc<\/h4>\n<pre><code>\nfrom fastapi import FastAPI\n\napp = FastAPI(\n    title=\"My API\",\n    description=\"API \uc124\uba85\uc744 \uc5ec\uae30\uc5d0 \uc801\uc2b5\ub2c8\ub2e4.\",\n    version=\"1.0.0\",\n)\n\n@app.get(\"\/\")\ndef read_root():\n    return {\"Hello\": \"World\"}\n<\/code><\/pre>\n<p>\n    \uc704\uc640 \uac19\uc774 FastAPI \uc778\uc2a4\ud134\uc2a4\ub97c \uc0dd\uc131\ud560 \ub54c, title, description, version \ub4f1\uc758<br \/>\n    \ub9e4\uac1c\ubcc0\uc218\ub97c \uc9c0\uc815\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc774\ub807\uac8c \ud558\uba74 Swagger UI\uc640 ReDoc\uc5d0 \uc124\uc815\ud55c \uac12\uc774<br \/>\n    \uc790\ub3d9\uc73c\ub85c \ubc18\uc601\ub429\ub2c8\ub2e4.\n<\/p>\n<h2>6. \uc758\uc874\uc131\uacfc \ubcf4\uc548 \uae30\ub2a5\uc744 \ud65c\uc6a9\ud55c \ubb38\uc11c\ud654<\/h2>\n<p>\n    FastAPI\ub294 API \ubb38\uc11c\ud654\ub97c \ub2e8\uc21c\ud654\ud558\ub294 \uac83\ub9cc\uc774 \uc544\ub2c8\ub77c, \uc758\uc874\uc131 \uc8fc\uc785(Dependency Injection)\uc640 \ubcf4\uc548<br \/>\n    \uae30\ub2a5\uc744 \ud1b5\ud574 API\uc758 \ubcf5\uc7a1\ud55c \uad6c\uc870\ub97c \uad00\ub9ac\ud558\ub294 \ub370\ub3c4 \uc720\uc6a9\ud569\ub2c8\ub2e4. \uc608\ub97c \ub4e4\uc5b4,<br \/>\n    \uc778\uc99d\uc774 \ud544\uc694\ud55c API Endpoint\uc758 \uacbd\uc6b0 FastAPI\ub294 \uc774\ub7ec\ud55c \uae30\ub2a5\uc744 \ubb38\uc11c\ud654\ud558\ub294 \ub370 \uc788\uc5b4\uc11c<br \/>\n    \uc720\uc6a9\ud55c \uc815\ubcf4\ub97c \uc81c\uacf5\ud569\ub2c8\ub2e4.\n<\/p>\n<h4>\uc608\uc81c \ucf54\ub4dc<\/h4>\n<pre><code>\nfrom fastapi import FastAPI, Depends\n\napp = FastAPI()\n\ndef fake_authenticate(username: str, password: str):\n    if username == \"admin\" and password == \"secret\":\n        return True\n    return False\n\n@app.get(\"\/secure-data\/\")\ndef get_secure_data(authenticated: bool = Depends(fake_authenticate)):\n    return {\"data\": \"This is secured data\"}\n<\/code><\/pre>\n<p>\n    \uc704 \uc608\uc81c\ub97c \uc2e4\ud589\ud560 \uacbd\uc6b0 &#8216;\/secure-data\/&#8217; Endpoint\ub294 &#8216;fake_authenticate&#8217; \ud568\uc218\ub97c \ud1b5\ud574<br \/>\n    \uc778\uc99d\uc744 \uc694\uad6c\ud569\ub2c8\ub2e4. Swagger UI\uc5d0\uc11c\ub294 \uc774 Endpoint\uc5d0 \ub300\ud574 \uc778\uc99d \uc694\uad6c \uc0ac\ud56d\uc774<br \/>\n    \uba85\uc2dc\uc801\uc73c\ub85c \ud45c\uc2dc\ub420 \uac83\uc785\ub2c8\ub2e4.\n<\/p>\n<h2>7. \uacb0\ub860<\/h2>\n<p>\n    FastAPI\ub294 \ud6cc\ub96d\ud55c \uc790\ub3d9 \ubb38\uc11c\ud654 \uae30\ub2a5\uc744 \uc81c\uacf5\ud558\uc5ec API \uac1c\ubc1c\uc744 \ubcf4\ub2e4 \uc27d\uac8c \ub9cc\ub4e4\uc5b4 \uc90d\ub2c8\ub2e4.<br \/>\n    Swagger UI\uc640 ReDoc\uc744 \ud1b5\ud574 API \ubb38\uc11c\ub97c \uc790\ub3d9\uc73c\ub85c \uc0dd\uc131\ud560 \uc218 \uc788\ub294 \uae30\ub2a5\uc740 \uac1c\ubc1c\uc790\uc5d0\uac8c \ud070<br \/>\n    \uc2dc\uac04\uc744 \uc808\uc57d\ud558\uac8c \ud558\uba70, \uc801\uc2dc\uc5d0 \ubb38\uc11c\ud654\ub41c API\ub97c \uc81c\uacf5\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<br \/>\n    \ub610\ud55c FastAPI\uc758 \ub2e4\uc591\ud55c \uae30\ub2a5\uc744 \ud1b5\ud574 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc758 \uc548\uc815\uc131\uacfc \ubcf4\uc548\uc131\uc744 \ub192\uc77c \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n<\/p>\n<p>\n    FastAPI\ub97c \uc0ac\uc6a9\ud55c API \uac1c\ubc1c\uc758 \ubaa8\ub4e0 \uacfc\uc815\uc744 \uc774\ud574\ud558\ub294 \ub370 \ub3c4\uc6c0\uc774 \ub418\uc5c8\uae30\ub97c \ubc14\ub78d\ub2c8\ub2e4.<br \/>\n    \uc55e\uc73c\ub85c\ub3c4 FastAPI\ub97c \ud65c\uc6a9\ud558\uc5ec \ub354 \ub098\uc740 \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \uac1c\ubc1c\ud574 \ubcf4\uc138\uc694!\n<\/p>\n<p><\/body><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\ud604\ub300\uc758 \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\uc5d0\uc11c\ub294 API\uc640 \uadf8 \ubb38\uc11c\ud654\uac00 \ub9e4\uc6b0 \uc911\uc694\ud569\ub2c8\ub2e4. FastAPI\ub294 \ud30c\uc774\uc36c\uc73c\ub85c \uc81c\uc791\ub41c \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, \ub192\uc740 \uc131\ub2a5\uacfc \uc0ac\uc6a9\uc758 \uc6a9\uc774\uc131 \ub355\ubd84\uc5d0 \ub9ce\uc740 \uac1c\ubc1c\uc790\ub4e4 \uc0ac\uc774\uc5d0\uc11c \uac01\uad11\ubc1b\uace0 \uc788\uc2b5\ub2c8\ub2e4. \ubcf8 \uae00\uc5d0\uc11c\ub294 FastAPI\uc758 \uc790\ub3d9 \ubb38\uc11c\ud654 \uae30\ub2a5\uc5d0 \ub300\ud574 \ub2e4\ub8f0 \uac83\uc785\ub2c8\ub2e4. \ud2b9\ud788, Swagger UI\uc640 ReDoc\uc744 \uc0ac\uc6a9\ud558\uc5ec FastAPI \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc758 API \ubb38\uc11c\ud654\ub97c \uc5b4\ub5bb\uac8c \uc218\ud589\ud558\ub294\uc9c0\uc5d0 \ub300\ud574 \uc790\uc138\ud788 \uc54c\uc544\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. 1. FastAPI \uc18c\uac1c FastAPI\ub294 Starlette\uc640 Pydantic\uc744 \uae30\ubc18\uc73c\ub85c \uad6c\ucd95\ub41c &hellip; <a href=\"https:\/\/atmokpo.com\/w\/38552\/\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;FastAPI \uc11c\ubc84\uac1c\ubc1c, FastAPI\uc758 \uc790\ub3d9 \ubb38\uc11c\ud654 \uae30\ub2a5 (Swagger UI \ubc0f ReDoc)&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[183],"tags":[],"class_list":["post-38552","post","type-post","status-publish","format-standard","hentry","category-fastapi"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>FastAPI \uc11c\ubc84\uac1c\ubc1c, FastAPI\uc758 \uc790\ub3d9 \ubb38\uc11c\ud654 \uae30\ub2a5 (Swagger UI \ubc0f ReDoc) - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/atmokpo.com\/w\/38552\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"FastAPI \uc11c\ubc84\uac1c\ubc1c, FastAPI\uc758 \uc790\ub3d9 \ubb38\uc11c\ud654 \uae30\ub2a5 (Swagger UI \ubc0f ReDoc) - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"og:description\" content=\"\ud604\ub300\uc758 \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\uc5d0\uc11c\ub294 API\uc640 \uadf8 \ubb38\uc11c\ud654\uac00 \ub9e4\uc6b0 \uc911\uc694\ud569\ub2c8\ub2e4. FastAPI\ub294 \ud30c\uc774\uc36c\uc73c\ub85c \uc81c\uc791\ub41c \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, \ub192\uc740 \uc131\ub2a5\uacfc \uc0ac\uc6a9\uc758 \uc6a9\uc774\uc131 \ub355\ubd84\uc5d0 \ub9ce\uc740 \uac1c\ubc1c\uc790\ub4e4 \uc0ac\uc774\uc5d0\uc11c \uac01\uad11\ubc1b\uace0 \uc788\uc2b5\ub2c8\ub2e4. \ubcf8 \uae00\uc5d0\uc11c\ub294 FastAPI\uc758 \uc790\ub3d9 \ubb38\uc11c\ud654 \uae30\ub2a5\uc5d0 \ub300\ud574 \ub2e4\ub8f0 \uac83\uc785\ub2c8\ub2e4. \ud2b9\ud788, Swagger UI\uc640 ReDoc\uc744 \uc0ac\uc6a9\ud558\uc5ec FastAPI \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc758 API \ubb38\uc11c\ud654\ub97c \uc5b4\ub5bb\uac8c \uc218\ud589\ud558\ub294\uc9c0\uc5d0 \ub300\ud574 \uc790\uc138\ud788 \uc54c\uc544\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. 1. FastAPI \uc18c\uac1c FastAPI\ub294 Starlette\uc640 Pydantic\uc744 \uae30\ubc18\uc73c\ub85c \uad6c\ucd95\ub41c &hellip; \ub354 \ubcf4\uae30 &quot;FastAPI \uc11c\ubc84\uac1c\ubc1c, FastAPI\uc758 \uc790\ub3d9 \ubb38\uc11c\ud654 \uae30\ub2a5 (Swagger UI \ubc0f ReDoc)&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/atmokpo.com\/w\/38552\/\" \/>\n<meta property=\"og:site_name\" content=\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-01T18:18:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-26T06:44:01+00:00\" \/>\n<meta name=\"author\" content=\"root\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@bebubo4\" \/>\n<meta name=\"twitter:site\" content=\"@bebubo4\" \/>\n<meta name=\"twitter:label1\" content=\"\uae00\uc4f4\uc774\" \/>\n\t<meta name=\"twitter:data1\" content=\"root\" \/>\n\t<meta name=\"twitter:label2\" content=\"\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04\" \/>\n\t<meta name=\"twitter:data2\" content=\"1\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/atmokpo.com\/w\/38552\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/38552\/\"},\"author\":{\"name\":\"root\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\"},\"headline\":\"FastAPI \uc11c\ubc84\uac1c\ubc1c, FastAPI\uc758 \uc790\ub3d9 \ubb38\uc11c\ud654 \uae30\ub2a5 (Swagger UI \ubc0f ReDoc)\",\"datePublished\":\"2024-11-01T18:18:10+00:00\",\"dateModified\":\"2024-11-26T06:44:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/atmokpo.com\/w\/38552\/\"},\"wordCount\":135,\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"articleSection\":[\"FastAPI\uc11c\ubc84\uac1c\ubc1c\"],\"inLanguage\":\"ko-KR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/atmokpo.com\/w\/38552\/\",\"url\":\"https:\/\/atmokpo.com\/w\/38552\/\",\"name\":\"FastAPI \uc11c\ubc84\uac1c\ubc1c, FastAPI\uc758 \uc790\ub3d9 \ubb38\uc11c\ud654 \uae30\ub2a5 (Swagger UI \ubc0f ReDoc) - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#website\"},\"datePublished\":\"2024-11-01T18:18:10+00:00\",\"dateModified\":\"2024-11-26T06:44:01+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/atmokpo.com\/w\/38552\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/atmokpo.com\/w\/38552\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/atmokpo.com\/w\/38552\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\ud648\",\"item\":\"https:\/\/atmokpo.com\/w\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"FastAPI \uc11c\ubc84\uac1c\ubc1c, FastAPI\uc758 \uc790\ub3d9 \ubb38\uc11c\ud654 \uae30\ub2a5 (Swagger UI \ubc0f ReDoc)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/atmokpo.com\/w\/#website\",\"url\":\"https:\/\/atmokpo.com\/w\/\",\"name\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/atmokpo.com\/w\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\",\"name\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"url\":\"https:\/\/atmokpo.com\/w\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png\",\"contentUrl\":\"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png\",\"width\":400,\"height\":400,\"caption\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\"},\"image\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/bebubo4\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\",\"name\":\"root\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g\",\"caption\":\"root\"},\"sameAs\":[\"http:\/\/atmokpo.com\/w\"],\"url\":\"https:\/\/atmokpo.com\/w\/author\/root\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"FastAPI \uc11c\ubc84\uac1c\ubc1c, FastAPI\uc758 \uc790\ub3d9 \ubb38\uc11c\ud654 \uae30\ub2a5 (Swagger UI \ubc0f ReDoc) - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/atmokpo.com\/w\/38552\/","og_locale":"ko_KR","og_type":"article","og_title":"FastAPI \uc11c\ubc84\uac1c\ubc1c, FastAPI\uc758 \uc790\ub3d9 \ubb38\uc11c\ud654 \uae30\ub2a5 (Swagger UI \ubc0f ReDoc) - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","og_description":"\ud604\ub300\uc758 \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\uc5d0\uc11c\ub294 API\uc640 \uadf8 \ubb38\uc11c\ud654\uac00 \ub9e4\uc6b0 \uc911\uc694\ud569\ub2c8\ub2e4. FastAPI\ub294 \ud30c\uc774\uc36c\uc73c\ub85c \uc81c\uc791\ub41c \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, \ub192\uc740 \uc131\ub2a5\uacfc \uc0ac\uc6a9\uc758 \uc6a9\uc774\uc131 \ub355\ubd84\uc5d0 \ub9ce\uc740 \uac1c\ubc1c\uc790\ub4e4 \uc0ac\uc774\uc5d0\uc11c \uac01\uad11\ubc1b\uace0 \uc788\uc2b5\ub2c8\ub2e4. \ubcf8 \uae00\uc5d0\uc11c\ub294 FastAPI\uc758 \uc790\ub3d9 \ubb38\uc11c\ud654 \uae30\ub2a5\uc5d0 \ub300\ud574 \ub2e4\ub8f0 \uac83\uc785\ub2c8\ub2e4. \ud2b9\ud788, Swagger UI\uc640 ReDoc\uc744 \uc0ac\uc6a9\ud558\uc5ec FastAPI \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc758 API \ubb38\uc11c\ud654\ub97c \uc5b4\ub5bb\uac8c \uc218\ud589\ud558\ub294\uc9c0\uc5d0 \ub300\ud574 \uc790\uc138\ud788 \uc54c\uc544\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. 1. FastAPI \uc18c\uac1c FastAPI\ub294 Starlette\uc640 Pydantic\uc744 \uae30\ubc18\uc73c\ub85c \uad6c\ucd95\ub41c &hellip; \ub354 \ubcf4\uae30 \"FastAPI \uc11c\ubc84\uac1c\ubc1c, FastAPI\uc758 \uc790\ub3d9 \ubb38\uc11c\ud654 \uae30\ub2a5 (Swagger UI \ubc0f ReDoc)\"","og_url":"https:\/\/atmokpo.com\/w\/38552\/","og_site_name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","article_published_time":"2024-11-01T18:18:10+00:00","article_modified_time":"2024-11-26T06:44:01+00:00","author":"root","twitter_card":"summary_large_image","twitter_creator":"@bebubo4","twitter_site":"@bebubo4","twitter_misc":{"\uae00\uc4f4\uc774":"root","\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04":"1\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/atmokpo.com\/w\/38552\/#article","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/38552\/"},"author":{"name":"root","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7"},"headline":"FastAPI \uc11c\ubc84\uac1c\ubc1c, FastAPI\uc758 \uc790\ub3d9 \ubb38\uc11c\ud654 \uae30\ub2a5 (Swagger UI \ubc0f ReDoc)","datePublished":"2024-11-01T18:18:10+00:00","dateModified":"2024-11-26T06:44:01+00:00","mainEntityOfPage":{"@id":"https:\/\/atmokpo.com\/w\/38552\/"},"wordCount":135,"publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"articleSection":["FastAPI\uc11c\ubc84\uac1c\ubc1c"],"inLanguage":"ko-KR"},{"@type":"WebPage","@id":"https:\/\/atmokpo.com\/w\/38552\/","url":"https:\/\/atmokpo.com\/w\/38552\/","name":"FastAPI \uc11c\ubc84\uac1c\ubc1c, FastAPI\uc758 \uc790\ub3d9 \ubb38\uc11c\ud654 \uae30\ub2a5 (Swagger UI \ubc0f ReDoc) - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/#website"},"datePublished":"2024-11-01T18:18:10+00:00","dateModified":"2024-11-26T06:44:01+00:00","breadcrumb":{"@id":"https:\/\/atmokpo.com\/w\/38552\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/atmokpo.com\/w\/38552\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/atmokpo.com\/w\/38552\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\ud648","item":"https:\/\/atmokpo.com\/w\/en\/"},{"@type":"ListItem","position":2,"name":"FastAPI \uc11c\ubc84\uac1c\ubc1c, FastAPI\uc758 \uc790\ub3d9 \ubb38\uc11c\ud654 \uae30\ub2a5 (Swagger UI \ubc0f ReDoc)"}]},{"@type":"WebSite","@id":"https:\/\/atmokpo.com\/w\/#website","url":"https:\/\/atmokpo.com\/w\/","name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","description":"","publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/atmokpo.com\/w\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Organization","@id":"https:\/\/atmokpo.com\/w\/#organization","name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","url":"https:\/\/atmokpo.com\/w\/","logo":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/","url":"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png","contentUrl":"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png","width":400,"height":400,"caption":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8"},"image":{"@id":"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/bebubo4"]},{"@type":"Person","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7","name":"root","image":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g","caption":"root"},"sameAs":["http:\/\/atmokpo.com\/w"],"url":"https:\/\/atmokpo.com\/w\/author\/root\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/38552","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/comments?post=38552"}],"version-history":[{"count":1,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/38552\/revisions"}],"predecessor-version":[{"id":38553,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/38552\/revisions\/38553"}],"wp:attachment":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/media?parent=38552"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/categories?post=38552"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/tags?post=38552"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}