{"id":937,"date":"2026-05-26T23:13:09","date_gmt":"2026-05-26T15:13:09","guid":{"rendered":"https:\/\/junai.ai\/blog\/fastapi-first-api-path-query-2\/"},"modified":"2026-05-26T23:13:09","modified_gmt":"2026-05-26T15:13:09","slug":"fastapi-first-api-path-query-2","status":"publish","type":"post","link":"https:\/\/junai.ai\/blog\/fastapi-first-api-path-query-2\/","title":{"rendered":"FastAPI \uacbd\ub85c\u00b7\ucffc\ub9ac \ub9e4\uac1c\ubcc0\uc218 \u2014 \uc8fc\uc18c\ub85c \uac12 \ubc1b\uae30"},"content":{"rendered":"\n<!-- WordPress REST API \ubc1c\ud589\uc6a9 HTML (\uc790\ub3d9 \uc0dd\uc131) -->\n<!-- WP-FEATURED-MEDIA-ID: 924 -->\n<div style=\"max-width:800px;margin:0 auto;\">\n<style>\n:root {--color-primary:#00897b;--color-accent:#009688;--color-bg:#fafbfc;--color-bg-card:#fff;--color-text:#1a202c;--color-text-muted:#64748b;--hero-start:#004d40;--hero-end:#00897b;}\n*{box-sizing:border-box;}\n.container{max-width:760px;margin:0 auto;padding:0 24px 80px;}\n.hero{background:linear-gradient(135deg,var(--hero-start) 0%,var(--hero-end) 100%);color:#fff;padding:80px 24px 60px;text-align:center;}\n.hero .eyebrow{display:inline-block;font-size:14px;color:#80cbc4;font-weight:700;letter-spacing:0.1em;text-transform:uppercase;margin-bottom:14px;}\n.hero h1{font-size:36px;margin:0 0 16px;line-height:1.3;font-weight:800;}\n.hero p{color:#b2dfdb;font-size:18px;max-width:640px;margin:0 auto;line-height:1.6;}\n.hero img{width:100%;max-width:640px;height:auto;margin:32px auto 0;border-radius:10px;display:block;}\narticle{padding-top:48px;}\narticle h2{font-size:26px;margin:56px 0 20px;padding-left:14px;border-left:5px solid var(--color-accent);line-height:1.4;}\narticle h3{font-size:19px;margin:32px 0 12px;color:var(--color-primary);}\narticle p{margin:16px 0;}\narticle strong{color:var(--color-primary);font-weight:700;}\narticle code{background:#b2dfdb;padding:2px 8px;border-radius:4px;font-family:'SF Mono',Menlo,Consolas,monospace;font-size:14px;color:#004d40;}\n.databox{background:#b2dfdb;border-left:4px solid var(--color-accent);padding:16px 20px;margin:24px 0;border-radius:0 8px 8px 0;font-size:15.5px;}\n.databox strong{color:var(--color-primary);}\n.warnbox{background:linear-gradient(135deg,#fef3c7 0%,#fde68a 100%);padding:16px 20px;margin:24px 0;border-radius:8px;font-size:15.5px;}\n.tablewrap{overflow-x:auto;-webkit-overflow-scrolling:touch;margin:22px 0;}\ntable{width:100%;border-collapse:collapse;font-size:15px;background:var(--color-bg-card);}\nth,td{padding:11px 12px;text-align:left;border-bottom:1px solid #e2e8f0;vertical-align:top;}\nth{background:#f1f5f9;font-weight:700;color:#0f172a;}\ntd:first-child,th:first-child{font-weight:700;}\n@media (max-width:560px){.tablewrap table,.tablewrap thead,.tablewrap tbody,.tablewrap tr,.tablewrap th,.tablewrap td{display:block;width:auto;}.tablewrap thead{display:none;}.tablewrap tr{margin:0 0 14px;border:1px solid #e2e8f0;border-radius:10px;overflow:hidden;}.tablewrap td{border:none;border-bottom:1px solid #f1f5f9;padding:9px 14px;}.tablewrap td:first-child{background:#f1f5f9;font-weight:800;font-size:15.5px;}.tablewrap td:last-child{border-bottom:none;}.tablewrap td[data-label]::before{content:attr(data-label) \" \u2014 \";font-weight:700;color:var(--color-primary);}}\n.code-block{background:#0f172a;color:#e2e8f0;padding:16px 20px;border-radius:8px;font-family:'SF Mono',Menlo,Consolas,monospace;font-size:14px;line-height:1.6;margin:20px 0;overflow-x:auto;white-space:pre;}\n.cta{background:linear-gradient(135deg,#00897b 0%,#009688 100%);color:#fff;padding:28px 24px;border-radius:12px;margin:48px 0 0;text-align:center;}\n.cta h3{color:#fff;margin:0 0 8px;font-size:20px;}\n.cta p{color:#b2dfdb;margin:0;font-size:15.5px;}\n.footer-nav{margin-top:32px;padding-top:20px;border-top:1px solid #e2e8f0;font-size:14px;color:var(--color-text-muted);}\n.footer-nav a{color:var(--color-primary);text-decoration:none;}\n@media (max-width:480px){.hero h1{font-size:26px;}.hero p{font-size:16px;}article h2{font-size:21px;}article h3{font-size:17px;}body{font-size:16px;}}\n<\/style>\n<section class=\"hero\">\n  <span class=\"eyebrow\">FastAPI \uad50\uc7ac \u00b7 2\ud3b8 \u00b7 \uacbd\ub85c\uc640 \ucffc\ub9ac<\/span>\n  <h1>FastAPI \uacbd\ub85c\u00b7\ucffc\ub9ac \ub9e4\uac1c\ubcc0\uc218 \u2014 \uc8fc\uc18c\ub85c \uac12 \ubc1b\uae30<\/h1>\n  <p>\uac19\uc740 \ucf54\ub4dc\ub97c \ubd10\ub3c4 \ub9e4\ubc88 \ub2e4\ub978 \uacb0\uacfc\ub97c \uc8fc\ub294 API. \uadf8 &#8220;\uac12&#8221;\uc774 \uc8fc\uc18c\uc5d0 \uc2e4\ub824 \ub4e4\uc5b4\uc628\ub2e4. \ub450 \uac00\uc9c0 \uacbd\ub85c\uac00 \uc788\ub2e4.<\/p>\n  <img decoding=\"async\" src=\"https:\/\/junai.ai\/blog\/wp-content\/uploads\/2026\/05\/hero-5-99.jpg\" alt=\"URL \uc8fc\uc18c\uac00 \uacbd\ub85c \ubd80\ubd84\uacfc \ubb3c\uc74c\ud45c \ub4a4 \ucffc\ub9ac \ubd80\ubd84\uc73c\ub85c \ub098\ub258\uc5b4 FastAPI \ud568\uc218\ub85c \ud758\ub7ec\ub4dc\ub294 \ucee8\uc149 \uc544\uc774\uc18c\uba54\ud2b8\ub9ad \uc77c\ub7ec\uc2a4\ud2b8\">\n<\/section>\n\n<div class=\"container\">\n<article>\n\n<p>1\ud3b8\uc758 <code>{\"message\": \"\uc548\ub155\"}<\/code> \uc740 \ub204\uac00 \ubd88\ub7ec\ub3c4 \ub611\uac19\uc740 \ub2f5\ub9cc \uc92c\ub2e4. \uc9c4\uc9dc API \ub294 \ub2e4\ub974\ub2e4. <code>\/users\/7<\/code> \uc740 7\ubc88 \uc0ac\uc6a9\uc790\ub97c, <code>\/users\/15<\/code> \ub294 15\ubc88 \uc0ac\uc6a9\uc790\ub97c \ub3cc\ub824\uc918\uc57c \ud55c\ub2e4. \uac19\uc740 \ud568\uc218\uc5d0 <strong>\uac12\uc744 \uc2e4\uc5b4 \ubcf4\ub0b4\ub294 \ud1b5\ub85c<\/strong>\uac00 \ud544\uc694\ud558\ub2e4\ub294 \ub73b\uc774\ub2e4.<\/p>\n\n<p>FastAPI \uc5d0\uc11c \uadf8 \ud1b5\ub85c\ub294 \ub458\uc774\ub2e4 \u2014 \uc8fc\uc18c \uacbd\ub85c \uc790\uccb4\uc5d0 \ubc15\ub294 <strong>\uacbd\ub85c \ub9e4\uac1c\ubcc0\uc218(Path)<\/strong>, \uadf8\ub9ac\uace0 \uc8fc\uc18c \ub05d \ubb3c\uc74c\ud45c \ub4a4\uc5d0 \ubd99\uc774\ub294 <strong>\ucffc\ub9ac \ub9e4\uac1c\ubcc0\uc218(Query)<\/strong>. 2\ud3b8\uc740 \uc774 \ub458\uc744 \uad6c\ubd84\ud558\uace0, \ud0c0\uc785\ud78c\ud2b8\uac00 \uc5b4\ub5bb\uac8c \uac12\uc744 \uc790\ub3d9\uc73c\ub85c \ubcc0\ud658\u00b7\uac80\uc99d\ud558\ub294\uc9c0, \uadf8\ub9ac\uace0 \ub458\uc744 \uc5b8\uc81c \uace8\ub77c \uc4f0\ub294\uc9c0\ub97c \ub2e4\ub8ec\ub2e4.<\/p>\n\n<h2>1. \uacbd\ub85c \ub9e4\uac1c\ubcc0\uc218 \u2014 \uc8fc\uc18c \uc548\uc5d0 \ubc15\ub294 \uac12<\/h2>\n\n<p>\uc911\uad04\ud638\ub85c \uc8fc\uc18c \ud55c \uc870\uac01\uc744 \ubcc0\uc218\ub85c \ube44\uc6cc \ub450\uba74, \uadf8 \uc790\ub9ac\uc5d0 \ub4e4\uc5b4\uc628 \uac12\uc774 \ud568\uc218 \uc778\uc790\ub85c \uadf8\ub300\ub85c \ub118\uc5b4\uc628\ub2e4.<\/p>\n\n<div class=\"code-block\"># main.py\nfrom fastapi import FastAPI\n\napp = FastAPI()\n\n@app.get(&#8220;\/users\/{user_id}&#8221;)\ndef read_user(user_id: int):\n    return {&#8220;user_id&#8221;: user_id, &#8220;is_int&#8221;: isinstance(user_id, int)}<\/div>\n\n<p><code>\/users\/7<\/code> \ub85c \uc694\uccad\ud558\uba74 <code>{\"user_id\": 7, \"is_int\": true}<\/code> \uac00 \uc628\ub2e4. \uc8fc\ubaa9\ud560 \uacf3\uc740 <code>user_id: int<\/code> \ud55c \uc904\uc774\ub2e4. URL \uc740 \uc6d0\ub798 \uc804\ubd80 \uae00\uc790(\ubb38\uc790\uc5f4)\uc778\ub370, \ud0c0\uc785\ud78c\ud2b8\ub97c <code>int<\/code> \ub85c \uc801\uc5c8\ub354\ub2c8 FastAPI \uac00 <strong>&#8220;7&#8221; \uc774\ub77c\ub294 \uae00\uc790\ub97c \uc22b\uc790 7 \ub85c \ubc14\uafd4\uc11c<\/strong> \ub118\uaca8 \uc92c\ub2e4. \uc6b0\ub9ac\uac00 \ubcc0\ud658 \ucf54\ub4dc\ub97c \ud55c \uc904\ub3c4 \uc548 \uc801\uc5c8\ub294\ub370\ub3c4.<\/p>\n\n<p>\ub354 \uc88b\uc740 \uac74 \ud2c0\ub9b0 \uc785\ub825\uc744 \ub9c9\uc544 \uc8fc\ub294 \ubd80\ubd84\uc774\ub2e4. <code>\/users\/abc<\/code> \ucc98\ub7fc \uc22b\uc790\uac00 \uc544\ub2cc \uac12\uc744 \ubcf4\ub0b4\uba74, \ud568\uc218\ub294 \uc2e4\ud589\uc870\ucc28 \ub418\uc9c0 \uc54a\uace0 \uc774\ub7f0 \uc751\ub2f5\uc774 \ub3cc\uc544\uc628\ub2e4.<\/p>\n\n<div class=\"code-block\">{\n  &#8220;detail&#8221;: [{\n    &#8220;loc&#8221;: [&#8220;path&#8221;, &#8220;user_id&#8221;],\n    &#8220;msg&#8221;: &#8220;Input should be a valid integer&#8221;,\n    &#8220;type&#8221;: &#8220;int_parsing&#8221;\n  }]\n}<\/div>\n\n<div class=\"databox\">\n<strong>\uc21c\uc11c\uac00 \uace7 \uaddc\uce59<\/strong> \u2014 \uacbd\ub85c\ub294 \uc704\uc5d0\uc11c \uc544\ub798\ub85c \ub9e4\uce6d\ub41c\ub2e4. <code>\/users\/me<\/code> \uac19\uc740 \uace0\uc815 \uacbd\ub85c\ub294 <code>\/users\/{user_id}<\/code> \ubcf4\ub2e4 <strong>\uba3c\uc800<\/strong> \uc120\uc5b8\ud574\uc57c \ud55c\ub2e4. \uc21c\uc11c\uac00 \ubc14\ub00c\uba74 <code>me<\/code> \uac00 <code>user_id<\/code> \uac12\uc73c\ub85c \ube68\ub824 \ub4e4\uc5b4\uac00 \uc5c9\ub6b1\ud558\uac8c \ub3d9\uc791\ud55c\ub2e4. \ud5f7\uac08\ub9ac\uba74 &#8220;\uad6c\uccb4\uc801\uc778 \uacbd\ub85c \uba3c\uc800, \ubcc0\uc218 \uacbd\ub85c \ub098\uc911&#8221; \uc73c\ub85c \uae30\uc5b5.\n<\/div>\n\n<h2>2. \ucffc\ub9ac \ub9e4\uac1c\ubcc0\uc218 \u2014 \ubb3c\uc74c\ud45c \ub4a4\uc5d0 \ubd99\ub294 \uac12<\/h2>\n\n<p>\ud568\uc218 \uc778\uc790\ub85c \uc801\uc5c8\ub294\ub370 \uadf8 \uc774\ub984\uc774 \uacbd\ub85c <code>{ }<\/code> \uc548\uc5d0 \uc5c6\uc73c\uba74, FastAPI \ub294 \uc790\ub3d9\uc73c\ub85c \uadf8\uac78 <strong>\ucffc\ub9ac \ub9e4\uac1c\ubcc0\uc218<\/strong>\ub85c \ud574\uc11d\ud55c\ub2e4. \ubaa9\ub85d\uc744 \uac70\ub974\uac70\ub098 \ud398\uc774\uc9c0\ub97c \ub118\uae38 \ub54c \uc4f0\ub294 \uadf8 <code>?key=value<\/code> \ub2e4.<\/p>\n\n<div class=\"code-block\">@app.get(&#8220;\/items&#8221;)\ndef list_items(skip: int = 0, limit: int = 10):\n    return {&#8220;skip&#8221;: skip, &#8220;limit&#8221;: limit}<\/div>\n\n<p><code>\/items?skip=20&limit=5<\/code> \ub85c \uc694\uccad\ud558\uba74 <code>{\"skip\": 20, \"limit\": 5}<\/code> \uac00 \uc628\ub2e4. \uc5ec\ub7ec \uac1c\ub97c \ubd99\uc77c \ub550 <code>&<\/code> \ub85c \uc787\ub294\ub2e4. \uc5ec\uae30\uc11c \ud575\uc2ec\uc740 <code>= 0<\/code>, <code>= 10<\/code> \uc774\ub77c\ub294 <strong>\uae30\ubcf8\uac12<\/strong>\uc774\ub2e4. \uae30\ubcf8\uac12\uc744 \uc8fc\uba74 \uadf8 \ub9e4\uac1c\ubcc0\uc218\ub294 <strong>\uc120\ud0dd<\/strong>\uc774 \ub41c\ub2e4. \uadf8\ub798\uc11c <code>\/items<\/code> \ub9cc \ud638\ucd9c\ud574\ub3c4 <code>skip=0, limit=10<\/code> \uc73c\ub85c \ub3d9\uc791\ud55c\ub2e4.<\/p>\n\n<p>\ubc18\ub300\ub85c \uaf2d \ubc1b\uc544\uc57c \ud558\ub294 \uac12\uc774\uba74 \uae30\ubcf8\uac12\uc744 \ube7c\uba74 \ub41c\ub2e4. \uadf8\ub7ec\uba74 \uadf8 \ucffc\ub9ac\ub294 <strong>\ud544\uc218<\/strong>\uac00 \ub418\uace0, \ube60\ub728\ub9b0 \ucc44 \ud638\ucd9c\ud558\uba74 \uace7\uc7a5 \uac80\uc99d \uc5d0\ub7ec\uac00 \ub09c\ub2e4. &#8220;\uc788\uc5b4\ub3c4 \ub418\uace0 \uc5c6\uc5b4\ub3c4 \ub418\ub294&#8221; \uac12\uc740 <code>str | None = None<\/code> \uc73c\ub85c \uc801\uc5b4 &#8220;\ube44\uc5b4 \uc788\uc5b4\ub3c4 OK&#8221; \ub97c \uba85\uc2dc\ud55c\ub2e4.<\/p>\n\n<div class=\"code-block\">@app.get(&#8220;\/search&#8221;)\ndef search(q: str, page: int = 1):\n    # q \ub294 \ud544\uc218, page \ub294 \uc120\ud0dd(\uae30\ubcf8 1)\n    return {&#8220;q&#8221;: q, &#8220;page&#8221;: page}<\/div>\n\n<h2>3. \uacbd\ub85c\ub0d0 \ucffc\ub9ac\ub0d0 \u2014 \uac00\ub974\ub294 \ud55c \uac00\uc9c0 \uc9c8\ubb38<\/h2>\n\n<p>\ub458 \ub2e4 \uac12\uc744 \ubc1b\ub294\ub370 \uc5b8\uc81c \ubb34\uc5c7\uc744 \uc4f0\ub098. \uc678\uc6b8 \ud544\uc694 \uc5c6\uc774 \ud55c \uac00\uc9c0\ub9cc \ubb3c\uc5b4\ubcf4\uba74 \ub41c\ub2e4 \u2014 <strong>&#8220;\uc774 \uac12\uc774 \uc790\uc6d0\uc744 \ucf55 \uc9d1\uc5b4 \uac00\ub9ac\ud0a4\ub098, \uc544\ub2c8\uba74 \uacb0\uacfc\ub97c \uac70\ub974\uac70\ub098 \ub2e4\ub4ec\ub098?&#8221;<\/strong><\/p>\n\n<div class=\"tablewrap\">\n<table>\n<thead><tr><th>\uad6c\ubd84<\/th><th>\uacbd\ub85c \ub9e4\uac1c\ubcc0\uc218<\/th><th>\ucffc\ub9ac \ub9e4\uac1c\ubcc0\uc218<\/th><\/tr><\/thead>\n<tbody>\n<tr><td>\uc704\uce58<\/td><td data-label=\"\uacbd\ub85c\">\uc8fc\uc18c \uacbd\ub85c \uc548 <code>\/users\/7<\/code><\/td><td data-label=\"\ucffc\ub9ac\">\ubb3c\uc74c\ud45c \ub4a4 <code>?page=2<\/code><\/td><\/tr>\n<tr><td>\uc5ed\ud560<\/td><td data-label=\"\uacbd\ub85c\">\uc790\uc6d0\uc744 \ucf55 \uc9c0\uc815 (\uc774 \uc0ac\uc6a9\uc790)<\/td><td data-label=\"\ucffc\ub9ac\">\uac70\ub974\uae30\u00b7\uc815\ub82c\u00b7\ud398\uc774\uc9c0<\/td><\/tr>\n<tr><td>\ud544\uc218 \uc5ec\ubd80<\/td><td data-label=\"\uacbd\ub85c\">\uc0ac\uc2e4\uc0c1 \ud544\uc218<\/td><td data-label=\"\ucffc\ub9ac\">\uae30\ubcf8\uac12 \uc8fc\uba74 \uc120\ud0dd<\/td><\/tr>\n<tr><td>\uc5ec\ub7ec \uac1c<\/td><td data-label=\"\uacbd\ub85c\">\uacc4\uce35\uc73c\ub85c <code>\/users\/7\/posts\/3<\/code><\/td><td data-label=\"\ucffc\ub9ac\"><code>&<\/code> \ub85c \ub098\uc5f4<\/td><\/tr>\n<tr><td>\uc608\uc2dc<\/td><td data-label=\"\uacbd\ub85c\">\uc0c1\uc138 \ud398\uc774\uc9c0 1\uac74<\/td><td data-label=\"\ucffc\ub9ac\">\uac80\uc0c9\u00b7\ubaa9\ub85d \ud544\ud130<\/td><\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n\n<p>\uc2e4\uc804 \uac10\uc744 \ud55c \uc904\ub85c \u2014 <code>\/products\/42<\/code> \ub294 &#8220;42\ubc88 \uc0c1\ud488&#8221; \uc744 \uac00\ub9ac\ud0a4\ub2c8 \uacbd\ub85c, <code>\/products?category=shoes&sort=price<\/code> \ub294 \uc0c1\ud488 \ubaa9\ub85d\uc744 \uac70\ub974\uace0 \uc815\ub82c\ud558\ub2c8 \ucffc\ub9ac\ub2e4. \ud55c \uc8fc\uc18c\uc5d0 \ub458\uc744 \uc11e\uc744 \uc218\ub3c4 \uc788\ub2e4. <code>\/users\/7\/orders?status=paid<\/code> \u2014 7\ubc88 \uc0ac\uc6a9\uc790(\uacbd\ub85c)\uc758 \uacb0\uc81c\ub41c \uc8fc\ubb38(\ucffc\ub9ac).<\/p>\n\n<h2>4. \uac80\uc99d\uc744 \ud55c \ub2e8\uacc4 \ub354 \u2014 Path \uc640 Query<\/h2>\n\n<p>\ud0c0\uc785\ub9cc\uc73c\ub85c \ubd80\uc871\ud560 \ub54c\uac00 \uc788\ub2e4. &#8220;\ud398\uc774\uc9c0 \ubc88\ud638\ub294 1 \uc774\uc0c1&#8221;, &#8220;\uac80\uc0c9\uc5b4\ub294 2\uae00\uc790 \uc774\uc0c1&#8221; \uac19\uc740 \uaddc\uce59\uc774\ub2e4. FastAPI \ub294 <code>Path<\/code>\u00b7<code>Query<\/code> \ud568\uc218\ub85c \uc774\ub7f0 \uc81c\uc57d\uc744 \ud55c \uc904 \ub354 \uc5b9\uac8c \ud574 \uc900\ub2e4.<\/p>\n\n<div class=\"code-block\">from fastapi import FastAPI, Path, Query\n\napp = FastAPI()\n\n@app.get(&#8220;\/products\/{pid}&#8221;)\ndef get_product(\n    pid: int = Path(ge=1),                  # 1 \uc774\uc0c1\n    q: str | None = Query(default=None, min_length=2),  # 2\uae00\uc790 \uc774\uc0c1\n):\n    return {&#8220;pid&#8221;: pid, &#8220;q&#8221;: q}<\/div>\n\n<p><code>ge=1<\/code> \uc740 &#8220;greater than or equal&#8221; \u2014 1 \ubbf8\ub9cc\uc774\uba74 \uac70\ubd80. <code>min_length=2<\/code> \ub294 \ub108\ubb34 \uc9e7\uc740 \uac80\uc0c9\uc5b4\ub97c \ub9c9\ub294\ub2e4. \uc774 \uc81c\uc57d\ub4e4\uc740 \uac80\uc99d\ub9cc \uac15\ud654\ud558\ub294 \uac8c \uc544\ub2c8\ub77c <strong>1\ud3b8\uc5d0\uc11c \ubcf8 <code>\/docs<\/code> \ubb38\uc11c\uc5d0\ub3c4 \uadf8\ub300\ub85c \ubc18\uc601<\/strong>\ub41c\ub2e4. &#8220;pid \ub294 1 \uc774\uc0c1&#8221; \uc774\ub77c\ub294 \uaddc\uce59\uc774 \ubb38\uc11c\uc5d0 \uc790\ub3d9\uc73c\ub85c \uc801\ud600, \ud504\ub860\ud2b8\uc5d4\ub4dc \uac1c\ubc1c\uc790\uac00 \ucf54\ub4dc\ub97c \uc548 \ubd10\ub3c4 \uaddc\uce59\uc744 \uc548\ub2e4.<\/p>\n\n<div class=\"warnbox\">\n<strong>\ud754\ud55c \ucc29\uac01<\/strong> \u2014 &#8220;\uae30\ubcf8\uac12\uc744 None \uc73c\ub85c \uc8fc\uba74 \ud544\uc218\uac00 \uc544\ub2c8\uac8c \ub41c\ub2e4&#8221; \uae4c\uc9c4 \ub9de\uc9c0\ub9cc, <code>q: str = Query(min_length=2)<\/code> \ucc98\ub7fc \uae30\ubcf8\uac12\uc744 \uc548 \uc8fc\uba74 \uadf8 \ucffc\ub9ac\ub294 <strong>\ud544\uc218<\/strong>\uac00 \ub41c\ub2e4. \uc120\ud0dd\uc73c\ub85c \ub450\uace0 \uc2f6\uc73c\uba74 \ubc18\ub4dc\uc2dc <code>default=None<\/code> \uc744 \uba85\uc2dc\ud560 \uac83. \ud0c0\uc785\uc5d0 <code>| None<\/code> \ub9cc \ubd99\uc774\uace0 \uae30\ubcf8\uac12\uc744 \ube60\ub728\ub9ac\ub294 \uc2e4\uc218\uac00 \uc785\ubb38\uc790\uc5d0\uac8c \uac00\uc7a5 \uc7a6\ub2e4.\n<\/div>\n\n<h3>\uc694\uc57d \u2014 \uac12\uc744 \ubc1b\ub294 \ub450 \ud1b5\ub85c<\/h3>\n\n<p>\uc815\ub9ac\ud558\uba74 \uc774\ub807\ub2e4. <strong>\uacbd\ub85c \ub9e4\uac1c\ubcc0\uc218<\/strong>\ub294 \uc8fc\uc18c\uc5d0 \ubc15\ud600 \uc790\uc6d0\uc744 \ucf55 \uc9d1\uace0(\uac70\uc758 \ud544\uc218), <strong>\ucffc\ub9ac \ub9e4\uac1c\ubcc0\uc218<\/strong>\ub294 \ubb3c\uc74c\ud45c \ub4a4\uc5d0 \ubd99\uc5b4 \uacb0\uacfc\ub97c \uac70\ub974\uac70\ub098 \ub2e4\ub4ec\ub294\ub2e4(\uae30\ubcf8\uac12 \uc8fc\uba74 \uc120\ud0dd). \ub458 \ub2e4 \ud0c0\uc785\ud78c\ud2b8\ub9cc\uc73c\ub85c \uae00\uc790\u2192\uc22b\uc790 \ubcc0\ud658\uacfc \uac80\uc99d\uc774 \uacf5\uc9dc\ub85c \ub530\ub77c\uc624\uace0, <code>Path<\/code>\u00b7<code>Query<\/code> \ub85c &#8220;1 \uc774\uc0c1&#8221;\u00b7&#8221;2\uae00\uc790 \uc774\uc0c1&#8221; \uac19\uc740 \uaddc\uce59\uae4c\uc9c0 \ud55c \uc904\ub85c \uc5b9\uc744 \uc218 \uc788\ub2e4. \uadf8\ub7f0\ub370 \uac12\uc774 \uc5ec\ub7ec \uac1c \ubb36\uc778 \ub369\uc5b4\ub9ac, \uac00\ub839 \ud68c\uc6d0\uac00\uc785 \ud3fc \uc804\uccb4\ub97c \ubc1b\uc73c\ub824\uba74? \uadf8\uac74 \uc8fc\uc18c\uac00 \uc544\ub2c8\ub77c <strong>\uc694\uccad \ubcf8\ubb38<\/strong>\uc5d0 \ub2f4\uc544\uc57c \ud55c\ub2e4. 3\ud3b8\uc5d0\uc11c Pydantic \ubaa8\ub378\ub85c \uadf8 \ubcf8\ubb38\uc744 \ubc1b\ub294\ub2e4.<\/p>\n\n<div class=\"cta\">\n<h3>\ub2e4\uc74c \ud3b8 \uc608\uace0 \u2014 Pydantic \ubaa8\ub378\ub85c \uc694\uccad \ubcf8\ubb38 \ubc1b\uae30<\/h3>\n<p>\uc774\ub984\u00b7\uc774\uba54\uc77c\u00b7\ube44\ubc00\ubc88\ud638\ucc98\ub7fc \ubb36\uc778 \ub370\uc774\ud130\ub97c \ubaa8\ub378 \ud558\ub098\ub85c \ubc1b\uace0 \uac80\uc99d\ud558\ub294 \ubc95.<\/p>\n<\/div>\n\n<div class=\"footer-nav\">\n\uc2dc\ub9ac\uc988 \u00b7 <a href=\"https:\/\/junai.ai\/blog\/category\/fastapi\/\">\uc27d\uac8c \ubc30\uc6b0\ub294 FastAPI<\/a> \u00b7 \ud568\uaed8 \ubcf4\uae30: <a href=\"https:\/\/junai.ai\/blog\/category\/python\/\">\ud30c\uc774\uc36c \uae30\ucd08 \uc2dc\ub9ac\uc988<\/a>\n<\/div>\n\n<\/article>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>FastAPI \uc5d0\uc11c \uc8fc\uc18c\uc5d0 \uac12\uc744 \uc2e4\uc5b4 \ubcf4\ub0b4\ub294 \ub450 \ubc29\ubc95, \uacbd\ub85c \ub9e4\uac1c\ubcc0\uc218\uc640 \ucffc\ub9ac \ub9e4\uac1c\ubcc0\uc218. \ud0c0\uc785\ud78c\ud2b8\ub85c \uc790\ub3d9 \ubcc0\ud658\u00b7\uac80\uc99d\ud558\uace0 \ub458\uc744 \uc5b8\uc81c \uc5b4\ub5bb\uac8c \uc4f0\ub294\uc9c0. \uad50\uc7ac 2\ud3b8.<\/p>\n","protected":false},"author":1,"featured_media":924,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[],"class_list":["post-937","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-fastapi"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/junai.ai\/blog\/wp-json\/wp\/v2\/posts\/937","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/junai.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/junai.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/junai.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/junai.ai\/blog\/wp-json\/wp\/v2\/comments?post=937"}],"version-history":[{"count":0,"href":"https:\/\/junai.ai\/blog\/wp-json\/wp\/v2\/posts\/937\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/junai.ai\/blog\/wp-json\/wp\/v2\/media\/924"}],"wp:attachment":[{"href":"https:\/\/junai.ai\/blog\/wp-json\/wp\/v2\/media?parent=937"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/junai.ai\/blog\/wp-json\/wp\/v2\/categories?post=937"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/junai.ai\/blog\/wp-json\/wp\/v2\/tags?post=937"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}