From 7c8383c96b3157ff8e5ada36332714b03b97e9bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Sun, 24 Apr 2022 17:31:12 +0200 Subject: [PATCH 001/168] =?UTF-8?q?=F0=9F=94=A7=20Update=20sponsors,=20ena?= =?UTF-8?q?ble=20Dropbase=20again,=20update=20TalkPython=20link=20(#4821)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 ++- docs/en/data/sponsors.yml | 5 ++++- docs/en/data/sponsors_badge.yml | 1 + docs/en/overrides/main.html | 6 ++++++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a03a98719..3756053e8 100644 --- a/README.md +++ b/README.md @@ -50,9 +50,10 @@ The key features are: + - + diff --git a/docs/en/data/sponsors.yml b/docs/en/data/sponsors.yml index 35eff9d87..a216be04d 100644 --- a/docs/en/data/sponsors.yml +++ b/docs/en/data/sponsors.yml @@ -8,6 +8,9 @@ gold: - url: https://classiq.link/n4s title: Join the team building a new SaaS platform that will change the computing world img: https://fastapi.tiangolo.com/img/sponsors/classiq.png + - url: https://www.dropbase.io/careers + title: Dropbase - seamlessly collect, clean, and centralize data. + img: https://fastapi.tiangolo.com/img/sponsors/dropbase.svg silver: - url: https://www.deta.sh/?ref=fastapi title: The launchpad for all your (team's) ideas @@ -15,7 +18,7 @@ silver: - url: https://www.investsuite.com/jobs title: Wealthtech jobs with FastAPI img: https://fastapi.tiangolo.com/img/sponsors/investsuite.svg - - url: https://talkpython.fm/fastapi-sponsor + - url: https://training.talkpython.fm/fastapi-courses title: FastAPI video courses on demand from people you trust img: https://fastapi.tiangolo.com/img/sponsors/talkpython.png - url: https://testdriven.io/courses/tdd-fastapi/ diff --git a/docs/en/data/sponsors_badge.yml b/docs/en/data/sponsors_badge.yml index 67dd16a8b..e0288356a 100644 --- a/docs/en/data/sponsors_badge.yml +++ b/docs/en/data/sponsors_badge.yml @@ -8,3 +8,4 @@ logins: - Striveworks - xoflare - InesIvanova + - DropbaseHQ diff --git a/docs/en/overrides/main.html b/docs/en/overrides/main.html index 562bf3079..cac02ca7c 100644 --- a/docs/en/overrides/main.html +++ b/docs/en/overrides/main.html @@ -46,6 +46,12 @@ +
+ + + + +
{% endblock %} From 0fd99ec3378f7330271981b28258208b948cc7f4 Mon Sep 17 00:00:00 2001 From: github-actions Date: Sun, 24 Apr 2022 15:31:48 +0000 Subject: [PATCH 002/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index df3a36805..568796dd0 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐Ÿ”ง Update sponsors, enable Dropbase again, update TalkPython link. PR [#4821](https://github.com/tiangolo/fastapi/pull/4821) by [@tiangolo](https://github.com/tiangolo). ## 0.75.2 From 4642d5bb862627f5653ef666b178689b21f129c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Sun, 24 Apr 2022 17:52:31 +0200 Subject: [PATCH 003/168] =?UTF-8?q?=F0=9F=8D=B1=20Update=20sponsor,=20ExoF?= =?UTF-8?q?lare=20badge=20(#4822)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/img/sponsors/exoflare.png | Bin 5357 -> 10556 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/docs/en/docs/img/sponsors/exoflare.png b/docs/en/docs/img/sponsors/exoflare.png index 3eed3af18a00c01f5940940a85386542b449dfd2..b5977d80bedb27d3a17eb16aa919947867750a75 100644 GIT binary patch literal 10556 zcmZ{Kby$?)x9t!L(nv}QNGT1{ATgArAl(g;igZg2($d{15`u&Xh;&PX2vVYyptO{D z_x$cX_ndzYj|@IA^L^j@?!DJuYwb5$OGAkej|LBcKoF`ZBemh@E_~bIUWM1Dq7QxW z8ZRRKeh>j+@<6Z_6jP2ybt19!FOv4{J+zTOPM3_SwHA zX%L8;2of%K^72MXzvojdQBhGNB6bU+cnyO8ybepSTS(_8L?@S7?OLez z4}9>5>g(uu7UgY2qH1V(V@9~k($<#H*Vh*jV!)+nQ-Ubx9H9RyP88o*IEindp+RJ4 zM_EHFMsxf2?V~vxn-X~vFZ|IwDW~CriD0f+o z`}gn96?)RqxoEy5uZh>toRtvmXfM#O8`9I$W9IqAP~@gm^!DvrLZiNp@t~)-F)GT- ztxs@`GqQ=VCiM9iH$RVwAq|wc{^xgJ*sIALOd=x6T)Fn=&!5*cGF)}aUeVIha+q$; z|FO;@v`zU|K+vecj41wixr%ak3F~2TLD7V6nZO&f4|3Zds5gGnwil!q4xjs7a8O{% za+tM}ysLjtN4GO#e8)mwo&}yv*0?1~?RY}=wyXiieO1*AaXPxb0)KCp%&kP_TRyut zF_K6zQ&LkKns(r0J;tz~=J?0Q@qE7~_16S$+}Ok=yw-cLe#Nsaxx3ekxW$F&K77a*5N=whrxlGHWx~amHJVFibD^N1;I~0h zL?+aP6%`e!9Z^wGFbQafL`4(Zyj@>*a1%Fa$HT*`si%8x+2t}`s!EkPn36)i>h*9) zF>!io>OWUheCy%iK|<+=FDCZo(;O9!lJR6Arts!HM6r^DjJ&)KoBt+VHJ>;h?2BJ< zpp&C#pMyURHSN%%uBN(5qzuXP&dzkVdN-o@nId`Y%8Cjce;oFW&CMa3rL>AySrP_% zrlxV>;i5=I+{F{N&W^pZ`ihY0>1j)mCqioKpKN%Nlak_V#*8^Q99lewB^ijZ)Nw4Q zIB;IQ9uywa)zgdI*x=~yTL?okJJvNmb{A4?!8K4(xgp#&n*rJ?B`;ON*f<3+A^Mw~d%*4A^&MfRQRf`Lfd z#Dw<4hYzQmD#{H7Wlr{gv`Fmst{=dKBOn4^3vb@O6@b5MX=^hdxOtuIu273V<+%9! zHz_sssMp2eD3L;3T#A2an(+5%4tKIoG%l2lsMjH1=aoXYIG@lg*NfCU>F&R_9Ww)> zeI*%ShiV-5v}fnyosT@{wI?PgVaXW}&CKF2E&@)@&N>GNpW9}qq=e7T&I&vB&4;wM zN+Ov_F)=X>PG7%%T~k||<}8>gsBN^h|#1s{sK47ItjsqFUDVbG((T z2Nju_o4ELd9d-7nRnxJ;Oe`$)ZR`n!`6|J)^Ad8Vro|8Z6%-U=Yv`{Ddf+3M;vbPE zyxiV)cK-4<;!A#NDuwjLuDn{lG`)Njk%G4Nb;R&VY3$Ro<)e z@-E*>{9*2^EJBBrZ|ek%tE8-Isn7rXw*Rs4-UG)Us-)HTfci17d0XrB@u@I#lJfG} znjZU7XJ^r;KY^PQtR~G*%Rl{@q~`u5ci6_aK)<$#mfZ4A4Zm}rqB8dRba z{Z3d{SGUQ7ohFz;3)mqgv}eB5WL-)w83Yvo)4jLPE12o`+)LSS_^$;^O1W%g7*v-4V$ZgC^PU}Ub~&eeaen&r$?%7;%Urm5 z@ZZ$af2#@iA`=pbAL{DvEqE_6-MWQcR#t`xS!nULKH8dwZbV3Ua&od9Ml6j$(22Su zf`Wno?%FF2>y}qnvB=2CX4?Gz{32vz%=c^Q43K7&mXh*A}p)Yfwk@{*F_UNlYAeV>74{f z&r}+QJ%5e|3G#d(|6Z{4&ug~M&IE;8sMI_9%z}bs5Y+B6^=uMK%3c#yd3kxHf`aA6 z$sR5qo*d-ZOtooD3>B}y(ZG+D@-_baX%sT5W6ONnT@Q zWZc-=VrFN@@mL>;(BiN`3OUd6!KSy5CGMPw`5!xT8NLla4Tg*F?(Vj?1)kSDUR5+O zFyIr(wH->coU3<4JhGEM2?)xiy{>gIx3aQ=K}<}n*VfV^At@=Dn4GNhGBzuV2L2D( z7rDFZj;@8k^O?#;S|JA#_;m*Di`TDjGcz;SSae__kw_U1a;wdWQd}Y;*ImD#uz;I4 z5jtgRmZl{e0Cgj7F!V8;nm2l_rYYk%W=<^inw~}t}(2vV2 zy?o#=CMITJKoA-|fG|1!7*a{;RRPtJpp?LX@yd5_b90mF?p+G&zIfZb?xWhkb1&G3 z&W;WY%us|(93tr7U+;j^AL%E5KK_eyoGg>o(IHD_*HlCzu@UGeT6vZz zyaO3w>F5}ZL;NU53h?aludiZUrp@H&5}Yd6;fGD!{!)jNA9#ENh0DgqhDu22n`?0T ziK{~S{rmT^VkP2MpS_~R9bU86knC*Qkz9$WKa2jv5H&t-sybbsI=Es4-dNT8v9`86>}ZaSZQ^U+W1Kxa z{4__>mq5STGA<7lBGm6er4%F8)hTU)oDdY10`NUCKE z69S;c`d}Rvp^O{XbCTX1hJxVxSOwx#s2*+NX zt~gt_GY$h_uQaH|yrWmy{_G0Ag|&4U+yriX(;x=9hIAvIXQG392^Dqqj?Af z78ce+J-wOC-)d@VHi`q;svh0OjC~1=N-8SXzAh|aAXL-1WPN?b;u)mo9K<%`D)_Ce zt@nDU%-e^D3D!sRqYStpJ|cW}!x`d@E#AK)8yfEVNHXN)b@>+)u8xl%^M_>V=X?H~kp&EgI_;=7ZQ*+~#R0f4Z){9!YikRH4;399 znwF-QD`Y!Jj<_3&1>6i6o%2fKTv$4<`M2)_$r-{fG-t;<`1<<#Ia2p-M&`mSz#M50ml8T3q&&kA8sL>V{ zhDAym5gyLxo4|OlEQ**>;2(a3+-+`dRu>l+Hn(mRDH8c~V~hz?hJk^h-sv+B&=wnK z6I0V@l*9h_0qhWF7MAj+rVOFGcW-3FdL|Y>_&Wk7VTb6wF;hn(J=TUTonc2$Pfy3a zmje6V8n*iITeI-;Y66Qdh7}3;+K=QgF*9Rfg^Bl>>gg%U%F0%@0>YA#CbhK%(fe=i zDJm(EktWsEd4#Rcjg2LuP#U@7y7u$WDej<94p0`uV*7i0Ox)buz3>%@LP?)~C&QF6 ze&@={Tm)cn9U&knSPU&<|IZ({&EJKq!HFi1%x-gWm3;kbvcJF2%*)FQ*i1$*;S~$S zUxhg-5unBTyg39?43+>mE#xvMlqKQKQ(9K04cU~LolS-~+wCHbMs1AV`&Y8k6_uQu zOMiNPu48Mw1=eEgnX}uZ0#JJv~Ya za`Lektg8Lv<4N&!Vsc0%a4YPP%F4=DZ{NO{n3!-_Z1w%Vy{!gFTzYtTC~|$*?c-lS z)}J#~EL2ofGoNq~3m^Q`QK%Qm$%`9g@{pF z4T&sPN?==d!+=2Nl`CcGpDTWjo!Yyn%yXBQf|63(1=bFL6wPDOBtyooVe_Sp#{yAr zGjM%yc-Us}p3iPbZ#@0b+taOzHyjcY*|h`x{T2(k=ncWJaF)Qp zz^(COrD88&G31Bo0;S(qcpT4Z8_R89=(D+{J*|Fhylu46de5J zVqxiOmQ)-$4GkVQcNNVvnoL%Y-Z=64^FQB$KJ#pn*!NBbfPX%Pr0_o(7x z>+FV@;)9}BuTbBZEmdfBkQQ1WMpN{JXWe8W=Qy4hB-4c<0>Fz|LDvLc+cR4Lj1c3kuABH9;+NNkFv$7v~N`jz&cEt+(T2LyUaBZ?(_hk zd%QKp`F(9o?$&iC9v&j|fW0e2Wo}DtyGKU~(2QWmNN8xDN0YG&%!ATsyVzIl?(36> zHv?sm@cvavwmLjLO_7w81fbmx-3-li^#a&|uU49WWQdNACW%HW1BY*PnKzIFrP1+Y zC_O1ZKLKFgsMvO1~6jFIf*CVmG_U2%K*W~f#GCETsAf~ z9?rXcd;p0ESUt8m`Es*vRN5&zN+nFi)HL_WlP4T^?!-u+Zwng1;uo4dV^F9xE<^1) zX+7CcZ57M3u*N&{JZO0EKk@atEv3S`5sk|NH&Cu;(RLbnjIAEATN6a=X}aryT= zGmzV~IR%B{F>6%@dR*o*-}pd5;fiUiPg1SnJ6C$Zv9llP<_@rNhh4j6o-% zAvE?VDqb_KfB;Eu;KI;>Ir;gMKuNBOwD=y_F*6Si4HW}7oPd&%g>ptBQ!+A?K^oNi z|8X7s^of<385}LUe-(OFR;>|~yk=?=UfTtOgZIyVzWGR<4G7J51ROul>-XX(pL>DO z$gxA#M)NfxD=gwa!(K!A;3CkKI&QtaJoN;_-o|DO%^z=-XVll%Z@|XI{)JFNzQrH! z%=cYSnc8dylqaX9RXqant-u&~_#h1P5;DPId$v~X#hJM<+wxtfnW+|DPH2vH&hm0{ z83ES#S|9vo)c&uB&`FlJwmV2WB*Rn`-#$*PM%si~fOu=z-+sR{DEEIS4J- zVdxbQLR)8GzytI1+3%zC#5^LQ4;y;&8aKwGyQNGVm8PsL21w*u$s}RtSs5gfMKSg! z;_1Pf`h88!Hy&Ln%>)`*LeVG`EPB+LQPPLc*WX_UG@>Dqt@*B5n_m|bX-%5Orz)Gm*Hel|Yp%*@P8s;Ic*>*ps>bhh;GQb{H**b(*!-8UhC zj)xoLQ{YGGo&Ih+k4K@Z%|6^`4A{j0#ZudtKqm$b2B^IX4-b#pi^W4pDXD9Sov-hc zQK*qTDOI2*O!V~hdQu4OWi9GCM46d1L0*S}WycWqzQBz#Z;`Gs~HbYxmdkeRzaSUS&fcxtP zzn2k)zOHVP0atZ0V4U9XD}K3f{$(fn5f`XgS z!YCG6eUpjk#k()sOQ4Ga{yznqU~P?)GRE;>?b9uGb|r+eib^y*iXvdJ8f{ouSSHUg zC;?3*vb41H*7fME65yz$2yI>6Qh3k_Xg!&$tzJ7cH)v@ET{8JBG0_=X{R!63l^g2N#ouN4mwBJRBT}D(wKKFUj3?ez#AQR932iaI?5p+}fH0 z3dVZ%`}giSv-xo&nz&F@hIjVoE8A;pijk3#YOm?>%b75UX@pR)6y%K?H!8iR73Xv- zxtBk$QeC-nC5bDRPHaDpclP7u5ic_{jfg8<^2?$kIixd&YI0c_n|h`|L^P@H`Crmk z??VY0Br`zgtHS31Zu*-U?)^PXR@-@zp3d&%&i0evRKN0dj6X6e%DdiYzK_ud_Ho#rr<8+}vtxdq78DLbOT@$hxdui`JrNCZJ1A%T7Aj5v8T9Az8d^-`Cfzr(f%WWL5(Fg;a<@69-7!roeMy02;KYgor=X*RR{U z1Pw+?M;8k`n~8}DD}Xr@CAU#H#T~unz12QZXl+2(NEjK3 zRaI5P!^4Gso;Z??o;|HJYQS3x{6kNcVMbZK=op}5xCa~r z_IP@UNFa)E2P`iyul}JSc~@5+Ak@qEIth%P-+dXlP+Vz;e**0_L&{(H^5Q^qd+8%1 zI1U-$YyO;X;^*h57O=quAg=+wg5Fy2nGlaC-yzz8M%M)W^>c7=xCwqsb91vnlRHyq zSJwkGv&k~FX@m|kz}MrmL&uGc4GV|~P#jczd?b=tR#EXP#ISw+fb{xxOkk$NIbviG zMnuTQh6DNuE-x=nps{Kh8R0=Egjjt{0y{VR6dWwj8~56mmKdpcOhVe)qyf#6^77(A zv9JGMHDh={;4(YhHVq^zBtU2)&+xX{le?xCBMq~IGrqTMm+=LtHaQw4;7i{bkZsLYi(G6IC^}639-_62t9!JFfaWJcr=Cn(O_A z@d`O9X@@f}H#ew~r+VilE5;17Svu7pSbxkJzi7$xsvD8g5)=m+r!hD(Qr6ii2iohU zbl}<8dyn-E01lh&vp>Hz!COp8Pgeq`%z+joL z<6>9-dK(pmb1g!S29l;C7HqrD+WQHn9OM(fKmHqev07``?GTE$2j|W! zq+AaDjGCWvTI);X?SqMHm_!BbT}IGuxB!rz-{t&pQu7)D6sDjrP@-3L#Ng9HvQq)0 z6g<+^*VlRaR4DLdB`S7-`)4S*o0G;~|?WuDZ#H~OuLk`GkOs{5~SI=WnHjrRZbRbX$gj}e`4H8nLG z8)fcO&&c?q)Cj2g5YTWpV6T)!B8n+15E)N}5GKM}MF zX=#de_M>)RX6NQ!Ko&W}L~;W}eq}FKGrA7wa$m~KM00GIgIgWv4Ff*H6!!2a~|!k3v@ z577*lOa@*J_SB2_@5R)!h2y|wQsJW1`CM&!4MBKAARMB}AtI8V#%-(!!s_M6%d;2| z@rIZ)Q&T0w!)h>0EY1|Pe*xA6y`&HLCP1i7+~&`L^+CYN$;jkE=idUi09~A0TaU^X z!NAc5URPRDG6p_jKQP&7QD#r(l|3IIS}Y*GnZR^FyD3us$0VfVz;~}94uW?qP+&8% zMkD3Uk9U6V{+xYY?t5i1Uo3lV#8`{{{inYnkp@P!l9892Dhdh_IlZw}e*!+`z6*h& zn1ffYHU=bm;(#DOKNGW6kt5>nuV;pah7V0lhQC)C)IPgr#ICOWm;hFb7=y<%kV8CT zejw?0h+h`#l@828z+{L4XfoQN zu`Vtskb#(!lanK5;?}81Yr|ialpw*{vT<=yNA!a$fkOSTdT%>K$;`}Fv(%E9wKMjn zY9Wk*s!3SNf2(ui2?sMXwz9g4tLyY{0?@uS)Xvu=T9P&{x5t8becwzI++`{MmjVJuI`b!i1VfXR@g&{qgZJqP<%*O>sL>{1QvX)AR1HukXWP zY#`t}@y0kKGqYoMHe-PI_U+C@Ci#Mbf)L=~df7lx9+;RAKpgbily5x)Tu0o5kp!)< zb323#J#heYUJg8K$x|s6J_G{y1Ntlg12F&`A_NljYg-^KfKXIzEkB4m6gbotAWqbB zYiny!&tV7~fnV#oAP%-Amr*^g_wPj*bfj$3d0#b>D$#i78laXZN%&s=zXrYPRDMx> z|9{3?=eR1o=BeKcV$l+6y$O&L8xsTQu!V(1d-x{CBRTr%^-e>WCY_m!y9)zbU?Y#4 z;^E^Xfm*8MV44sBNY4*#`y&xX|hJGF6h< zRf4gwsO9-wdp zKm^FCsEX_B$wB8PmRIFQ*d=^0Zwnw@AISr|baILM+nx`#gE(#sC3i$|vPbd4zzANx z`Q&Pbm{X(Lw^Zd@%F3v&+T!4wcka}woX>Q&w<92ReNOjTlRtxc0tOdq%f4gg=L33D z%I~lpM2&&h#HDRKtZ6Ps)`RrVlQk81_Guih}jPO z+}zy4va;Tb-^_!w_luz53<=7-k0zxW$)jEPl;3aLfiNnDrW zkpW+&^xjnnLXUs8!m`chQ&T$Zk?5$&z;a87nwJ(;`6Ue?0(W3w0L{&S0z-hVfnSbR z=|{OmfL0w{U0CRvfznFM&5Z*$4sER)v;~M+dtaP99?lja22$IxyVAAyeSj>MR)h$~ zq+Aa^uK{`K_W%7MibW}Y`NN;ZE>K5k-U|eVesOUT5d!4H0!&YI?7(3xtf+`7l#dc% ze2w*}Ei5%LF$CBw1=u-0AU1(_6+)vkH#eV=4h#s`-F%r}q?*nn>b{If{=Kn*3zHD^ z1XllznM6wSFVgECXz(KFJ<*L^C{x%qyfyvTHf)W{b58+ywye_M`;^^ zX&*q9jTH)KNZN`M5cq|HHEhUs?;bIHte1Yp7&7*8Rz>NYy3 zrpVB<5jGL%)*z@tBOJ5`Fc3l7e{Jz5MkMCs#CCThscC7g`xBYaPX#d`fH`|f zX(yV4EwB(RPjDsR=ug_F5+UM$oM0Fa7mny#{qNHY@?`=&JqoBc`iS#CtM6wG z=)+-f3-UA^=31*zr`sEA_2N|wWU5Lp*|+I)EG)(<9IdBfQ>5>!%K~b_0K&MAvnsN% zkW_JA;%>8Kt#E2;Y7;F>cdo>^XPLI>TogJXPF6jkLP+T8BhaT?y!zkB){{P-~upYX5w`n`Y2SuY4eZ<0qu@Ma6IEj!?dUrgSH41j}7bCrKaUc9jS z8vopR{Nj=7T7`$lzs&d>bZ+}x8$tMK3f zDKpCzpNtb3Hh(zswN^!1L;hdKu~_^+3&V+*LZ*%*zdy<^-#YIo7CGsEx%%q%?ZL-N z)N%fQtQNnV%Ex<$z0+vd&XQ<)xWtSH2OmU5<7NN+niH62N>bikmc?Xd!3HG8an z=v>S@y>^+Mh?~U)%+`m`p?aB)%?J*U2rb5jwAKQpf>Q8ceY|EU<2e(ec(3&;${KPo zXAF#q!x}!hb8ytVk|f!mp5hX=L{tvP>Q$wO6-#Z9W2P0AmBp{X38uTxzLEeLMYS!w zO>!oJaexM^1?Q(DpVx6udBo1VY{D!}MMcH&bG6&G!Q8~h>Ej=paz68ya(SN>6INWj zF@<^6=D=sLUpeaLHf5gFs$_)dBDeU5kWyGc*IeYz-Yv=)(i^9v@ee-jxgLz*8sO!R z_TkPy=pPyE{(HWc^OB@b;uD+@B#IBd{_m@sz!UdYEO*Sc<&EzD`+C7RCQv}Ya#iUw QoP0#6C}<$7k5S8vN%{#z-7Z@%O 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 Date: Sun, 24 Apr 2022 15:53:04 +0000 Subject: [PATCH 004/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 568796dd0..6c995148a 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐Ÿฑ Update sponsor, ExoFlare badge. PR [#4822](https://github.com/tiangolo/fastapi/pull/4822) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ”ง Update sponsors, enable Dropbase again, update TalkPython link. PR [#4821](https://github.com/tiangolo/fastapi/pull/4821) by [@tiangolo](https://github.com/tiangolo). ## 0.75.2 From 1920c3dd16909f00631fde1e71890dac048bf1de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Mon, 25 Apr 2022 12:01:39 +0200 Subject: [PATCH 005/168] =?UTF-8?q?=F0=9F=94=A7=20Add=20Budget=20Insight?= =?UTF-8?q?=20sponsor=20(#4824)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + docs/en/data/sponsors.yml | 3 +++ docs/en/data/sponsors_badge.yml | 1 + docs/en/docs/img/sponsors/budget-insight.svg | 22 ++++++++++++++++++++ 4 files changed, 27 insertions(+) create mode 100644 docs/en/docs/img/sponsors/budget-insight.svg diff --git a/README.md b/README.md index 3756053e8..9ad50f271 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,7 @@ The key features are: + diff --git a/docs/en/data/sponsors.yml b/docs/en/data/sponsors.yml index a216be04d..ac825193b 100644 --- a/docs/en/data/sponsors.yml +++ b/docs/en/data/sponsors.yml @@ -30,6 +30,9 @@ silver: - url: https://www.udemy.com/course/fastapi-rest/ title: Learn FastAPI by building a complete project. Extend your knowledge on advanced web development-AWS, Payments, Emails. img: https://fastapi.tiangolo.com/img/sponsors/ines-course.jpg + - url: https://careers.budget-insight.com/ + title: Budget Insight is hiring! + img: https://fastapi.tiangolo.com/img/sponsors/budget-insight.svg bronze: - url: https://www.exoflare.com/open-source/?utm_source=FastAPI&utm_campaign=open_source title: Biosecurity risk assessments made easy. diff --git a/docs/en/data/sponsors_badge.yml b/docs/en/data/sponsors_badge.yml index e0288356a..1c8b0cde7 100644 --- a/docs/en/data/sponsors_badge.yml +++ b/docs/en/data/sponsors_badge.yml @@ -9,3 +9,4 @@ logins: - xoflare - InesIvanova - DropbaseHQ + - VincentParedes diff --git a/docs/en/docs/img/sponsors/budget-insight.svg b/docs/en/docs/img/sponsors/budget-insight.svg new file mode 100644 index 000000000..d753727a1 --- /dev/null +++ b/docs/en/docs/img/sponsors/budget-insight.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + From 146f57b8f70c5757dc20edc716dba1b96936a8d6 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 25 Apr 2022 10:02:17 +0000 Subject: [PATCH 006/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 6c995148a..44c1b647e 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐Ÿ”ง Add Budget Insight sponsor. PR [#4824](https://github.com/tiangolo/fastapi/pull/4824) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿฑ Update sponsor, ExoFlare badge. PR [#4822](https://github.com/tiangolo/fastapi/pull/4822) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ”ง Update sponsors, enable Dropbase again, update TalkPython link. PR [#4821](https://github.com/tiangolo/fastapi/pull/4821) by [@tiangolo](https://github.com/tiangolo). From 33d61430cf48a9442c0809b76564827bea6ea9ea Mon Sep 17 00:00:00 2001 From: Marcelo Trylesinski Date: Fri, 6 May 2022 00:19:59 +0200 Subject: [PATCH 007/168] =?UTF-8?q?=E2=AC=86=20Upgrade=20Starlette=20from?= =?UTF-8?q?=200.17.1=20to=200.18.0=20(#4483)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastiรกn Ramรญrez --- fastapi/concurrency.py | 2 +- fastapi/dependencies/utils.py | 11 ++++------- fastapi/routing.py | 2 +- pyproject.toml | 4 +++- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/fastapi/concurrency.py b/fastapi/concurrency.py index 04382c69e..becac3f33 100644 --- a/fastapi/concurrency.py +++ b/fastapi/concurrency.py @@ -25,7 +25,7 @@ async def contextmanager_in_threadpool( try: yield await run_in_threadpool(cm.__enter__) except Exception as e: - ok = await run_in_threadpool(cm.__exit__, type(e), e, None) + ok: bool = await run_in_threadpool(cm.__exit__, type(e), e, None) if not ok: raise e else: diff --git a/fastapi/dependencies/utils.py b/fastapi/dependencies/utils.py index d4028d067..9dccd354e 100644 --- a/fastapi/dependencies/utils.py +++ b/fastapi/dependencies/utils.py @@ -462,13 +462,10 @@ async def solve_dependencies( ]: values: Dict[str, Any] = {} errors: List[ErrorWrapper] = [] - response = response or Response( - content=None, - status_code=None, # type: ignore - headers=None, # type: ignore # in Starlette - media_type=None, # type: ignore # in Starlette - background=None, # type: ignore # in Starlette - ) + if response is None: + response = Response() + del response.headers["content-length"] + response.status_code = None # type: ignore dependency_cache = dependency_cache or {} sub_dependant: Dependant for sub_dependant in dependant.dependencies: diff --git a/fastapi/routing.py b/fastapi/routing.py index 7a15f3965..6680c04ed 100644 --- a/fastapi/routing.py +++ b/fastapi/routing.py @@ -127,7 +127,7 @@ async def serialize_response( if is_coroutine: value, errors_ = field.validate(response_content, {}, loc=("response",)) else: - value, errors_ = await run_in_threadpool( + value, errors_ = await run_in_threadpool( # type: ignore[misc] field.validate, response_content, {}, loc=("response",) ) if isinstance(errors_, ErrorWrapper): diff --git a/pyproject.toml b/pyproject.toml index 7856085fb..1a2610740 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,7 @@ classifiers = [ "Topic :: Internet :: WWW/HTTP", ] requires = [ - "starlette ==0.17.1", + "starlette ==0.18.0", "pydantic >=1.6.2,!=1.7,!=1.7.1,!=1.7.2,!=1.7.3,!=1.8,!=1.8.1,<2.0.0", ] description-file = "README.md" @@ -140,4 +140,6 @@ filterwarnings = [ "error", # TODO: needed by asyncio in Python 3.9.7 https://bugs.python.org/issue45097, try to remove on 3.9.8 'ignore:The loop argument is deprecated since Python 3\.8, and scheduled for removal in Python 3\.10:DeprecationWarning:asyncio', + # TODO: remove after dropping support for Python 3.6 + 'ignore:Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography and will be removed in a future release.:UserWarning:jose', ] From b44e85ca8a6e6cdf59c4da2541b12de808a0f539 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 5 May 2022 22:20:33 +0000 Subject: [PATCH 008/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 44c1b647e..93e713136 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* โฌ† Upgrade Starlette from 0.17.1 to 0.18.0. PR [#4483](https://github.com/tiangolo/fastapi/pull/4483) by [@Kludex](https://github.com/Kludex). * ๐Ÿ”ง Add Budget Insight sponsor. PR [#4824](https://github.com/tiangolo/fastapi/pull/4824) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿฑ Update sponsor, ExoFlare badge. PR [#4822](https://github.com/tiangolo/fastapi/pull/4822) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ”ง Update sponsors, enable Dropbase again, update TalkPython link. PR [#4821](https://github.com/tiangolo/fastapi/pull/4821) by [@tiangolo](https://github.com/tiangolo). From 66f634482034c0bd297b3b7fa9d458b98f74a606 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 5 May 2022 17:22:25 -0500 Subject: [PATCH 009/168] =?UTF-8?q?=F0=9F=91=A5=20Update=20FastAPI=20Peopl?= =?UTF-8?q?e=20(#4847)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: github-actions --- docs/en/data/github_sponsors.yml | 116 +++++++++++------------ docs/en/data/people.yml | 152 +++++++++++++++---------------- 2 files changed, 124 insertions(+), 144 deletions(-) diff --git a/docs/en/data/github_sponsors.yml b/docs/en/data/github_sponsors.yml index 42339d262..db4a9acc6 100644 --- a/docs/en/data/github_sponsors.yml +++ b/docs/en/data/github_sponsors.yml @@ -5,10 +5,13 @@ sponsors: - login: jina-ai avatarUrl: https://avatars.githubusercontent.com/u/60539444?v=4 url: https://github.com/jina-ai -- - login: InesIvanova - avatarUrl: https://avatars.githubusercontent.com/u/22920417?u=409882ec1df6dbd77455788bb383a8de223dbf6f&v=4 - url: https://github.com/InesIvanova -- - login: chaserowbotham + - login: DropbaseHQ + avatarUrl: https://avatars.githubusercontent.com/u/85367855?v=4 + url: https://github.com/DropbaseHQ +- - login: sushi2all + avatarUrl: https://avatars.githubusercontent.com/u/1043732?v=4 + url: https://github.com/sushi2all + - login: chaserowbotham avatarUrl: https://avatars.githubusercontent.com/u/97751084?v=4 url: https://github.com/chaserowbotham - - login: mikeckennedy @@ -26,7 +29,19 @@ sponsors: - login: investsuite avatarUrl: https://avatars.githubusercontent.com/u/73833632?v=4 url: https://github.com/investsuite -- - login: qaas + - login: VincentParedes + avatarUrl: https://avatars.githubusercontent.com/u/103889729?v=4 + url: https://github.com/VincentParedes +- - login: plocher + avatarUrl: https://avatars.githubusercontent.com/u/1082871?v=4 + url: https://github.com/plocher +- - login: InesIvanova + avatarUrl: https://avatars.githubusercontent.com/u/22920417?u=409882ec1df6dbd77455788bb383a8de223dbf6f&v=4 + url: https://github.com/InesIvanova +- - login: SendCloud + avatarUrl: https://avatars.githubusercontent.com/u/7831959?v=4 + url: https://github.com/SendCloud + - login: qaas avatarUrl: https://avatars.githubusercontent.com/u/8503759?u=10a6b4391ad6ab4cf9487ce54e3fcb61322d1efc&v=4 url: https://github.com/qaas - login: xoflare @@ -44,9 +59,6 @@ sponsors: - login: HiredScore avatarUrl: https://avatars.githubusercontent.com/u/3908850?v=4 url: https://github.com/HiredScore - - login: spackle0 - avatarUrl: https://avatars.githubusercontent.com/u/6148423?u=750e21b7366c0de69c305a8bcda1365d921ae477&v=4 - url: https://github.com/spackle0 - login: wdwinslow avatarUrl: https://avatars.githubusercontent.com/u/11562137?u=dc01daafb354135603a263729e3d26d939c0c452&v=4 url: https://github.com/wdwinslow @@ -57,7 +69,7 @@ sponsors: avatarUrl: https://avatars.githubusercontent.com/u/3329665?u=ec6a9adf8e7e8e306eed7d49687c398608d1604f&v=4 url: https://github.com/RodneyU215 - login: grillazz - avatarUrl: https://avatars.githubusercontent.com/u/3415861?u=16d7d0ffa5dfb99f8834f8f76d90e138ba09b94a&v=4 + avatarUrl: https://avatars.githubusercontent.com/u/3415861?u=0b32b7073ae1ab8b7f6d2db0188c2e1e357ff451&v=4 url: https://github.com/grillazz - login: tizz98 avatarUrl: https://avatars.githubusercontent.com/u/5739698?u=f095a3659e3a8e7c69ccd822696990b521ea25f9&v=4 @@ -65,11 +77,8 @@ sponsors: - login: jmaralc avatarUrl: https://avatars.githubusercontent.com/u/21101214?u=b15a9f07b7cbf6c9dcdbcb6550bbd2c52f55aa50&v=4 url: https://github.com/jmaralc - - login: Filimoa - avatarUrl: https://avatars.githubusercontent.com/u/21352040?u=75e02d102d2ee3e3d793e555fa5c63045913ccb0&v=4 - url: https://github.com/Filimoa - login: marutoraman - avatarUrl: https://avatars.githubusercontent.com/u/33813153?v=4 + avatarUrl: https://avatars.githubusercontent.com/u/33813153?u=2d0522bceba0b8b69adf1f2db866503bd96f944e&v=4 url: https://github.com/marutoraman - login: mainframeindustries avatarUrl: https://avatars.githubusercontent.com/u/55092103?v=4 @@ -77,10 +86,10 @@ sponsors: - login: A-Edge avatarUrl: https://avatars.githubusercontent.com/u/59514131?v=4 url: https://github.com/A-Edge -- - login: hcristea - avatarUrl: https://avatars.githubusercontent.com/u/7814406?u=61d7a4fcf846983a4606788eac25e1c6c1209ba8&v=4 - url: https://github.com/hcristea -- - login: samuelcolvin +- - login: Kludex + avatarUrl: https://avatars.githubusercontent.com/u/7353520?u=62adc405ef418f4b6c8caa93d3eb8ab107bc4927&v=4 + url: https://github.com/Kludex + - login: samuelcolvin avatarUrl: https://avatars.githubusercontent.com/u/4039449?u=807390ba9cfe23906c3bf8a0d56aaca3cf2bfa0d&v=4 url: https://github.com/samuelcolvin - login: jokull @@ -110,18 +119,12 @@ sponsors: - login: jqueguiner avatarUrl: https://avatars.githubusercontent.com/u/690878?u=e4835b2a985a0f2d52018e4926cb5a58c26a62e8&v=4 url: https://github.com/jqueguiner - - login: Mazyod - avatarUrl: https://avatars.githubusercontent.com/u/860511?v=4 - url: https://github.com/Mazyod - login: ltieman avatarUrl: https://avatars.githubusercontent.com/u/1084689?u=e69b17de17cb3ca141a17daa7ccbe173ceb1eb17&v=4 url: https://github.com/ltieman - login: westonsteimel avatarUrl: https://avatars.githubusercontent.com/u/1593939?u=0f2c0e3647f916fe295d62fa70da7a4c177115e3&v=4 url: https://github.com/westonsteimel - - login: timdrijvers - avatarUrl: https://avatars.githubusercontent.com/u/1694939?v=4 - url: https://github.com/timdrijvers - login: corleyma avatarUrl: https://avatars.githubusercontent.com/u/2080732?u=aed2ff652294a87d666b1c3f6dbe98104db76d26&v=4 url: https://github.com/corleyma @@ -185,15 +188,9 @@ sponsors: - login: Rehket avatarUrl: https://avatars.githubusercontent.com/u/7015688?u=3afb0ba200feebbc7f958950e92db34df2a3c172&v=4 url: https://github.com/Rehket - - login: christippett - avatarUrl: https://avatars.githubusercontent.com/u/7218120?u=f21f93b9c14edefef75645bf4d64c819b7d4afd7&v=4 - url: https://github.com/christippett - login: hiancdtrsnm avatarUrl: https://avatars.githubusercontent.com/u/7343177?v=4 url: https://github.com/hiancdtrsnm - - login: Kludex - avatarUrl: https://avatars.githubusercontent.com/u/7353520?u=62adc405ef418f4b6c8caa93d3eb8ab107bc4927&v=4 - url: https://github.com/Kludex - login: Shackelford-Arden avatarUrl: https://avatars.githubusercontent.com/u/7362263?v=4 url: https://github.com/Shackelford-Arden @@ -215,9 +212,6 @@ sponsors: - login: robintully avatarUrl: https://avatars.githubusercontent.com/u/17059673?u=862b9bb01513f5acd30df97433cb97a24dbfb772&v=4 url: https://github.com/robintully - - login: tobiasfeil - avatarUrl: https://avatars.githubusercontent.com/u/17533713?u=bc6b0bec46f342d13c41695db90685d1c58d534e&v=4 - url: https://github.com/tobiasfeil - login: wedwardbeck avatarUrl: https://avatars.githubusercontent.com/u/19333237?u=1de4ae2bf8d59eb4c013f21d863cbe0f2010575f&v=4 url: https://github.com/wedwardbeck @@ -230,21 +224,21 @@ sponsors: - login: RedCarpetUp avatarUrl: https://avatars.githubusercontent.com/u/20360440?v=4 url: https://github.com/RedCarpetUp + - login: Filimoa + avatarUrl: https://avatars.githubusercontent.com/u/21352040?u=75e02d102d2ee3e3d793e555fa5c63045913ccb0&v=4 + url: https://github.com/Filimoa - login: shuheng-liu avatarUrl: https://avatars.githubusercontent.com/u/22414322?u=813c45f30786c6b511b21a661def025d8f7b609e&v=4 url: https://github.com/shuheng-liu - - login: comoelcometa - avatarUrl: https://avatars.githubusercontent.com/u/25950317?u=c6751efa038561b9bc5fa56d1033d5174e10cd65&v=4 - url: https://github.com/comoelcometa + - login: cometa-haley + avatarUrl: https://avatars.githubusercontent.com/u/25950317?u=cec1a3e0643b785288ae8260cc295a85ab344995&v=4 + url: https://github.com/cometa-haley - login: LarryGF avatarUrl: https://avatars.githubusercontent.com/u/26148349?u=431bb34d36d41c172466252242175281ae132152&v=4 url: https://github.com/LarryGF - login: veprimk avatarUrl: https://avatars.githubusercontent.com/u/29689749?u=f8cb5a15a286e522e5b189bc572d5a1a90217fb2&v=4 url: https://github.com/veprimk - - login: orihomie - avatarUrl: https://avatars.githubusercontent.com/u/29889683?u=6bc2135a52fcb3a49e69e7d50190796618185fda&v=4 - url: https://github.com/orihomie - login: meysam81 avatarUrl: https://avatars.githubusercontent.com/u/30233243?u=64dc9fc62d039892c6fb44d804251cad5537132b&v=4 url: https://github.com/meysam81 @@ -266,6 +260,9 @@ sponsors: - login: ybressler avatarUrl: https://avatars.githubusercontent.com/u/40807730?u=6621dc9ab53b697912ab2a32211bb29ae90a9112&v=4 url: https://github.com/ybressler + - login: iamkarshe + avatarUrl: https://avatars.githubusercontent.com/u/43641892?u=d08c901b359c931784501740610d416558ff3e24&v=4 + url: https://github.com/iamkarshe - login: dbanty avatarUrl: https://avatars.githubusercontent.com/u/43723790?u=9bcce836bbce55835291c5b2ac93a4e311f4b3c3&v=4 url: https://github.com/dbanty @@ -278,6 +275,9 @@ sponsors: - login: daisuke8000 avatarUrl: https://avatars.githubusercontent.com/u/55035595?u=5025e379cd3655ae1a96039efc85223a873d2e38&v=4 url: https://github.com/daisuke8000 + - login: yakkonaut + avatarUrl: https://avatars.githubusercontent.com/u/60633704?u=90a71fd631aa998ba4a96480788f017c9904e07b&v=4 + url: https://github.com/yakkonaut - login: primer-io avatarUrl: https://avatars.githubusercontent.com/u/62146168?v=4 url: https://github.com/primer-io @@ -293,9 +293,6 @@ sponsors: - login: anthonycepeda avatarUrl: https://avatars.githubusercontent.com/u/72019805?u=892f700c79f9732211bd5221bf16eec32356a732&v=4 url: https://github.com/anthonycepeda - - login: abdurrahim84 - avatarUrl: https://avatars.githubusercontent.com/u/79488613?v=4 - url: https://github.com/abdurrahim84 - login: NinaHwang avatarUrl: https://avatars.githubusercontent.com/u/79563565?u=1741703bd6c8f491503354b363a86e879b4c1cab&v=4 url: https://github.com/NinaHwang @@ -305,9 +302,6 @@ sponsors: - login: pyt3h avatarUrl: https://avatars.githubusercontent.com/u/99658549?v=4 url: https://github.com/pyt3h -- - login: '837477' - avatarUrl: https://avatars.githubusercontent.com/u/37999795?u=543b0bd0e8f283db0fc50754e5d13f6afba8cbea&v=4 - url: https://github.com/837477 - - login: linux-china avatarUrl: https://avatars.githubusercontent.com/u/46711?v=4 url: https://github.com/linux-china @@ -353,9 +347,9 @@ sponsors: - login: hardbyte avatarUrl: https://avatars.githubusercontent.com/u/855189?u=aa29e92f34708814d6b67fcd47ca4cf2ce1c04ed&v=4 url: https://github.com/hardbyte - - login: clstaudt - avatarUrl: https://avatars.githubusercontent.com/u/875194?u=46a92f9f837d0ba150ae0f1d91091dd2f4ebb6cc&v=4 - url: https://github.com/clstaudt + - login: janfilips + avatarUrl: https://avatars.githubusercontent.com/u/870699?u=6034d81731ecb41ae5c717e56a901ed46fc039a8&v=4 + url: https://github.com/janfilips - login: scari avatarUrl: https://avatars.githubusercontent.com/u/964251?v=4 url: https://github.com/scari @@ -398,12 +392,12 @@ sponsors: - login: holec avatarUrl: https://avatars.githubusercontent.com/u/6438041?u=f5af71ec85b3a9d7b8139cb5af0512b02fa9ab1e&v=4 url: https://github.com/holec + - login: moonape1226 + avatarUrl: https://avatars.githubusercontent.com/u/8532038?u=d9f8b855a429fff9397c3833c2ff83849ebf989d&v=4 + url: https://github.com/moonape1226 - login: davanstrien avatarUrl: https://avatars.githubusercontent.com/u/8995957?u=fb2aad2b52bb4e7b56db6d7c8ecc9ae1eac1b984&v=4 url: https://github.com/davanstrien - - login: and-semakin - avatarUrl: https://avatars.githubusercontent.com/u/9129071?u=ea77ddf7de4bc375d546bf2825ed420eaddb7666&v=4 - url: https://github.com/and-semakin - login: yenchenLiu avatarUrl: https://avatars.githubusercontent.com/u/9199638?u=8cdf5ae507448430d90f6f3518d1665a23afe99b&v=4 url: https://github.com/yenchenLiu @@ -419,6 +413,9 @@ sponsors: - login: hard-coders avatarUrl: https://avatars.githubusercontent.com/u/9651103?u=95db33927bbff1ed1c07efddeb97ac2ff33068ed&v=4 url: https://github.com/hard-coders + - login: satwikkansal + avatarUrl: https://avatars.githubusercontent.com/u/10217535?u=b12d6ef74ea297de9e46da6933b1a5b7ba9e6a61&v=4 + url: https://github.com/satwikkansal - login: pheanex avatarUrl: https://avatars.githubusercontent.com/u/10408624?u=5b6bab6ee174aa6e991333e06eb29f628741013d&v=4 url: https://github.com/pheanex @@ -458,18 +455,15 @@ sponsors: - login: d-e-h-i-o avatarUrl: https://avatars.githubusercontent.com/u/36816716?v=4 url: https://github.com/d-e-h-i-o - - login: askurihin - avatarUrl: https://avatars.githubusercontent.com/u/37978981?v=4 - url: https://github.com/askurihin - login: ilias-ant avatarUrl: https://avatars.githubusercontent.com/u/42189572?u=a2d6121bac4d125d92ec207460fa3f1842d37e66&v=4 url: https://github.com/ilias-ant - login: arrrrrmin avatarUrl: https://avatars.githubusercontent.com/u/43553423?u=fee5739394fea074cb0b66929d070114a5067aae&v=4 url: https://github.com/arrrrrmin - - login: igorezersky - avatarUrl: https://avatars.githubusercontent.com/u/46680020?u=a20a595c881dbe5658c906fecc7eff125efb4fd4&v=4 - url: https://github.com/igorezersky + - login: Nephilim-Jack + avatarUrl: https://avatars.githubusercontent.com/u/48372168?u=6f2bb405238d7efc467536fe01f58df6779c58a9&v=4 + url: https://github.com/Nephilim-Jack - login: akanz1 avatarUrl: https://avatars.githubusercontent.com/u/51492342?u=2280f57134118714645e16b535c1a37adf6b369b&v=4 url: https://github.com/akanz1 @@ -488,20 +482,14 @@ sponsors: - login: alessio-proietti avatarUrl: https://avatars.githubusercontent.com/u/67370599?u=8ac73db1e18e946a7681f173abdb640516f88515&v=4 url: https://github.com/alessio-proietti -- - login: spyker77 - avatarUrl: https://avatars.githubusercontent.com/u/4953435?u=03c724c6f8fbab5cd6575b810c0c91c652fa4f79&v=4 - url: https://github.com/spyker77 - - login: backbord +- - login: backbord avatarUrl: https://avatars.githubusercontent.com/u/6814946?v=4 url: https://github.com/backbord - login: sadikkuzu avatarUrl: https://avatars.githubusercontent.com/u/23168063?u=765ed469c44c004560079210ccdad5b29938eaa9&v=4 url: https://github.com/sadikkuzu - - login: MoronVV - avatarUrl: https://avatars.githubusercontent.com/u/24293616?v=4 - url: https://github.com/MoronVV - login: gabrielmbmb - avatarUrl: https://avatars.githubusercontent.com/u/29572918?u=92084ed7242160dee4d20aece923a10c59758ee5&v=4 + avatarUrl: https://avatars.githubusercontent.com/u/29572918?u=6d1e00b5d558e96718312ff910a2318f47cc3145&v=4 url: https://github.com/gabrielmbmb - login: danburonline avatarUrl: https://avatars.githubusercontent.com/u/34251194?u=2cad4388c1544e539ecb732d656e42fb07b4ff2d&v=4 diff --git a/docs/en/data/people.yml b/docs/en/data/people.yml index 2f05b3e6b..92aab109f 100644 --- a/docs/en/data/people.yml +++ b/docs/en/data/people.yml @@ -1,12 +1,12 @@ maintainers: - login: tiangolo - answers: 1240 - prs: 291 + answers: 1243 + prs: 300 avatarUrl: https://avatars.githubusercontent.com/u/1326112?u=5cad72c846b7aba2e960546af490edc7375dafc4&v=4 url: https://github.com/tiangolo experts: - login: Kludex - count: 330 + count: 335 avatarUrl: https://avatars.githubusercontent.com/u/7353520?u=62adc405ef418f4b6c8caa93d3eb8ab107bc4927&v=4 url: https://github.com/Kludex - login: dmontagu @@ -35,7 +35,7 @@ experts: url: https://github.com/raphaelauv - login: ArcLightSlavik count: 71 - avatarUrl: https://avatars.githubusercontent.com/u/31127044?u=81a84af39c89b898b0fbc5a04e8834f60f23e55a&v=4 + avatarUrl: https://avatars.githubusercontent.com/u/31127044?u=b0f2c37142f4b762e41ad65dc49581813422bd71&v=4 url: https://github.com/ArcLightSlavik - login: falkben count: 58 @@ -57,10 +57,18 @@ experts: count: 39 avatarUrl: https://avatars.githubusercontent.com/u/11836741?u=8bd5ef7e62fe6a82055e33c4c0e0a7879ff8cfb6&v=4 url: https://github.com/includeamin +- login: jgould22 + count: 38 + avatarUrl: https://avatars.githubusercontent.com/u/4335847?u=ed77f67e0bb069084639b24d812dbb2a2b1dc554&v=4 + url: https://github.com/jgould22 - login: STeveShary count: 37 avatarUrl: https://avatars.githubusercontent.com/u/5167622?u=de8f597c81d6336fcebc37b32dfd61a3f877160c&v=4 url: https://github.com/STeveShary +- login: adriangb + count: 36 + avatarUrl: https://avatars.githubusercontent.com/u/1755071?u=81f0262df34e1460ca546fbd0c211169c2478532&v=4 + url: https://github.com/adriangb - login: prostomarkeloff count: 33 avatarUrl: https://avatars.githubusercontent.com/u/28061158?u=72309cc1f2e04e40fa38b29969cb4e9d3f722e7b&v=4 @@ -69,10 +77,6 @@ experts: count: 31 avatarUrl: https://avatars.githubusercontent.com/u/1144727?u=85c025e3fcc7bd79a5665c63ee87cdf8aae13374&v=4 url: https://github.com/frankie567 -- login: adriangb - count: 31 - avatarUrl: https://avatars.githubusercontent.com/u/1755071?u=81f0262df34e1460ca546fbd0c211169c2478532&v=4 - url: https://github.com/adriangb - login: krishnardt count: 31 avatarUrl: https://avatars.githubusercontent.com/u/31960541?u=47f4829c77f4962ab437ffb7995951e41eeebe9b&v=4 @@ -82,7 +86,7 @@ experts: avatarUrl: https://avatars.githubusercontent.com/u/365303?u=07ca03c5ee811eb0920e633cc3c3db73dbec1aa5&v=4 url: https://github.com/wshayes - login: chbndrhnns - count: 26 + count: 28 avatarUrl: https://avatars.githubusercontent.com/u/7534547?v=4 url: https://github.com/chbndrhnns - login: panla @@ -101,10 +105,6 @@ experts: count: 24 avatarUrl: https://avatars.githubusercontent.com/u/9435877?u=719327b7d2c4c62212456d771bfa7c6b8dbb9eac&v=4 url: https://github.com/SirTelemak -- login: jgould22 - count: 23 - avatarUrl: https://avatars.githubusercontent.com/u/4335847?u=ed77f67e0bb069084639b24d812dbb2a2b1dc554&v=4 - url: https://github.com/jgould22 - login: acnebs count: 22 avatarUrl: https://avatars.githubusercontent.com/u/9054108?u=c27e50269f1ef8ea950cc6f0268c8ec5cebbe9c9&v=4 @@ -141,6 +141,10 @@ experts: count: 17 avatarUrl: https://avatars.githubusercontent.com/u/1765494?u=5b1ab7c582db4b4016fa31affe977d10af108ad4&v=4 url: https://github.com/harunyasar +- login: rafsaf + count: 17 + avatarUrl: https://avatars.githubusercontent.com/u/51059348?u=be9f06b8ced2d2b677297decc781fa8ce4f7ddbd&v=4 + url: https://github.com/rafsaf - login: waynerv count: 16 avatarUrl: https://avatars.githubusercontent.com/u/39515546?u=ec35139777597cdbbbddda29bf8b9d4396b429a9&v=4 @@ -149,14 +153,14 @@ experts: count: 16 avatarUrl: https://avatars.githubusercontent.com/u/41964673?u=9f2174f9d61c15c6e3a4c9e3aeee66f711ce311f&v=4 url: https://github.com/dstlny -- login: rafsaf - count: 15 - avatarUrl: https://avatars.githubusercontent.com/u/51059348?u=be9f06b8ced2d2b677297decc781fa8ce4f7ddbd&v=4 - url: https://github.com/rafsaf - login: haizaar count: 13 avatarUrl: https://avatars.githubusercontent.com/u/58201?u=4f1f9843d69433ca0d380d95146cfe119e5fdac4&v=4 url: https://github.com/haizaar +- login: valentin994 + count: 13 + avatarUrl: https://avatars.githubusercontent.com/u/42819267?u=fdeeaa9242a59b243f8603496b00994f6951d5a2&v=4 + url: https://github.com/valentin994 - login: hellocoldworld count: 12 avatarUrl: https://avatars.githubusercontent.com/u/47581948?v=4 @@ -165,6 +169,14 @@ experts: count: 12 avatarUrl: https://avatars.githubusercontent.com/u/17401854?u=474680c02b94cba810cb9032fb7eb787d9cc9d22&v=4 url: https://github.com/David-Lor +- login: yinziyan1206 + count: 12 + avatarUrl: https://avatars.githubusercontent.com/u/37829370?v=4 + url: https://github.com/yinziyan1206 +- login: jonatasoli + count: 12 + avatarUrl: https://avatars.githubusercontent.com/u/26334101?u=071c062d2861d3dd127f6b4a5258cd8ef55d4c50&v=4 + url: https://github.com/jonatasoli - login: lowercase00 count: 11 avatarUrl: https://avatars.githubusercontent.com/u/21188280?v=4 @@ -177,55 +189,35 @@ experts: count: 11 avatarUrl: https://avatars.githubusercontent.com/u/8134632?v=4 url: https://github.com/juntatalor -- login: valentin994 +- login: n8sty count: 11 - avatarUrl: https://avatars.githubusercontent.com/u/42819267?u=fdeeaa9242a59b243f8603496b00994f6951d5a2&v=4 - url: https://github.com/valentin994 + avatarUrl: https://avatars.githubusercontent.com/u/2964996?v=4 + url: https://github.com/n8sty - login: aalifadv count: 11 avatarUrl: https://avatars.githubusercontent.com/u/78442260?v=4 url: https://github.com/aalifadv -- login: stefanondisponibile - count: 10 - avatarUrl: https://avatars.githubusercontent.com/u/20441825?u=ee1e59446b98f8ec2363caeda4c17164d0d9cc7d&v=4 - url: https://github.com/stefanondisponibile -- login: oligond - count: 10 - avatarUrl: https://avatars.githubusercontent.com/u/2858306?u=1bb1182a5944e93624b7fb26585f22c8f7a9d76e&v=4 - url: https://github.com/oligond -- login: n8sty - count: 10 - avatarUrl: https://avatars.githubusercontent.com/u/2964996?v=4 - url: https://github.com/n8sty last_month_active: -- login: yinziyan1206 +- login: jgould22 + count: 15 + avatarUrl: https://avatars.githubusercontent.com/u/4335847?u=ed77f67e0bb069084639b24d812dbb2a2b1dc554&v=4 + url: https://github.com/jgould22 +- login: accelleon count: 5 - avatarUrl: https://avatars.githubusercontent.com/u/37829370?v=4 - url: https://github.com/yinziyan1206 + avatarUrl: https://avatars.githubusercontent.com/u/5001614?v=4 + url: https://github.com/accelleon +- login: jonatasoli + count: 4 + avatarUrl: https://avatars.githubusercontent.com/u/26334101?u=071c062d2861d3dd127f6b4a5258cd8ef55d4c50&v=4 + url: https://github.com/jonatasoli - login: Kludex - count: 5 + count: 4 avatarUrl: https://avatars.githubusercontent.com/u/7353520?u=62adc405ef418f4b6c8caa93d3eb8ab107bc4927&v=4 url: https://github.com/Kludex -- login: jd-0001 - count: 4 - avatarUrl: https://avatars.githubusercontent.com/u/47495003?u=322eedc0931b62827cf5f239654f77bfaff76b46&v=4 - url: https://github.com/jd-0001 -- login: harunyasar - count: 3 - avatarUrl: https://avatars.githubusercontent.com/u/1765494?u=5b1ab7c582db4b4016fa31affe977d10af108ad4&v=4 - url: https://github.com/harunyasar -- login: wmcgee3 - count: 3 - avatarUrl: https://avatars.githubusercontent.com/u/61711986?u=c51ebfaf8a995019fda8288690f4a009ecf070f0&v=4 - url: https://github.com/wmcgee3 -- login: tasercake - count: 3 - avatarUrl: https://avatars.githubusercontent.com/u/13855549?v=4 - url: https://github.com/tasercake -- login: jgould22 +- login: yinziyan1206 count: 3 - avatarUrl: https://avatars.githubusercontent.com/u/4335847?u=ed77f67e0bb069084639b24d812dbb2a2b1dc554&v=4 - url: https://github.com/jgould22 + avatarUrl: https://avatars.githubusercontent.com/u/37829370?v=4 + url: https://github.com/yinziyan1206 top_contributors: - login: waynerv count: 25 @@ -259,14 +251,14 @@ top_contributors: count: 8 avatarUrl: https://avatars.githubusercontent.com/u/22691749?u=4795b880e13ca33a73e52fc0ef7dc9c60c8fce47&v=4 url: https://github.com/Serrones +- login: Kludex + count: 8 + avatarUrl: https://avatars.githubusercontent.com/u/7353520?u=62adc405ef418f4b6c8caa93d3eb8ab107bc4927&v=4 + url: https://github.com/Kludex - login: RunningIkkyu count: 7 avatarUrl: https://avatars.githubusercontent.com/u/31848542?u=706e1ee3f248245f2d68b976d149d06fd5a2010d&v=4 url: https://github.com/RunningIkkyu -- login: Kludex - count: 7 - avatarUrl: https://avatars.githubusercontent.com/u/7353520?u=62adc405ef418f4b6c8caa93d3eb8ab107bc4927&v=4 - url: https://github.com/Kludex - login: hard-coders count: 7 avatarUrl: https://avatars.githubusercontent.com/u/9651103?u=95db33927bbff1ed1c07efddeb97ac2ff33068ed&v=4 @@ -328,30 +320,34 @@ top_reviewers: count: 41 avatarUrl: https://avatars.githubusercontent.com/u/24587499?u=e772190a051ab0eaa9c8542fcff1892471638f2b&v=4 url: https://github.com/cikay +- login: BilalAlpaslan + count: 40 + avatarUrl: https://avatars.githubusercontent.com/u/47563997?u=63ed66e304fe8d765762c70587d61d9196e5c82d&v=4 + url: https://github.com/BilalAlpaslan - login: AdrianDeAnda count: 33 avatarUrl: https://avatars.githubusercontent.com/u/1024932?u=bb7f8a0d6c9de4e9d0320a9f271210206e202250&v=4 url: https://github.com/AdrianDeAnda - login: ArcLightSlavik count: 31 - avatarUrl: https://avatars.githubusercontent.com/u/31127044?u=81a84af39c89b898b0fbc5a04e8834f60f23e55a&v=4 + avatarUrl: https://avatars.githubusercontent.com/u/31127044?u=b0f2c37142f4b762e41ad65dc49581813422bd71&v=4 url: https://github.com/ArcLightSlavik -- login: BilalAlpaslan - count: 28 - avatarUrl: https://avatars.githubusercontent.com/u/47563997?u=63ed66e304fe8d765762c70587d61d9196e5c82d&v=4 - url: https://github.com/BilalAlpaslan +- login: cassiobotaro + count: 25 + avatarUrl: https://avatars.githubusercontent.com/u/3127847?u=b0a652331da17efeb85cd6e3a4969182e5004804&v=4 + url: https://github.com/cassiobotaro - login: dmontagu count: 23 avatarUrl: https://avatars.githubusercontent.com/u/35119617?u=58ed2a45798a4339700e2f62b2e12e6e54bf0396&v=4 url: https://github.com/dmontagu -- login: cassiobotaro - count: 23 - avatarUrl: https://avatars.githubusercontent.com/u/3127847?u=b0a652331da17efeb85cd6e3a4969182e5004804&v=4 - url: https://github.com/cassiobotaro - login: komtaki count: 21 avatarUrl: https://avatars.githubusercontent.com/u/39375566?u=260ad6b1a4b34c07dbfa728da5e586f16f6d1824&v=4 url: https://github.com/komtaki +- login: yezz123 + count: 19 + avatarUrl: https://avatars.githubusercontent.com/u/52716203?u=636b4f79645176df4527dd45c12d5dbb5a4193cf&v=4 + url: https://github.com/yezz123 - login: hard-coders count: 19 avatarUrl: https://avatars.githubusercontent.com/u/9651103?u=95db33927bbff1ed1c07efddeb97ac2ff33068ed&v=4 @@ -364,10 +360,6 @@ top_reviewers: count: 17 avatarUrl: https://avatars.githubusercontent.com/u/67154681?u=5d634834cc514028ea3f9115f7030b99a1f4d5a4&v=4 url: https://github.com/zy7y -- login: yezz123 - count: 16 - avatarUrl: https://avatars.githubusercontent.com/u/52716203?u=636b4f79645176df4527dd45c12d5dbb5a4193cf&v=4 - url: https://github.com/yezz123 - login: yanever count: 16 avatarUrl: https://avatars.githubusercontent.com/u/21978760?v=4 @@ -452,6 +444,10 @@ top_reviewers: count: 8 avatarUrl: https://avatars.githubusercontent.com/u/43503750?u=b3e4d9a14d9a65d429ce62c566aef73178b7111d&v=4 url: https://github.com/ComicShrimp +- login: NinaHwang + count: 8 + avatarUrl: https://avatars.githubusercontent.com/u/79563565?u=1741703bd6c8f491503354b363a86e879b4c1cab&v=4 + url: https://github.com/NinaHwang - login: dimaqq count: 8 avatarUrl: https://avatars.githubusercontent.com/u/662249?v=4 @@ -476,14 +472,14 @@ top_reviewers: count: 7 avatarUrl: https://avatars.githubusercontent.com/u/1405026?v=4 url: https://github.com/Mause +- login: AlexandreBiguet + count: 7 + avatarUrl: https://avatars.githubusercontent.com/u/1483079?u=ff926455cd4cab03c6c49441aa5dc2b21df3e266&v=4 + url: https://github.com/AlexandreBiguet - login: krocdort count: 7 avatarUrl: https://avatars.githubusercontent.com/u/34248814?v=4 url: https://github.com/krocdort -- login: NinaHwang - count: 7 - avatarUrl: https://avatars.githubusercontent.com/u/79563565?u=1741703bd6c8f491503354b363a86e879b4c1cab&v=4 - url: https://github.com/NinaHwang - login: jovicon count: 6 avatarUrl: https://avatars.githubusercontent.com/u/21287303?u=b049eac3e51a4c0473c2efe66b4d28a7d8f2b572&v=4 @@ -496,7 +492,3 @@ top_reviewers: count: 6 avatarUrl: https://avatars.githubusercontent.com/u/32584628?u=88c2cb42a99e0f50cdeae3606992568184783ee5&v=4 url: https://github.com/peidrao -- login: diogoduartec - count: 5 - avatarUrl: https://avatars.githubusercontent.com/u/31852339?u=b50fc11c531e9b77922e19edfc9e7233d4d7b92e&v=4 - url: https://github.com/diogoduartec From 792285a047ec04a073e855368afa485758a606a7 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 5 May 2022 22:22:57 +0000 Subject: [PATCH 010/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 93e713136..1ab811704 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐Ÿ‘ฅ Update FastAPI People. PR [#4847](https://github.com/tiangolo/fastapi/pull/4847) by [@github-actions[bot]](https://github.com/apps/github-actions). * โฌ† Upgrade Starlette from 0.17.1 to 0.18.0. PR [#4483](https://github.com/tiangolo/fastapi/pull/4483) by [@Kludex](https://github.com/Kludex). * ๐Ÿ”ง Add Budget Insight sponsor. PR [#4824](https://github.com/tiangolo/fastapi/pull/4824) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿฑ Update sponsor, ExoFlare badge. PR [#4822](https://github.com/tiangolo/fastapi/pull/4822) by [@tiangolo](https://github.com/tiangolo). From 8df8b037f269b0eacbcf534686ddd2d66668bb4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Thu, 5 May 2022 17:25:14 -0500 Subject: [PATCH 011/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 1ab811704..27dbe9d52 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,8 +2,13 @@ ## Latest Changes -* ๐Ÿ‘ฅ Update FastAPI People. PR [#4847](https://github.com/tiangolo/fastapi/pull/4847) by [@github-actions[bot]](https://github.com/apps/github-actions). +### Upgrades + * โฌ† Upgrade Starlette from 0.17.1 to 0.18.0. PR [#4483](https://github.com/tiangolo/fastapi/pull/4483) by [@Kludex](https://github.com/Kludex). + +### Internal + +* ๐Ÿ‘ฅ Update FastAPI People. PR [#4847](https://github.com/tiangolo/fastapi/pull/4847) by [@github-actions[bot]](https://github.com/apps/github-actions). * ๐Ÿ”ง Add Budget Insight sponsor. PR [#4824](https://github.com/tiangolo/fastapi/pull/4824) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿฑ Update sponsor, ExoFlare badge. PR [#4822](https://github.com/tiangolo/fastapi/pull/4822) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ”ง Update sponsors, enable Dropbase again, update TalkPython link. PR [#4821](https://github.com/tiangolo/fastapi/pull/4821) by [@tiangolo](https://github.com/tiangolo). From 9090c771eea9a51b17d0eb76dd060edd9f2e640e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Thu, 5 May 2022 17:26:05 -0500 Subject: [PATCH 012/168] =?UTF-8?q?=F0=9F=94=96=20Release=20version=200.76?= =?UTF-8?q?.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 3 +++ fastapi/__init__.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 27dbe9d52..3ffb956cd 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,9 @@ ## Latest Changes + +## 0.76.0 + ### Upgrades * โฌ† Upgrade Starlette from 0.17.1 to 0.18.0. PR [#4483](https://github.com/tiangolo/fastapi/pull/4483) by [@Kludex](https://github.com/Kludex). diff --git a/fastapi/__init__.py b/fastapi/__init__.py index 22d8e51ec..fcd036ee4 100644 --- a/fastapi/__init__.py +++ b/fastapi/__init__.py @@ -1,6 +1,6 @@ """FastAPI framework, high performance, easy to learn, fast to code, ready for production""" -__version__ = "0.75.2" +__version__ = "0.76.0" from starlette import status as status From 86fa3cb24ff01578dddef6aa67f28d6abdfcbfce Mon Sep 17 00:00:00 2001 From: Marcelo Trylesinski Date: Mon, 9 May 2022 20:06:42 +0200 Subject: [PATCH 013/168] =?UTF-8?q?=E2=AC=86=20Upgrade=20Starlette=20from?= =?UTF-8?q?=200.18.0=20to=200.19.0=20(#4488)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastiรกn Ramรญrez --- fastapi/exceptions.py | 5 +++-- pyproject.toml | 3 ++- tests/test_extra_routes.py | 6 +++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/fastapi/exceptions.py b/fastapi/exceptions.py index f4a837bb4..fcb718748 100644 --- a/fastapi/exceptions.py +++ b/fastapi/exceptions.py @@ -12,8 +12,9 @@ class HTTPException(StarletteHTTPException): detail: Any = None, headers: Optional[Dict[str, Any]] = None, ) -> None: - super().__init__(status_code=status_code, detail=detail) - self.headers = headers + super().__init__( + status_code=status_code, detail=detail, headers=headers # type: ignore + ) RequestErrorModel: Type[BaseModel] = create_model("Request") diff --git a/pyproject.toml b/pyproject.toml index 1a2610740..fc803f8fc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,7 @@ classifiers = [ "Topic :: Internet :: WWW/HTTP", ] requires = [ - "starlette ==0.18.0", + "starlette==0.19.0", "pydantic >=1.6.2,!=1.7,!=1.7.1,!=1.7.2,!=1.7.3,!=1.8,!=1.8.1,<2.0.0", ] description-file = "README.md" @@ -140,6 +140,7 @@ filterwarnings = [ "error", # TODO: needed by asyncio in Python 3.9.7 https://bugs.python.org/issue45097, try to remove on 3.9.8 'ignore:The loop argument is deprecated since Python 3\.8, and scheduled for removal in Python 3\.10:DeprecationWarning:asyncio', + 'ignore:starlette.middleware.wsgi is deprecated and will be removed in a future release\..*:DeprecationWarning:starlette', # TODO: remove after dropping support for Python 3.6 'ignore:Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography and will be removed in a future release.:UserWarning:jose', ] diff --git a/tests/test_extra_routes.py b/tests/test_extra_routes.py index 8f95b7bc9..491ba61c6 100644 --- a/tests/test_extra_routes.py +++ b/tests/test_extra_routes.py @@ -32,12 +32,12 @@ def delete_item(item_id: str, item: Item): @app.head("/items/{item_id}") def head_item(item_id: str): - return JSONResponse(headers={"x-fastapi-item-id": item_id}) + return JSONResponse(None, headers={"x-fastapi-item-id": item_id}) @app.options("/items/{item_id}") def options_item(item_id: str): - return JSONResponse(headers={"x-fastapi-item-id": item_id}) + return JSONResponse(None, headers={"x-fastapi-item-id": item_id}) @app.patch("/items/{item_id}") @@ -47,7 +47,7 @@ def patch_item(item_id: str, item: Item): @app.trace("/items/{item_id}") def trace_item(item_id: str): - return JSONResponse(media_type="message/http") + return JSONResponse(None, media_type="message/http") client = TestClient(app) From ee4e27a94f5b3c8a5e5f64b27e3b9bb209c69f29 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 9 May 2022 18:07:21 +0000 Subject: [PATCH 014/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 3ffb956cd..e0b44f569 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* โฌ† Upgrade Starlette from 0.18.0 to 0.19.0. PR [#4488](https://github.com/tiangolo/fastapi/pull/4488) by [@Kludex](https://github.com/Kludex). ## 0.76.0 From 12342888d6122648f5862375a36560b38efe0a5d Mon Sep 17 00:00:00 2001 From: Jonas Mueller Date: Mon, 9 May 2022 20:16:02 +0200 Subject: [PATCH 015/168] =?UTF-8?q?=F0=9F=8C=90=20Update=20German=20transl?= =?UTF-8?q?ation=20for=20`docs/features.md`=20(#3905)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastiรกn Ramรญrez --- docs/de/docs/features.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/de/docs/features.md b/docs/de/docs/features.md index f56257e7e..a92a2bfeb 100644 --- a/docs/de/docs/features.md +++ b/docs/de/docs/features.md @@ -13,7 +13,7 @@ ### Automatische Dokumentation -Mit einer interaktiven API-Dokumentation und explorativen webbasierten Benutzerschnittstellen. Da FastAPI auf OpenAPI basiert, gibt es hierzu mehrere Optionen, wobei zwei standartmรครŸig vorhanden sind. +Mit einer interaktiven API-Dokumentation und explorativen webbasierten Benutzerschnittstellen. Da FastAPI auf OpenAPI basiert, gibt es hierzu mehrere Optionen, wobei zwei standardmรครŸig vorhanden sind. * Swagger UI, bietet interaktive Exploration: testen und rufen Sie ihre API direkt vom Webbrowser auf. @@ -97,9 +97,9 @@ Hierdurch werden Sie nie wieder einen falschen Schlรผsselnamen benutzen und spar ### Kompakt -FastAPI nutzt fรผr alles sensible **Standard-Einstellungen**, welche optional รผberall konfiguriert werden kรถnnen. Alle Parameter kรถnnen ganz genau an Ihre Bedรผrfnisse angepasst werden, sodass sie genau die API definieren kรถnnen, die sie brachen. +FastAPI nutzt fรผr alles sinnvolle **Standard-Einstellungen**, welche optional รผberall konfiguriert werden kรถnnen. Alle Parameter kรถnnen ganz genau an Ihre Bedรผrfnisse angepasst werden, sodass sie genau die API definieren kรถnnen, die sie brauchen. -Aber standartmรครŸig, **"funktioniert einfach"** alles. +Aber standardmรครŸig, **"funktioniert einfach"** alles. ### Validierung @@ -109,7 +109,7 @@ Aber standartmรครŸig, **"funktioniert einfach"** alles. * Zeichenketten (`str`), mit definierter minimaler und maximaler Lรคnge. * Zahlen (`int`, `float`) mit minimaler und maximaler GrรถรŸe, usw. -* Validierung fรผr ungewรถgnliche Typen, wie: +* Validierung fรผr ungewรถhnliche Typen, wie: * URL. * Email. * UUID. @@ -142,8 +142,8 @@ FastAPI enthรคlt ein extrem einfaches, aber extrem mรคchtiges Starlette. Das bedeutet, auch ihr eigner Starlett Quellcode funktioniert. +**FastAPI** ist vollkommen kompatibel (und basiert auf) Starlette. Das bedeutet, auch ihr eigener Starlette Quellcode funktioniert. -`FastAPI` ist eigentlich eine Unterklasse von `Starlette`. Wenn sie also bereits Starlette kennen oder benutzen, kรถnnen Sie das meiste Ihres Wissen direkt anwenden. +`FastAPI` ist eigentlich eine Unterklasse von `Starlette`. Wenn Sie also bereits Starlette kennen oder benutzen, kรถnnen Sie das meiste Ihres Wissens direkt anwenden. Mit **FastAPI** bekommen Sie viele von **Starlette**'s Funktionen (da FastAPI nur Starlette auf Steroiden ist): @@ -199,5 +199,5 @@ Mit **FastAPI** bekommen Sie alle Funktionen von **Pydantic** (da FastAPI fรผr d * Validierungen erlauben klare und einfache Datenschemadefinition, รผberprรผft und dokumentiert als JSON Schema. * Sie kรถnnen stark **verschachtelte JSON** Objekte haben und diese sind trotzdem validiert und annotiert. * **Erweiterbar**: - * Pydantic erlaubt die Definition von eigenen Datentypen oder sie kรถnnen die Validierung mit einer `validator` dekorierten Methode erweitern.. + * Pydantic erlaubt die Definition von eigenen Datentypen oder Sie kรถnnen die Validierung mit einer `validator` dekorierten Methode erweitern.. * 100% Testabdeckung. From 65ed4b5433d39bcea1c38e904509332f2c01b5d0 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 9 May 2022 18:16:44 +0000 Subject: [PATCH 016/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index e0b44f569..98ba7a8db 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐ŸŒ Update German translation for `docs/features.md`. PR [#3905](https://github.com/tiangolo/fastapi/pull/3905) by [@jomue](https://github.com/jomue). * โฌ† Upgrade Starlette from 0.18.0 to 0.19.0. PR [#4488](https://github.com/tiangolo/fastapi/pull/4488) by [@Kludex](https://github.com/Kludex). ## 0.76.0 From f4620c42cffe3ee57af0fdd35506dfb84dd84534 Mon Sep 17 00:00:00 2001 From: Luccas Mateus Date: Mon, 9 May 2022 15:19:49 -0300 Subject: [PATCH 017/168] =?UTF-8?q?=F0=9F=8C=90=20Add=20Portuguese=20trans?= =?UTF-8?q?lation=20of=20`tutorial/extra-data-types.md`=20(#4077)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Lorhan Sohaky <16273730+LorhanSohaky@users.noreply.github.com> Co-authored-by: Sebastiรกn Ramรญrez --- docs/pt/docs/tutorial/extra-data-types.md | 66 +++++++++++++++++++++++ docs/pt/mkdocs.yml | 1 + 2 files changed, 67 insertions(+) create mode 100644 docs/pt/docs/tutorial/extra-data-types.md diff --git a/docs/pt/docs/tutorial/extra-data-types.md b/docs/pt/docs/tutorial/extra-data-types.md new file mode 100644 index 000000000..e4b9913dc --- /dev/null +++ b/docs/pt/docs/tutorial/extra-data-types.md @@ -0,0 +1,66 @@ +# Tipos de dados extras + +Atรฉ agora, vocรช tem usado tipos de dados comuns, tais como: + +* `int` +* `float` +* `str` +* `bool` + +Mas vocรช tambรฉm pode usar tipos de dados mais complexos. + +E vocรช ainda terรก os mesmos recursos que viu atรฉ agora: + +* ร“timo suporte do editor. +* Conversรฃo de dados das requisiรงรตes recebidas. +* Conversรฃo de dados para os dados da resposta. +* Validaรงรฃo de dados. +* Anotaรงรฃo e documentaรงรฃo automรกticas. + +## Outros tipos de dados + +Aqui estรฃo alguns dos tipos de dados adicionais que vocรช pode usar: + +* `UUID`: + * Um "Identificador Universalmente รšnico" padrรฃo, comumente usado como ID em muitos bancos de dados e sistemas. + * Em requisiรงรตes e respostas serรก representado como uma `str`. +* `datetime.datetime`: + * O `datetime.datetime` do Python. + * Em requisiรงรตes e respostas serรก representado como uma `str` no formato ISO 8601, exemplo: `2008-09-15T15:53:00+05:00`. +* `datetime.date`: + * O `datetime.date` do Python. + * Em requisiรงรตes e respostas serรก representado como uma `str` no formato ISO 8601, exemplo: `2008-09-15`. +* `datetime.time`: + * O `datetime.time` do Python. + * Em requisiรงรตes e respostas serรก representado como uma `str` no formato ISO 8601, exemplo: `14:23:55.003`. +* `datetime.timedelta`: + * O `datetime.timedelta` do Python. + * Em requisiรงรตes e respostas serรก representado como um `float` de segundos totais. + * O Pydantic tambรฉm permite representรก-lo como uma "codificaรงรฃo ISO 8601 diferenรงa de tempo", cheque a documentaรงรฃo para mais informaรงรตes. +* `frozenset`: + * Em requisiรงรตes e respostas, serรก tratado da mesma forma que um `set`: + * Nas requisiรงรตes, uma lista serรก lida, eliminando duplicadas e convertendo-a em um `set`. + * Nas respostas, o `set` serรก convertido para uma `list`. + * O esquema gerado vai especificar que os valores do `set` sรฃo unicos (usando o `uniqueItems` do JSON Schema). +* `bytes`: + * O `bytes` padrรฃo do Python. + * Em requisiรงรตes e respostas serรก representado como uma `str`. + * O esquema gerado vai especificar que รฉ uma `str` com o "formato" `binary`. +* `Decimal`: + * O `Decimal` padrรฃo do Python. + * Em requisiรงรตes e respostas serรก representado como um `float`. +* Vocรช pode checar todos os tipos de dados vรกlidos do Pydantic aqui: Tipos de dados do Pydantic. + +## Exemplo + +Aqui estรก um exemplo de *operaรงรฃo de rota* com parรขmetros utilizando-se de alguns dos tipos acima. + +```Python hl_lines="1 3 12-16" +{!../../../docs_src/extra_data_types/tutorial001.py!} +``` + +Note que os parรขmetros dentro da funรงรฃo tem seu tipo de dados natural, e vocรช pode, por exemplo, realizar manipulaรงรตes normais de data, como: + +```Python hl_lines="18-19" +{!../../../docs_src/extra_data_types/tutorial001.py!} +``` diff --git a/docs/pt/mkdocs.yml b/docs/pt/mkdocs.yml index 4861602e4..29dafa496 100644 --- a/docs/pt/mkdocs.yml +++ b/docs/pt/mkdocs.yml @@ -61,6 +61,7 @@ nav: - tutorial/first-steps.md - tutorial/path-params.md - tutorial/body-fields.md + - tutorial/extra-data-types.md - tutorial/query-params-str-validations.md - Seguranรงa: - tutorial/security/index.md From 260d97ec6f97293c7bc0590209693534f87d6193 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 9 May 2022 18:20:27 +0000 Subject: [PATCH 018/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 98ba7a8db..9812de2e3 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐ŸŒ Add Portuguese translation of `tutorial/extra-data-types.md`. PR [#4077](https://github.com/tiangolo/fastapi/pull/4077) by [@luccasmmg](https://github.com/luccasmmg). * ๐ŸŒ Update German translation for `docs/features.md`. PR [#3905](https://github.com/tiangolo/fastapi/pull/3905) by [@jomue](https://github.com/jomue). * โฌ† Upgrade Starlette from 0.18.0 to 0.19.0. PR [#4488](https://github.com/tiangolo/fastapi/pull/4488) by [@Kludex](https://github.com/Kludex). From 3005c8c7b918c8985a5e5328cd62189aad303444 Mon Sep 17 00:00:00 2001 From: Leandro de Souza <85115541+leandrodesouzadev@users.noreply.github.com> Date: Mon, 9 May 2022 15:25:41 -0300 Subject: [PATCH 019/168] =?UTF-8?q?=F0=9F=8C=90=20Add=20Portuguese=20trans?= =?UTF-8?q?lation=20for=20`docs/tutorial/body.md`=20(#3960)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Marcelo Trylesinski Co-authored-by: Lucas <61513630+lsglucas@users.noreply.github.com> Co-authored-by: Leandro de Souza Co-authored-by: Sebastiรกn Ramรญrez --- docs/pt/docs/tutorial/body.md | 165 ++++++++++++++++++++++++++++++++++ docs/pt/mkdocs.yml | 1 + 2 files changed, 166 insertions(+) create mode 100644 docs/pt/docs/tutorial/body.md diff --git a/docs/pt/docs/tutorial/body.md b/docs/pt/docs/tutorial/body.md new file mode 100644 index 000000000..5891185f3 --- /dev/null +++ b/docs/pt/docs/tutorial/body.md @@ -0,0 +1,165 @@ +# Corpo da Requisiรงรฃo + +Quando vocรช precisa enviar dados de um cliente (como de um navegador web) para sua API, vocรช o envia como um **corpo da requisiรงรฃo**. + +O corpo da **requisiรงรฃo** รฉ a informaรงรฃo enviada pelo cliente para sua API. O corpo da **resposta** รฉ a informaรงรฃo que sua API envia para o cliente. + +Sua API quase sempre irรก enviar um corpo na **resposta**. Mas os clientes nรฃo necessariamente precisam enviar um corpo em toda **requisiรงรฃo**. + +Para declarar um corpo da **requisiรงรฃo**, vocรช utiliza os modelos do Pydantic com todos os seus poderes e benefรญcios. + +!!! info "Informaรงรฃo" + Para enviar dados, vocรช deve usar utilizar um dos mรฉtodos: `POST` (Mais comum), `PUT`, `DELETE` ou `PATCH`. + + Enviar um corpo em uma requisiรงรฃo `GET` nรฃo tem um comportamento definido nas especificaรงรตes, porรฉm รฉ suportado pelo FastAPI, apenas para casos de uso bem complexos/extremos. + + Como รฉ desencorajado, a documentaรงรฃo interativa com Swagger UI nรฃo irรก mostrar a documentaรงรฃo para o corpo da requisiรงรฃo para um `GET`, e proxies que intermediarem podem nรฃo suportar o corpo da requisiรงรฃo. + +## Importe o `BaseModel` do Pydantic + +Primeiro, vocรช precisa importar `BaseModel` do `pydantic`: + +```Python hl_lines="4" +{!../../../docs_src/body/tutorial001.py!} +``` + +## Crie seu modelo de dados + +Entรฃo vocรช declara seu modelo de dados como uma classe que herda `BaseModel`. + +Utilize os tipos Python padrรฃo para todos os atributos: + +```Python hl_lines="7-11" +{!../../../docs_src/body/tutorial001.py!} +``` + +Assim como quando declaramos parรขmetros de consulta, quando um atributo do modelo possui um valor padrรฃo, ele se torna opcional. Caso contrรกrio, se torna obrigatรณrio. Use `None` para tornรก-lo opcional. + +Por exemplo, o modelo acima declara um JSON "`object`" (ou `dict` no Python) como esse: + +```JSON +{ + "name": "Foo", + "description": "Uma descriรงรฃo opcional", + "price": 45.2, + "tax": 3.5 +} +``` + +...como `description` e `tax` sรฃo opcionais (Com um valor padrรฃo de `None`), esse JSON "`object`" tambรฉm รฉ vรกlido: + +```JSON +{ + "name": "Foo", + "price": 45.2 +} +``` + +## Declare como um parรขmetro + +Para adicionar o corpo na *funรงรฃo de operaรงรฃo de rota*, declare-o da mesma maneira que vocรช declarou parรขmetros de rota e consulta: + +```Python hl_lines="18" +{!../../../docs_src/body/tutorial001.py!} +``` + +...E declare o tipo como o modelo que vocรช criou, `Item`. + +## Resultados + +Apenas com esse declaraรงรฃo de tipos do Python, o **FastAPI** irรก: + +* Ler o corpo da requisiรงรฃo como um JSON. +* Converter os tipos correspondentes (se necessรกrio). +* Validar os dados. + * Se algum dados for invรกlido, irรก retornar um erro bem claro, indicando exatamente onde e o que estรก incorreto. +* Entregar a vocรช a informaรงรฃo recebida no parรขmetro `item`. + * Como vocรช o declarou na funรงรฃo como do tipo `Item`, vocรช tambรฉm terรก o suporte do editor (completaรงรฃo, etc) para todos os atributos e seus tipos. +* Gerar um Esquema JSON com as definiรงรตes do seu modelo, vocรช tambรฉm pode utilizรก-lo em qualquer lugar que quiser, se fizer sentido para seu projeto. +* Esses esquemas farรฃo parte do esquema OpenAPI, e utilizados nas UIs de documentaรงรฃo automรกtica. + +## Documentaรงรฃo automรกtica + +Os esquemas JSON dos seus modelos farรฃo parte do esquema OpenAPI gerado para sua aplicaรงรฃo, e aparecerรฃo na documentaรงรฃo interativa da API: + + + +E tambรฉm serรฃo utilizados em cada *funรงรฃo de operaรงรฃo de rota* que utilizรก-los: + + + +## Suporte do editor de texto: + +No seu editor de texto, dentro da funรงรฃo vocรช receberรก dicas de tipos e completaรงรฃo em todo lugar (isso nรฃo aconteceria se vocรช recebesse um `dict` em vez de um modelo Pydantic): + + + +Vocรช tambรฉm poderรก receber verificaรงรตes de erros para operaรงรตes de tipos incorretas: + + + +Isso nรฃo รฉ por acaso, todo o framework foi construรญdo em volta deste design. + +E foi imensamente testado na fase de design, antes de qualquer implementaรงรฃo, para garantir que funcionaria para todos os editores de texto. + +Houveram mudanรงas no prรณprio Pydantic para que isso fosse possรญvel. + +As capturas de tela anteriores foram capturas no Visual Studio Code. + +Mas vocรช terรก o mesmo suporte do editor no PyCharm e na maioria dos editores Python: + + + +!!! tip "Dica" + Se vocรช utiliza o PyCharm como editor, vocรช pode utilizar o Plugin do Pydantic para o PyCharm . + + Melhora o suporte do editor para seus modelos Pydantic com:: + + * completaรงรฃo automรกtica + * verificaรงรฃo de tipos + * refatoraรงรฃo + * buscas + * inspeรงรตes + +## Use o modelo + +Dentro da funรงรฃo, vocรช pode acessar todos os atributos do objeto do modelo diretamente: + +```Python hl_lines="21" +{!../../../docs_src/body/tutorial002.py!} +``` + +## Corpo da requisiรงรฃo + parรขmetros de rota + +Vocรช pode declarar parรขmetros de rota e corpo da requisiรงรฃo ao mesmo tempo. + +O **FastAPI** irรก reconhecer que os parรขmetros da funรงรฃo que combinam com parรขmetros de rota devem ser **retirados da rota**, e parรขmetros da funรงรฃo que sรฃo declarados como modelos Pydantic sejam **retirados do corpo da requisiรงรฃo**. + +```Python hl_lines="17-18" +{!../../../docs_src/body/tutorial003.py!} +``` + +## Corpo da requisiรงรฃo + parรขmetros de rota + parรขmetros de consulta + +Vocรช tambรฉm pode declarar parรขmetros de **corpo**, **rota** e **consulta**, ao mesmo tempo. + +O **FastAPI** irรก reconhecer cada um deles e retirar a informaรงรฃo do local correto. + +```Python hl_lines="18" +{!../../../docs_src/body/tutorial004.py!} +``` + +Os parรขmetros da funรงรฃo serรฃo reconhecidos conforme abaixo: + +* Se o parรขmetro tambรฉm รฉ declarado na **rota**, serรก utilizado como um parรขmetro de rota. +* Se o parรขmetro รฉ de um **tipo รบnico** (como `int`, `float`, `str`, `bool`, etc) serรก interpretado como um parรขmetro de **consulta**. +* Se o parรขmetro รฉ declarado como um **modelo Pydantic**, serรก interpretado como o **corpo** da requisiรงรฃo. + +!!! note "Observaรงรฃo" + O FastAPI saberรก que o valor de `q` nรฃo รฉ obrigatรณrio por causa do valor padrรฃo `= None`. + + O `Optional` em `Optional[str]` nรฃo รฉ utilizado pelo FastAPI, mas permite ao seu editor de texto lhe dar um suporte melhor e detectar erros. + +## Sem o Pydantic + +Se vocรช nรฃo quer utilizar os modelos Pydantic, vocรช tambรฉm pode utilizar o parรขmetro **Body**. Veja a documentaรงรฃo para [Body - Parรขmetros mรบltiplos: Valores singulares no body](body-multiple-params.md#singular-values-in-body){.internal-link target=_blank}. diff --git a/docs/pt/mkdocs.yml b/docs/pt/mkdocs.yml index 29dafa496..f6bcdcf02 100644 --- a/docs/pt/mkdocs.yml +++ b/docs/pt/mkdocs.yml @@ -60,6 +60,7 @@ nav: - tutorial/index.md - tutorial/first-steps.md - tutorial/path-params.md + - tutorial/body.md - tutorial/body-fields.md - tutorial/extra-data-types.md - tutorial/query-params-str-validations.md From b7d57467733805e004e8315ed56a910ec192e9ee Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 9 May 2022 18:26:23 +0000 Subject: [PATCH 020/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 9812de2e3..3c706ce5c 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐ŸŒ Add Portuguese translation for `docs/tutorial/body.md`. PR [#3960](https://github.com/tiangolo/fastapi/pull/3960) by [@leandrodesouzadev](https://github.com/leandrodesouzadev). * ๐ŸŒ Add Portuguese translation of `tutorial/extra-data-types.md`. PR [#4077](https://github.com/tiangolo/fastapi/pull/4077) by [@luccasmmg](https://github.com/luccasmmg). * ๐ŸŒ Update German translation for `docs/features.md`. PR [#3905](https://github.com/tiangolo/fastapi/pull/3905) by [@jomue](https://github.com/jomue). * โฌ† Upgrade Starlette from 0.18.0 to 0.19.0. PR [#4488](https://github.com/tiangolo/fastapi/pull/4488) by [@Kludex](https://github.com/Kludex). From e0962d0b54e401287ba69e6d1570b9b7ea302e33 Mon Sep 17 00:00:00 2001 From: Makarov Andrey Date: Mon, 9 May 2022 21:30:19 +0300 Subject: [PATCH 021/168] =?UTF-8?q?=F0=9F=8C=90=20Add=20Russian=20translat?= =?UTF-8?q?ion=20for=20`docs/async.md`=20(#4036)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastiรกn Ramรญrez --- docs/ru/docs/async.md | 505 ++++++++++++++++++++++++++++++++++++++++++ docs/ru/mkdocs.yml | 1 + 2 files changed, 506 insertions(+) create mode 100644 docs/ru/docs/async.md diff --git a/docs/ru/docs/async.md b/docs/ru/docs/async.md new file mode 100644 index 000000000..fc5e44471 --- /dev/null +++ b/docs/ru/docs/async.md @@ -0,0 +1,505 @@ +# ะšะพะฝะบัƒั€ะตะฝั‚ะฝะพัั‚ัŒ ะธ async / await + +ะ—ะดะตััŒ ะฟั€ะธะฒะตะดะตะฝะฐ ะฟะพะดั€ะพะฑะฝะฐั ะธะฝั„ะพั€ะผะฐั†ะธั ะพะฑ ะธัะฟะพะปัŒะทะพะฒะฐะฝะธะธ ัะธะฝั‚ะฐะบัะธัะฐ `async def` ะฟั€ะธ ะฝะฐะฟะธัะฐะฝะธะธ *ั„ัƒะฝะบั†ะธะน ะพะฑั€ะฐะฑะพั‚ะบะธ ะฟัƒั‚ะธ*, ะฐ ั‚ะฐะบะถะต ั€ะฐััะผะพั‚ั€ะตะฝั‹ ะพัะฝะพะฒั‹ ะฐัะธะฝั…ั€ะพะฝะฝะพะณะพ ะฟั€ะพะณั€ะฐะผะผะธั€ะพะฒะฐะฝะธั, ะบะพะฝะบัƒั€ะตะฝั‚ะฝะพัั‚ะธ ะธ ะฟะฐั€ะฐะปะปะตะปะธะทะผะฐ. + +## ะะตั‚ ะฒั€ะตะผะตะฝะธ? + +TL;DR: + +ะ”ะพะฟัƒัั‚ะธะผ, ะฒั‹ ะธัะฟะพะปัŒะทัƒะตั‚ะต ัั‚ะพั€ะพะฝัŽัŽ ะฑะธะฑะปะธะพั‚ะตะบัƒ, ะบะพั‚ะพั€ะฐั ั‚ั€ะตะฑัƒะตั‚ ะฒั‹ะทะพะฒะฐ ั ะบะปัŽั‡ะตะฒั‹ะผ ัะปะพะฒะพะผ `await`: + +```Python +results = await some_library() +``` + +ะ’ ัั‚ะพะผ ัะปัƒั‡ะฐะต *ั„ัƒะฝะบั†ะธะธ ะพะฑั€ะฐะฑะพั‚ะบะธ ะฟัƒั‚ะธ* ะฝะตะพะฑั…ะพะดะธะผะพ ะพะฑัŠัะฒะปัั‚ัŒ ั ะธัะฟะพะปัŒะทะพะฒะฐะฝะธะตะผ ัะธะฝั‚ะฐะบัะธัะฐ `async def`: + +```Python hl_lines="2" +@app.get('/') +async def read_results(): + results = await some_library() + return results +``` + +!!! note + `await` ะผะพะถะฝะพ ะธัะฟะพะปัŒะทะพะฒะฐั‚ัŒ ั‚ะพะปัŒะบะพ ะฒะฝัƒั‚ั€ะธ ั„ัƒะฝะบั†ะธะน, ะพะฑัŠัะฒะปะตะฝะฝั‹ั… ั ะธัะฟะพะปัŒะทะพะฒะฐะฝะธะตะผ `async def`. + +--- + +ะ•ัะปะธ ะฒั‹ ะพะฑั€ะฐั‰ะฐะตั‚ะตััŒ ะบ ัั‚ะพั€ะพะฝะฝะตะน ะฑะธะฑะปะธะพั‚ะตะบะต, ะบะพั‚ะพั€ะฐั ั ั‡ะตะผ-ั‚ะพ ะฒะทะฐะธะผะพะดะตะนัั‚ะฒัƒะตั‚ +(ั ะฑะฐะทะพะน ะดะฐะฝะฝั‹ั…, API, ั„ะฐะนะปะพะฒะพะน ัะธัั‚ะตะผะพะน ะธ ั‚. ะด.), ะธ ะฝะต ะธะผะตะตั‚ ะฟะพะดะดะตั€ะถะบะธ ัะธะฝั‚ะฐะบัะธัะฐ `await` +(ั‡ั‚ะพ ะพั‚ะฝะพัะธั‚ัั ัะตะนั‡ะฐั ะบ ะฑะพะปัŒัˆะธะฝัั‚ะฒัƒ ะฑะธะฑะปะธะพั‚ะตะบ ะดะปั ั€ะฐะฑะพั‚ั‹ ั ะฑะฐะทะฐะผะธ ะดะฐะฝะฝั‹ั…), ั‚ะพ +ะพะฑัŠัะฒะปัะนั‚ะต *ั„ัƒะฝะบั†ะธะธ ะพะฑั€ะฐะฑะพั‚ะบะธ ะฟัƒั‚ะธ* ะพะฑั‹ั‡ะฝั‹ะผ ะพะฑั€ะฐะทะพะผ ั ะฟะพะผะพั‰ัŒัŽ `def`, ะฝะฐะฟั€ะธะผะตั€: + +```Python hl_lines="2" +@app.get('/') +def results(): + results = some_library() + return results +``` + +--- + +ะ•ัะปะธ ะฒะฐัˆะตะผัƒ ะฟั€ะธะปะพะถะตะฝะธัŽ (ัั‚ั€ะฐะฝะฝั‹ะผ ะพะฑั€ะฐะทะพะผ) ะฝะต ะฝัƒะถะฝะพ ะฝะธ ั ั‡ะตะผ ะฒะทะฐะธะผะพะดะตะนัั‚ะฒะพะฒะฐั‚ัŒ ะธ, ัะพะพั‚ะฒะตั‚ัั‚ะฒะตะฝะฝะพ, +ะพะถะธะดะฐั‚ัŒ ะพั‚ะฒะตั‚ะฐ, ะธัะฟะพะปัŒะทัƒะนั‚ะต `async def`. + +--- + +ะ•ัะปะธ ะฒั‹ ะฝะต ัƒะฒะตั€ะตะฝั‹, ะธัะฟะพะปัŒะทัƒะนั‚ะต ะพะฑั‹ั‡ะฝั‹ะน ัะธะฝั‚ะฐะบัะธั `def`. + +--- + +**ะŸั€ะธะผะตั‡ะฐะฝะธะต**: ะฟั€ะธ ะฝะตะพะฑั…ะพะดะธะผะพัั‚ะธ ะผะพะถะฝะพ ัะผะตัˆะธะฒะฐั‚ัŒ `def` ะธ `async def` ะฒ *ั„ัƒะฝะบั†ะธัั… ะพะฑั€ะฐะฑะพั‚ะบะธ ะฟัƒั‚ะธ* +ะธ ะธัะฟะพะปัŒะทะพะฒะฐั‚ัŒ ะฒ ะบะฐะถะดะพะผ ัะปัƒั‡ะฐะต ะฝะฐะธะฑะพะปะตะต ะฟะพะดั…ะพะดัั‰ะธะน ัะธะฝั‚ะฐะบัะธั. ะ FastAPI ัะดะตะปะฐะตั‚ ั ัั‚ะธะผ ะฒัั‘, ั‡ั‚ะพ ะฝัƒะถะฝะพ. + +ะ’ ะปัŽะฑะพะผ ะธะท ะพะฟะธัะฐะฝะฝั‹ั… ัะปัƒั‡ะฐะตะฒ FastAPI ั€ะฐะฑะพั‚ะฐะตั‚ ะฐัะธะฝั…ั€ะพะฝะฝะพ ะธ ะพั‡ะตะฝัŒ ะฑั‹ัั‚ั€ะพ. + +ะžะดะฝะฐะบะพ ะฟั€ะธะดะตั€ะถะธะฒะฐัััŒ ัƒะบะฐะทะฐะฝะฝั‹ั… ัะพะฒะตั‚ะพะฒ, ะผะพะถะฝะพ ะฟะพะปัƒั‡ะธั‚ัŒ ะดะพะฟะพะปะฝะธั‚ะตะปัŒะฝัƒัŽ ะพะฟั‚ะธะผะธะทะฐั†ะธัŽ ะฟั€ะพะธะทะฒะพะดะธั‚ะตะปัŒะฝะพัั‚ะธ. + +## ะขะตั…ะฝะธั‡ะตัะบะธะต ะฟะพะดั€ะพะฑะฝะพัั‚ะธ + +ะกะพะฒั€ะตะผะตะฝะฝั‹ะต ะฒะตั€ัะธะธ Python ะฟะพะดะดะตั€ะถะธะฒะฐัŽั‚ ั€ะฐะทั€ะฐะฑะพั‚ะบัƒ ั‚ะฐะบ ะฝะฐะทั‹ะฒะฐะตะผะพะณะพ **"ะฐัะธะฝั…ั€ะพะฝะฝะพะณะพ ะบะพะดะฐ"** ะฟะพัั€ะตะดัั‚ะฒะพะผ ะฝะฐะฟะธัะฐะฝะธั **"ัะพะฟั€ะพะณั€ะฐะผะผ"** ั ะธัะฟะพะปัŒะทะพะฒะฐะฝะธะตะผ ัะธะฝั‚ะฐะบัะธัะฐ **`async` ะธ `await`**. + +ะะธะถะต ั€ะฐะทะฑะตั€ั‘ะผ ัั‚ัƒ ั„ั€ะฐะทัƒ ะฟะพ ั‡ะฐัั‚ัะผ: + +* **ะัะธะฝั…ั€ะพะฝะฝั‹ะน ะบะพะด** +* **`async` ะธ `await`** +* **ะกะพะฟั€ะพะณั€ะฐะผะผั‹** + +## ะัะธะฝั…ั€ะพะฝะฝั‹ะน ะบะพะด + +ะัะธะฝั…ั€ะพะฝะฝั‹ะน ะบะพะด ะพะทะฝะฐั‡ะฐะตั‚, ั‡ั‚ะพ ะฒ ัะทั‹ะบะต ๐Ÿ’ฌ ะตัั‚ัŒ ะฒะพะทะผะพะถะฝะพัั‚ัŒ ัะพะพะฑั‰ะธั‚ัŒ ะผะฐัˆะธะฝะต / ะฟั€ะพะณั€ะฐะผะผะต ๐Ÿค–, +ั‡ั‚ะพ ะฒ ะพะฟั€ะตะดะตะปั‘ะฝะฝะพะน ั‚ะพั‡ะบะต ะบะพะดะฐ ะตะน ๐Ÿค– ะฝัƒะถะฝะพ ะฑัƒะดะตั‚ ะพะถะธะดะฐั‚ัŒ ะทะฐะฒะตั€ัˆะตะฝะธั ะฒั‹ะฟะพะปะฝะตะฝะธั *ั‡ะตะณะพ-ั‚ะพ ะตั‰ั‘* ะฒ ะดั€ัƒะณะพะผ ะผะตัั‚ะต. ะ”ะพะฟัƒัั‚ะธะผ ัั‚ะพ *ั‡ั‚ะพ-ั‚ะพ ะตั‰ั‘* ะฝะฐะทั‹ะฒะฐะตั‚ัั "ะผะตะดะปะตะฝะฝั‹ะน ั„ะฐะนะป" ๐Ÿ“. + +ะ˜ ะฟะพะบะฐ ะผั‹ ะถะดั‘ะผ ะทะฐะฒะตั€ัˆะตะฝะธั ั€ะฐะฑะพั‚ั‹ ั "ะผะตะดะปะตะฝะฝั‹ะผ ั„ะฐะนะปะพะผ" ๐Ÿ“, ะบะพะผะฟัŒัŽั‚ะตั€ ะผะพะถะตั‚ ะฟะตั€ะตะบะปัŽั‡ะธั‚ัŒัั ะดะปั ะฒั‹ะฟะพะปะฝะตะฝะธั ะดั€ัƒะณะธั… ะทะฐะดะฐั‡. + +ะะพ ะฟั€ะธ ะบะฐะถะดะพะน ะฒะพะทะผะพะถะฝะพัั‚ะธ ะบะพะผะฟัŒัŽั‚ะตั€ / ะฟั€ะพะณั€ะฐะผะผะฐ ๐Ÿค– ะฑัƒะดะตั‚ ะฒะพะทะฒั€ะฐั‰ะฐั‚ัŒัั ะพะฑั€ะฐั‚ะฝะพ. ะะฐะฟั€ะธะผะตั€, ะตัะปะธ ะพะฝ ๐Ÿค– ะพะฟัั‚ัŒ ะพะบะฐะถะตั‚ัั ะฒ ั€ะตะถะธะผะต ะพะถะธะดะฐะฝะธั, ะธะปะธ ะบะพะณะดะฐ ะทะฐะบะพะฝั‡ะธั‚ ะฒััŽ ั€ะฐะฑะพั‚ัƒ. ะ’ ัั‚ะพะผ ัะปัƒั‡ะฐะต ะบะพะผะฟัŒัŽั‚ะตั€ ๐Ÿค– ะฟั€ะพะฒะตั€ัะตั‚, ะฝะต ะทะฐะฒะตั€ัˆะตะฝะฐ ะปะธ ะบะฐะบะฐั-ะฝะธะฑัƒะดัŒ ะธะท ั‚ะตะบัƒั‰ะธั… ะทะฐะดะฐั‡. + +ะŸะพั‚ะพะผ ะพะฝ ๐Ÿค– ะฑะตั€ั‘ั‚ ะฟะตั€ะฒัƒัŽ ะฒั‹ะฟะพะปะฝะตะฝะฝัƒัŽ ะทะฐะดะฐั‡ัƒ (ะดะพะฟัƒัั‚ะธะผ, ะฝะฐัˆ "ะผะตะดะปะตะฝะฝั‹ะน ั„ะฐะนะป" ๐Ÿ“) ะธ ะฟั€ะพะดะพะปะถะฐะตั‚ ั€ะฐะฑะพั‚ัƒ, ะฟั€ะพะธะทะฒะพะดั ั ะฝะตะน ะฝะตะพะฑั…ะพะดะธะผั‹ะต ะดะตะนัั‚ะฒะธั. + +ะ’ั‹ัˆะตัƒะฟะพะผัะฝัƒั‚ะพะต "ั‡ั‚ะพ-ั‚ะพ ะตั‰ั‘", ะทะฐะฒะตั€ัˆะตะฝะธั ะบะพั‚ะพั€ะพะณะพ ะฟั€ะธั…ะพะดะธั‚ัั ะพะถะธะดะฐั‚ัŒ, ะพะฑั‹ั‡ะฝะพ ะพั‚ะฝะพัะธั‚ัั ะบ ะดะพัั‚ะฐั‚ะพั‡ะฝะพ "ะผะตะดะปะตะฝะฝั‹ะผ" ะพะฟะตั€ะฐั†ะธัะผ I/O (ะฟะพ ัั€ะฐะฒะฝะตะฝะธัŽ ัะพ ัะบะพั€ะพัั‚ัŒัŽ ั€ะฐะฑะพั‚ั‹ ะฟั€ะพั†ะตััะพั€ะฐ ะธ ะพะฟะตั€ะฐั‚ะธะฒะฝะพะน ะฟะฐะผัั‚ะธ), ะฝะฐะฟั€ะธะผะตั€: + +* ะพั‚ะฟั€ะฐะฒะบะฐ ะดะฐะฝะฝั‹ั… ะพั‚ ะบะปะธะตะฝั‚ะฐ ะฟะพ ัะตั‚ะธ +* ะฟะพะปัƒั‡ะตะฝะธะต ะบะปะธะตะฝั‚ะพะผ ะดะฐะฝะฝั‹ั…, ะพั‚ะฟั€ะฐะฒะปะตะฝะฝั‹ั… ะฒะฐัˆะตะน ะฟั€ะพะณั€ะฐะผะผะพะน ะฟะพ ัะตั‚ะธ +* ั‡ั‚ะตะฝะธะต ัะธัั‚ะตะผะพะน ัะพะดะตั€ะถะธะผะพะณะพ ั„ะฐะนะปะฐ ั ะดะธัะบะฐ ะธ ะฟะตั€ะตะดะฐั‡ะฐ ัั‚ะธั… ะดะฐะฝะฝั‹ั… ะฟั€ะพะณั€ะฐะผะผะต +* ะทะฐะฟะธััŒ ะฝะฐ ะดะธัะบ ะดะฐะฝะฝั‹ั…, ะบะพั‚ะพั€ั‹ะต ะฟั€ะพะณั€ะฐะผะผะฐ ะฟะตั€ะตะดะฐะปะฐ ัะธัั‚ะตะผะต +* ะพะฑั€ะฐั‰ะตะฝะธะต ะบ ัƒะดะฐะปั‘ะฝะฝะพะผัƒ API +* ะพะถะธะดะฐะฝะธะต ะทะฐะฒะตั€ัˆะตะฝะธั ะพะฟะตั€ะฐั†ะธะธ ั ะฑะฐะทะพะน ะดะฐะฝะฝั‹ั… +* ะฟะพะปัƒั‡ะตะฝะธะต ั€ะตะทัƒะปัŒั‚ะฐั‚ะพะฒ ะทะฐะฟั€ะพัะฐ ะบ ะฑะฐะทะต ะดะฐะฝะฝั‹ั… +* ะธ ั‚. ะด. + +ะŸะพัะบะพะปัŒะบัƒ ะฒ ะพัะฝะพะฒะฝะพะผ ะฒั€ะตะผั ั‚ั€ะฐั‚ะธั‚ัั ะฝะฐ ะพะถะธะดะฐะฝะธะต ะฒั‹ะฟะพะปะฝะตะฝะธั ะพะฟะตั€ะฐั†ะธะน I/O, +ะธั… ะพะฑั‹ั‡ะฝะพ ะฝะฐะทั‹ะฒะฐัŽั‚ ะพะฟะตั€ะฐั†ะธัะผะธ, ะพะณั€ะฐะฝะธั‡ะตะฝะฝั‹ะผะธ ัะบะพั€ะพัั‚ัŒัŽ ะฒะฒะพะดะฐ-ะฒั‹ะฒะพะดะฐ. + +ะšะพะด ะฝะฐะทั‹ะฒะฐัŽั‚ "ะฐัะธะฝั…ั€ะพะฝะฝั‹ะผ", ะฟะพั‚ะพะผัƒ ั‡ั‚ะพ ะบะพะผะฟัŒัŽั‚ะตั€ัƒ / ะฟั€ะพะณั€ะฐะผะผะต ะฝะต ั‚ั€ะตะฑัƒะตั‚ัั "ัะธะฝั…ั€ะพะฝะธะทะธั€ะพะฒะฐั‚ัŒัั" ั ะผะตะดะปะตะฝะฝะพะน ะทะฐะดะฐั‡ะตะน ะธ, +ะฑัƒะดัƒั‡ะธ ะฒ ะฟั€ะพัั‚ะพะต, ะพะถะธะดะฐั‚ัŒ ะผะพะผะตะฝั‚ะฐ ะตั‘ ะทะฐะฒะตั€ัˆะตะฝะธั, ั ั‚ะตะผ ั‡ั‚ะพะฑั‹ ะทะฐะฑั€ะฐั‚ัŒ ั€ะตะทัƒะปัŒั‚ะฐั‚ ะธ ะฟั€ะพะดะพะปะถะธั‚ัŒ ั€ะฐะฑะพั‚ัƒ. + +ะ’ะผะตัั‚ะพ ัั‚ะพะณะพ ะฒ "ะฐัะธะฝั…ั€ะพะฝะฝะพะน" ัะธัั‚ะตะผะต ะทะฐะฒะตั€ัˆั‘ะฝะฝะฐั ะทะฐะดะฐั‡ะฐ ะผะพะถะตั‚ ะฝะตะผะฝะพะณะพ ะฟะพะดะพะถะดะฐั‚ัŒ (ะฑัƒะบะฒะฐะปัŒะฝะพ ะฝะตัะบะพะปัŒะบะพ ะผะธะบั€ะพัะตะบัƒะฝะด), +ะฟะพะบะฐ ะบะพะผะฟัŒัŽั‚ะตั€ / ะฟั€ะพะณั€ะฐะผะผะฐ ะทะฐะฝะธะผะฐะตั‚ัั ะดั€ัƒะณะธะผะธ ะฒะฐะถะฝั‹ะผะธ ะฒะตั‰ะฐะผะธ, ั ั‚ะตะผ ั‡ั‚ะพะฑั‹ ะฟะพั‚ะพะผ ะฒะตั€ะฝัƒั‚ัŒัั, +ะทะฐะฑั€ะฐั‚ัŒ ั€ะตะทัƒะปัŒั‚ะฐั‚ั‹ ะฒั‹ะฟะพะปะฝะตะฝะธั ะธ ะฝะฐั‡ะฐั‚ัŒ ะธั… ะพะฑั€ะฐะฑะฐั‚ั‹ะฒะฐั‚ัŒ. + +"ะกะธะฝั…ั€ะพะฝะฝะพะต" ะธัะฟะพะปะฝะตะฝะธะต (ะฒ ะฟั€ะพั‚ะธะฒะพะฒะตั "ะฐัะธะฝั…ั€ะพะฝะฝะพะผัƒ") ั‚ะฐะบะถะต ะฝะฐะทั‹ะฒะฐัŽั‚ "ะฟะพัะปะตะดะพะฒะฐั‚ะตะปัŒะฝั‹ะผ", +ะฟะพั‚ะพะผัƒ ั‡ั‚ะพ ะบะพะผะฟัŒัŽั‚ะตั€ / ะฟั€ะพะณั€ะฐะผะผะฐ ะฟะพัะปะตะดะพะฒะฐั‚ะตะปัŒะฝะพ ะฒั‹ะฟะพะปะฝัะตั‚ ะฒัะต ั‚ั€ะตะฑัƒะตะผั‹ะต ัˆะฐะณะธ ะฟะตั€ะตะด ั‚ะตะผ, ะบะฐะบ ะฟะตั€ะตะนั‚ะธ ะบ ัะปะตะดัƒัŽั‰ะตะน ะทะฐะดะฐั‡ะต, +ะดะฐะถะต ะตัะปะธ ะฒ ะฟั€ะพั†ะตััะต ะฟั€ะธั…ะพะดะธั‚ัั ะถะดะฐั‚ัŒ. + +### ะšะพะฝะบัƒั€ะตะฝั‚ะฝะพัั‚ัŒ ะธ ะฑัƒั€ะณะตั€ั‹ + +ะขะพั‚ **ะฐัะธะฝั…ั€ะพะฝะฝั‹ะน** ะบะพะด, ะพ ะบะพั‚ะพั€ะพะผ ะธะดั‘ั‚ ั€ะตั‡ัŒ ะฒั‹ัˆะต, ะธะฝะพะณะดะฐ ะฝะฐะทั‹ะฒะฐัŽั‚ **"ะบะพะฝะบัƒั€ะตะฝั‚ะฝะพัั‚ัŒัŽ"**. ะžะฝะฐ ะพั‚ะปะธั‡ะฐะตั‚ัั ะพั‚ **"ะฟะฐั€ะฐะปะปะตะปะธะทะผะฐ"**. + +ะ”ะฐ, **ะบะพะฝะบัƒั€ะตะฝั‚ะฝะพัั‚ัŒ** ะธ **ะฟะฐั€ะฐะปะปะตะปะธะทะผ** ะฟะพะดั€ะฐะทัƒะผะตะฒะฐัŽั‚, ั‡ั‚ะพ ั€ะฐะทะฝั‹ะต ะฒะตั‰ะธ ะฟั€ะพะธัั…ะพะดัั‚ ะฟั€ะธะผะตั€ะฝะพ ะฒ ะพะดะฝะพ ะฒั€ะตะผั. + +ะะพ ะฒะฝัƒั‚ั€ะตะฝะฝะตะต ัƒัั‚ั€ะพะนัั‚ะฒะพ **ะบะพะฝะบัƒั€ะตะฝั‚ะฝะพัั‚ะธ** ะธ **ะฟะฐั€ะฐะปะปะตะปะธะทะผะฐ** ะดะพะฒะพะปัŒะฝะพ ั€ะฐะทะฝะพะต. + +ะงั‚ะพะฑั‹ ัั‚ะพ ะฟะพะฝัั‚ัŒ, ะฟั€ะตะดัั‚ะฐะฒัŒั‚ะต ั‚ะฐะบัƒัŽ ะบะฐั€ั‚ะธะฝัƒ: + +### ะšะพะฝะบัƒั€ะตะฝั‚ะฝั‹ะต ะฑัƒั€ะณะตั€ั‹ + + + +ะ’ั‹ ะธะดั‘ั‚ะต ัะพ ัะฒะพะตะน ะฒะพะทะปัŽะฑะปะตะฝะฝะพะน ๐Ÿ˜ ะฒ ั„ะฐัั‚ั„ัƒะด ๐Ÿ” ะธ ัั‚ะฐะฝะพะฒะธั‚ะตััŒ ะฒ ะพั‡ะตั€ะตะดัŒ, ะฒ ัั‚ะพ ะฒั€ะตะผั ะบะฐััะธั€ ๐Ÿ’ ะฟั€ะธะฝะธะผะฐะตั‚ ะทะฐะบะฐะทั‹ ัƒ ะฟะพัะตั‚ะธั‚ะตะปะตะน ะฟะตั€ะตะด ะฒะฐะผะธ. + +ะšะพะณะดะฐ ะฝะฐะบะพะฝะตั† ะฟะพะดั…ะพะดะธั‚ ะพั‡ะตั€ะตะดัŒ, ะฒั‹ ะทะฐะบะฐะทั‹ะฒะฐะตั‚ะต ะฟะฐั€ะพั‡ะบัƒ ัะฐะผั‹ั… ะฒะบัƒัะฝั‹ั… ะธ ะฝะฐะฒะพั€ะพั‡ะตะฝะฝั‹ั… ะฑัƒั€ะณะตั€ะพะฒ ๐Ÿ”, ะพะดะธะฝ ะดะปั ัะฒะพะตะน ะฒะพะทะปัŽะฑะปะตะฝะฝะพะน ๐Ÿ˜, ะฐ ะดั€ัƒะณะพะน ัะตะฑะต. + +ะžั‚ะดะฐั‘ั‚ะต ะดะตะฝัŒะณะธ ๐Ÿ’ธ. + +ะšะฐััะธั€ ๐Ÿ’ ั‡ั‚ะพ-ั‚ะพ ะณะพะฒะพั€ะธั‚ ะฟะพะฒะฐั€ะฐะผ ะฝะฐ ะบัƒั…ะฝะต ๐Ÿ‘จโ€๐Ÿณ, ั‚ะตะฟะตั€ัŒ ะพะฝะธ ะทะฝะฐัŽั‚, ะบะฐะบะธะต ะฑัƒั€ะณะตั€ั‹ ะฝัƒะถะฝะพ ะฑัƒะดะตั‚ ะฟั€ะธะณะพั‚ะพะฒะธั‚ัŒ ๐Ÿ” +(ะฝะพ ะฟะพะบะฐ ะพะฝะธ ะทะฐะฝัั‚ั‹ ะฑัƒั€ะณะตั€ะฐะผะธ ะฟั€ะตะดั‹ะดัƒั‰ะธั… ะบะปะธะตะฝั‚ะพะฒ). + +ะšะฐััะธั€ ๐Ÿ’ ะพั‚ะดะฐั‘ั‚ ะฒะฐะผ ั‡ะตะบ ั ะฝะพะผะตั€ะพะผ ะทะฐะบะฐะทะฐ. + +ะ’ ะพะถะธะดะฐะฝะธะธ ะตะดั‹ ะฒั‹ ะธะดั‘ั‚ะต ัะพ ัะฒะพะตะน ะฒะพะทะปัŽะฑะปะตะฝะฝะพะน ๐Ÿ˜ ะฒั‹ะฑั€ะฐั‚ัŒ ัั‚ะพะปะธะบ, ัะฐะดะธั‚ะตััŒ ะธ ะดะพะฒะพะปัŒะฝะพ ะฟั€ะพะดะพะปะถะธั‚ะตะปัŒะฝะพะต ะฒั€ะตะผั ะพะฑั‰ะฐะตั‚ะตััŒ ๐Ÿ˜ +(ะฟะพัะบะพะปัŒะบัƒ ะฒะฐัˆะธ ะฑัƒั€ะณะตั€ั‹ ัะฐะผั‹ะต ะฝะฐะฒะพั€ะพั‡ะตะฝะฝั‹ะต, ะณะพั‚ะพะฒัั‚ัั ะพะฝะธ ะฝะต ั‚ะฐะบ ะฑั‹ัั‚ั€ะพ โœจ๐Ÿ”โœจ). + +ะกะธะดั ะทะฐ ัั‚ะพะปะธะบะพะผ ั ะฒะพะทะปัŽะฑะปะตะฝะฝะพะน ๐Ÿ˜ ะฒ ะพะถะธะดะฐะฝะธะธ ะฑัƒั€ะณะตั€ะพะฒ ๐Ÿ”, ะฒั‹ ะพั‚ะปะธั‡ะฝะพ ะฟั€ะพะฒะพะดะธั‚ะต ะฒั€ะตะผั, +ะฒะพัั…ะธั‰ะฐัััŒ ะตั‘ ะฒะตะปะธะบะพะปะตะฟะธะตะผ, ะบั€ะฐัะพั‚ะพะน ะธ ัƒะผะพะผ โœจ๐Ÿ˜โœจ. + +ะ’ัั‘ ะตั‰ั‘ ะพะถะธะดะฐั ะทะฐะบะฐะท ะธ ะฑะพะปั‚ะฐั ัะพ ัะฒะพะตะน ะฒะพะทะปัŽะฑะปะตะฝะฝะพะน ๐Ÿ˜, ะฒั€ะตะผั ะพั‚ ะฒั€ะตะผะตะฝะธ ะฒั‹ ะฟั€ะพะฒะตั€ัะตั‚ะต, +ะบะฐะบะพะน ะฝะพะผะตั€ ะณะพั€ะธั‚ ะฝะฐะด ะฟั€ะธะปะฐะฒะบะพะผ, ะธ ะฝะต ะฟะพะดะพัˆะปะฐ ะปะธ ัƒะถะต ะฒะฐัˆะฐ ะพั‡ะตั€ะตะดัŒ. + +ะ˜ ะฒะพั‚ ะฝะฐะบะพะฝะตั† ะฝะฐัั‚ะฐั‘ั‚ ัั‚ะพั‚ ะผะพะผะตะฝั‚, ะธ ะฒั‹ ะธะดั‘ั‚ะต ะบ ัั‚ะพะนะบะต, ั‡ั‚ะพะฑั‹ ะทะฐะฑั€ะฐั‚ัŒ ะฑัƒั€ะณะตั€ั‹ ๐Ÿ” ะธ ะฒะตั€ะฝัƒั‚ัŒัั ะทะฐ ัั‚ะพะปะธะบ. + +ะ’ั‹ ัะพ ัะฒะพะตะน ะฒะพะทะปัŽะฑะปะตะฝะฝะพะน ๐Ÿ˜ ะตะดะธั‚ะต ะฑัƒั€ะณะตั€ั‹ ๐Ÿ” ะธ ะพั‚ะปะธั‡ะฝะพ ะฟั€ะพะฒะพะดะธั‚ะต ะฒั€ะตะผั โœจ. + +--- + +ะ ั‚ะตะฟะตั€ัŒ ะฟั€ะตะดัั‚ะฐะฒัŒั‚ะต, ั‡ั‚ะพ ะฒ ัั‚ะพะน ะฝะตะฑะพะปัŒัˆะพะน ะธัั‚ะพั€ะธะธ ะฒั‹ ะบะพะผะฟัŒัŽั‚ะตั€ / ะฟั€ะพะณั€ะฐะผะผะฐ ๐Ÿค–. + +ะ’ ะพั‡ะตั€ะตะดะธ ะฒั‹ ะฟั€ะพัั‚ะพ ะณะปะฐะทะตะตั‚ะต ะฟะพ ัั‚ะพั€ะพะฝะฐะผ ๐Ÿ˜ด, ะถะดั‘ั‚ะต ะธ ะฝะธั‡ะตะณะพ ะพัะพะฑะพ "ะฟั€ะพะดัƒะบั‚ะธะฒะฝะพะณะพ" ะฝะต ะดะตะปะฐะตั‚ะต. +ะะพ ะพั‡ะตั€ะตะดัŒ ะดะฒะธะถะตั‚ัั ะดะพะฒะพะปัŒะฝะพ ะฑั‹ัั‚ั€ะพ, ะฟะพัะบะพะปัŒะบัƒ ะบะฐััะธั€ ๐Ÿ’ ั‚ะพะปัŒะบะพ ะฟั€ะธะฝะธะผะฐะตั‚ ะทะฐะบะฐะทั‹ (ะฐ ะฝะต ะทะฐะฝะธะผะฐะตั‚ัั ะฟั€ะธะณะพั‚ะพะฒะปะตะฝะธะตะผ ะตะดั‹), ั‚ะฐะบ ั‡ั‚ะพ ะฝะธั‡ะตะณะพ ัั‚ั€ะฐัˆะฝะพะณะพ. + +ะšะพะณะดะฐ ะฟะพะดั…ะพะดะธั‚ ะพั‡ะตั€ะตะดัŒ ะฒั‹ ะฝะฐะบะพะฝะตั† ะฟั€ะตะดะฟั€ะธะฝะธะผะฐะตั‚ะต "ะฟั€ะพะดัƒะบั‚ะธะฒะฝั‹ะต" ะดะตะนัั‚ะฒะธั ๐Ÿค“: ะฟั€ะพัะผะฐั‚ั€ะธะฒะฐะตั‚ะต ะผะตะฝัŽ, ะฒั‹ะฑะธั€ะฐะตั‚ะต ะฒ ะฝั‘ะผ ั‡ั‚ะพ-ั‚ะพ, ัƒะทะฝะฐั‘ั‚ะต, ั‡ั‚ะพ ั…ะพั‡ะตั‚ ะฒะฐัˆะฐ ะฒะพะทะปัŽะฑะปะตะฝะฝะฐั ๐Ÿ˜, ัะพะฑะธั€ะฐะตั‚ะตััŒ ะพะฟะปะฐั‚ะธั‚ัŒ ๐Ÿ’ธ, ัะผะพั‚ั€ะธั‚ะต, ะบะฐะบัƒัŽ ะดะพัั‚ะฐะปะธ ะบะฐั€ั‚ัƒ, ะฟั€ะพะฒะตั€ัะตั‚ะต, ั‡ั‚ะพะฑั‹ ั ะฒะฐั ัะฟะธัะฐะปะธ ะฒะตั€ะฝัƒัŽ ััƒะผะผัƒ, ะธ ั‡ั‚ะพ ะฒ ะทะฐะบะฐะทะต ะฒัั‘ ะฒะตั€ะฝะพ ะธ ั‚. ะด. + +ะ˜ ั…ะพั‚ั ะฒั‹ ะฒัั‘ ะตั‰ั‘ ะฝะต ะฟะพะปัƒั‡ะธะปะธ ะฑัƒั€ะณะตั€ั‹ ๐Ÿ”, ะฒะฐัˆะฐ ั€ะฐะฑะพั‚ะฐ ั ะบะฐััะธั€ะพะผ ๐Ÿ’ ัั‚ะฐะฒะธั‚ัั "ะฝะฐ ะฟะฐัƒะทัƒ" โธ, +ะฟะพัะบะพะปัŒะบัƒ ั‚ะตะฟะตั€ัŒ ะฝัƒะถะฝะพ ะถะดะฐั‚ัŒ ๐Ÿ•™, ะบะพะณะดะฐ ะทะฐะบะฐะท ะฟั€ะธะณะพั‚ะพะฒัั‚. + +ะะพ ะพั‚ะพะนะดั ั ะฝะพะผะตั€ะบะพะผ ะพั‚ ะฟั€ะธะปะฐะฒะบะฐ, ะฒั‹ ัะฐะดะธั‚ะตััŒ ะทะฐ ัั‚ะพะปะธะบ ะธ ะผะพะถะตั‚ะต ะฟะตั€ะตะบะปัŽั‡ะธั‚ัŒ ๐Ÿ”€ ะฒะฝะธะผะฐะฝะธะต +ะฝะฐ ัะฒะพัŽ ะฒะพะทะปัŽะฑะปะตะฝะฝัƒัŽ ๐Ÿ˜ ะธ "ั€ะฐะฑะพั‚ะฐั‚ัŒ" โฏ ๐Ÿค“ ัƒะถะต ะฝะฐะด ัั‚ะธะผ. ะ˜ ะฒะพั‚ ะฒั‹ ัะฝะพะฒะฐ ะพั‡ะตะฝัŒ +"ะฟั€ะพะดัƒะบั‚ะธะฒะฝั‹" ๐Ÿค“, ะผะธะปะพ ะฑะพะปั‚ะฐะตั‚ะต ะฒะดะฒะพั‘ะผ ะธ ะฒัั‘ ั‚ะฐะบะพะต ๐Ÿ˜. + +ะ’ ะบะฐะบะพะน-ั‚ะพ ะผะพะผะตะฝั‚ ะบะฐััะธั€ ๐Ÿ’ ะฟะพะผะตัั‚ะธั‚ ะฝะฐ ั‚ะฐะฑะปะพ ะฒะฐัˆ ะฝะพะผะตั€, ะฟะพะดั€ะฐะทัƒะผะตะฒะฐั, ั‡ั‚ะพ ะฑัƒั€ะณะตั€ั‹ ะณะพั‚ะพะฒั‹ ๐Ÿ”, ะฝะพ ะฒั‹ ะฝะต ัั‚ะฐะฝะตั‚ะต ะฟะพะดัะบะฐะบะธะฒะฐั‚ัŒ ะบะฐะบ ัƒะผะฐะปะธัˆั‘ะฝะฝั‹ะน, ะปะธัˆัŒ ั‚ะพะปัŒะบะพ ัƒะฒะธะดะตะฒ ะฝะฐ ัะบั€ะฐะฝะต ัะฒะพัŽ ะพั‡ะตั€ะตะดัŒ. ะ’ั‹ ัƒะฒะตั€ะตะฝั‹, ั‡ั‚ะพ ะฒะฐัˆะธ ะฑัƒั€ะณะตั€ั‹ ๐Ÿ” ะฝะธะบั‚ะพ ะฝะต ัƒั‚ะฐั‰ะธั‚, ะฒะตะดัŒ ัƒ ะฒะฐั ัะฒะพะน ะฝะพะผะตั€ะพะบ, ะฐ ัƒ ะดั€ัƒะณะธั… ัะฒะพะน. + +ะŸะพัั‚ะพะผัƒ ะฒั‹ ะฟะพะดะพะถะดั‘ั‚ะต, ะฟะพะบะฐ ะฒะพะทะปัŽะฑะปะตะฝะฝะฐั ๐Ÿ˜ ะทะฐะบะพะฝั‡ะธั‚ ั€ะฐััะบะฐะทั‹ะฒะฐั‚ัŒ ะธัั‚ะพั€ะธัŽ (ะทะฐะบะพะฝั‡ะธั‚ะต ั‚ะตะบัƒั‰ัƒัŽ ั€ะฐะฑะพั‚ัƒ โฏ / ะทะฐะดะฐั‡ัƒ ะฒ ะพะฑั€ะฐะฑะพั‚ะบะต ๐Ÿค“), +ะธ ะผะธะปะพ ัƒะปั‹ะฑะฝัƒะฒัˆะธััŒ, ัะบะฐะถะตั‚ะต, ั‡ั‚ะพ ะธะดั‘ั‚ะต ะทะฐะฑะธั€ะฐั‚ัŒ ะทะฐะบะฐะท โธ. + +ะ˜ ะฒะพั‚ ะฒั‹ ะฟะพะดั…ะพะดะธั‚ะต ะบ ัั‚ะพะนะบะต ๐Ÿ”€, ะบ ะฟะตั€ะฒะพะฝะฐั‡ะฐะปัŒะฝะพะน ะทะฐะดะฐั‡ะต, ะบะพั‚ะพั€ะฐั ัƒะถะต ะทะฐะฒะตั€ัˆะตะฝะฐ โฏ, ะฑะตั€ั‘ั‚ะต ะฑัƒั€ะณะตั€ั‹ ๐Ÿ”, ะณะพะฒะพั€ะธั‚ะต ัะฟะฐัะธะฑะพ ะธ ะพั‚ะฝะพัะธั‚ะต ะทะฐะบะฐะท ะทะฐ ัั‚ะพะปะธะบ. ะะฐ ัั‚ะพะผ ะทะฐะบะฐะฝั‡ะธะฒะฐะตั‚ัั ัั‚ะฐะฟ / ะทะฐะดะฐั‡ะฐ ะฒะทะฐะธะผะพะดะตะนัั‚ะฒะธั ั ะบะฐััะพะน โน. +ะ’ ัะฒะพัŽ ะพั‡ะตั€ะตะดัŒ ะฟะพั€ะพะถะดะฐะตั‚ัั ะทะฐะดะฐั‡ะฐ "ะฟะพะตะดะฐะฝะธะต ะฑัƒั€ะณะตั€ะพะฒ" ๐Ÿ”€ โฏ, ะฝะพ ะฟั€ะตะดั‹ะดัƒั‰ะฐั ("ะฟะพะปัƒั‡ะตะฝะธะต ะฑัƒั€ะณะตั€ะพะฒ") ะทะฐะฒะตั€ัˆะตะฝะฐ โน. + +### ะŸะฐั€ะฐะปะปะตะปัŒะฝั‹ะต ะฑัƒั€ะณะตั€ั‹ + +ะขะตะฟะตั€ัŒ ะฟั€ะตะดัั‚ะฐะฒะธะผ, ั‡ั‚ะพ ะฒะผะตัั‚ะพ ะฑัƒั€ะณะตั€ะฝะพะน "ะšะพะฝะบัƒั€ะตะฝั‚ะฝั‹ะต ะฑัƒั€ะณะตั€ั‹" ะฒั‹ ั€ะตัˆะธะปะธ ัั…ะพะดะธั‚ัŒ ะฒ "ะŸะฐั€ะฐะปะปะตะปัŒะฝั‹ะต ะฑัƒั€ะณะตั€ั‹". + +ะ˜ ะฒะพั‚ ะฒั‹ ะธะดั‘ั‚ะต ัะพ ัะฒะพะตะน ะฒะพะทะปัŽะฑะปะตะฝะฝะพะน ๐Ÿ˜ ะพั‚ะฒะตะดะฐั‚ัŒ ะฟะฐั€ะฐะปะปะตะปัŒะฝะพะณะพ ั„ะฐัั‚ั„ัƒะดะฐ ๐Ÿ”. + +ะ’ั‹ ัั‚ะฐะฝะพะฒะธั‚ะตััŒ ะฒ ะพั‡ะตั€ะตะดัŒ ะฟะพะบะฐ ะฝะตัะบะพะปัŒะบะพ (ะฟัƒัั‚ัŒ ะฑัƒะดะตั‚ 8) ะบะฐััะธั€ะพะฒ, ะบะพั‚ะพั€ั‹ะต ะฟะพ ัะพะฒะผะตัั‚ะธั‚ะตะปัŒัั‚ะฒัƒ ะตั‰ั‘ ะธ ะฟะพะฒะฐั€ั‹ ๐Ÿ‘ฉโ€๐Ÿณ๐Ÿ‘จโ€๐Ÿณ๐Ÿ‘ฉโ€๐Ÿณ๐Ÿ‘จโ€๐Ÿณ๐Ÿ‘ฉโ€๐Ÿณ๐Ÿ‘จโ€๐Ÿณ๐Ÿ‘ฉโ€๐Ÿณ๐Ÿ‘จโ€๐Ÿณ, ะฟั€ะธะฝะธะผะฐัŽั‚ ะทะฐะบะฐะทั‹ ัƒ ะฟะพัะตั‚ะธั‚ะตะปะตะน ะฟะตั€ะตะด ะฒะฐะผะธ. + +ะŸั€ะธ ัั‚ะพะผ ะบะปะธะตะฝั‚ั‹ ะฝะต ะพั‚ั…ะพะดัั‚ ะพั‚ ัั‚ะพะนะบะธ ะธ ะถะดัƒั‚ ๐Ÿ•™ ะฟะพะปัƒั‡ะตะฝะธั ะตะดั‹, ะฟะพัะบะพะปัŒะบัƒ ะบะฐะถะดั‹ะน +ะธะท 8 ะบะฐััะธั€ะพะฒ ะธะดั‘ั‚ ะฝะฐ ะบัƒั…ะฝัŽ ะณะพั‚ะพะฒะธั‚ัŒ ะฑัƒั€ะณะตั€ั‹ ๐Ÿ”, ะฐ ั‚ะพะปัŒะบะพ ะฟะพั‚ะพะผ ะฟั€ะธะฝะธะผะฐะตั‚ ัะปะตะดัƒัŽั‰ะธะน ะทะฐะบะฐะท. + +ะะฐะบะพะฝะตั† ะฝะฐัั‚ะฐั‘ั‚ ะฒะฐัˆะฐ ะพั‡ะตั€ะตะดัŒ, ะธ ะฒั‹ ะฟั€ะพัะธั‚ะต ะดะฒะฐ ัะฐะผั‹ั… ะฝะฐะฒะพั€ะพั‡ะตะฝะฝั‹ั… ะฑัƒั€ะณะตั€ะฐ ๐Ÿ”, ะพะดะธะฝ ะดะปั ะดะฐะผั‹ ัะตั€ะดั†ะฐ ๐Ÿ˜, ะฐ ะดั€ัƒะณะพะน ัะตะฑะต. + +ะะธ ะพ ั‡ั‘ะผ ะฝะต ะถะฐะปะตั, ั€ะฐัะฟะปะฐั‡ะธะฒะฐะตั‚ะตััŒ ๐Ÿ’ธ. + +ะ˜ ะบะฐััะธั€ ัƒั…ะพะดะธั‚ ะฝะฐ ะบัƒั…ะฝัŽ ๐Ÿ‘จโ€๐Ÿณ. + +ะ’ะฐะผ ะฟั€ะธั…ะพะดะธั‚ัั ะถะดะฐั‚ัŒ ะฟะตั€ะตะด ัั‚ะพะนะบะพะน ๐Ÿ•™, ั‡ั‚ะพะฑั‹ ะฝะธะบั‚ะพ ะฟะพ ัะปัƒั‡ะฐะนะฝะพัั‚ะธ ะฝะต ะทะฐะฑั€ะฐะป ะฒะฐัˆะธ ะฑัƒั€ะณะตั€ั‹ ๐Ÿ”, ะฒะตะดัŒ ะฝะธะบะฐะบะธั… ะฝะพะผะตั€ะบะพะฒ ัƒ ะฒะฐั ะฝะตั‚. + +ะŸะพัะบะพะปัŒะบัƒ ะฒั‹ ั ะฒะพะทะปัŽะฑะปะตะฝะฝะพะน ๐Ÿ˜ ั…ะพั‚ะธั‚ะต ะฟะพะปัƒั‡ะธั‚ัŒ ะทะฐะบะฐะท ะฒะพะฒั€ะตะผั ๐Ÿ•™, ะธ ัะปะตะดะธั‚ะต ะทะฐ ั‚ะตะผ, ั‡ั‚ะพะฑั‹ ะฝะธะบั‚ะพ ะฝะต ะฒะบะปะธะฝะธะปัั ะฒ ะพั‡ะตั€ะตะดัŒ, +ัƒ ะฒะฐั ะฝะต ะฟะพะปัƒั‡ะฐะตั‚ัั ัƒะดะตะปัั‚ัŒ ะดะพะปะถะฝะพะณะพ ะฒะฝะธะผะฐะฝะธะต ัะฒะพะตะน ะดะฐะผะต ัะตั€ะดั†ะฐ ๐Ÿ˜ž. + +ะญั‚ะพ "ัะธะฝั…ั€ะพะฝะฝะฐั" ั€ะฐะฑะพั‚ะฐ, ะฒั‹ "ัะธะฝั…ั€ะพะฝะธะทะธั€ะพะฒะฐะฝั‹" ั ะบะฐััะธั€ะพะผ/ะฟะพะฒะฐั€ะพะผ ๐Ÿ‘จโ€๐Ÿณ. ะŸั€ะธั…ะพะดะธั‚ัั ะถะดะฐั‚ัŒ ๐Ÿ•™ ัƒ ัั‚ะพะนะบะธ, +ะบะพะณะดะฐ ะบะฐััะธั€/ะฟะพะฒะฐั€ ๐Ÿ‘จโ€๐Ÿณ ะทะฐะบะพะฝั‡ะธั‚ ะดะตะปะฐั‚ัŒ ะฑัƒั€ะณะตั€ั‹ ๐Ÿ” ะธ ะฒั€ัƒั‡ะธั‚ ะฒะฐะผ ะทะฐะบะฐะท, ะธะฝะฐั‡ะต ะตะณะพ ัะปัƒั‡ะฐะนะฝะพ ะผะพะถะตั‚ ะทะฐะฑั€ะฐั‚ัŒ ะบั‚ะพ-ั‚ะพ ะดั€ัƒะณะพะน. + +ะะฐะบะพะฝะตั† ะบะฐััะธั€/ะฟะพะฒะฐั€ ๐Ÿ‘จโ€๐Ÿณ ะฒะพะทะฒั€ะฐั‰ะฐะตั‚ัั ั ะฑัƒั€ะณะตั€ะฐะผะธ ๐Ÿ” ะฟะพัะปะต ะฝะตะฒั‹ะฝะพัะธะผะพ ะดะพะปะณะพะณะพ ะพะถะธะดะฐะฝะธั ๐Ÿ•™ ะทะฐ ัั‚ะพะนะบะพะน. + +ะ’ั‹ ัะบะพั€ะตะต ะทะฐะฑะธั€ะฐะตั‚ะต ะทะฐะบะฐะท ๐Ÿ” ะธ ะธะดั‘ั‚ะต ั ะฒะพะทะปัŽะฑะปะตะฝะฝะพะน ๐Ÿ˜ ะทะฐ ัั‚ะพะปะธะบ. + +ะขะฐะผ ะฒั‹ ะฟั€ะพัั‚ะพ ะตะดะธั‚ะต ัั‚ะธ ะฑัƒั€ะณะตั€ั‹, ะธ ะฝะฐ ัั‚ะพะผ ะฒัั‘ ๐Ÿ” โน. + +ะ’ะฐะผ ะฝะต ะพัะพะฑะพ ัƒะดะฐะปะพััŒ ะฟะพะพะฑั‰ะฐั‚ัŒัั, ะฟะพั‚ะพะผัƒ ั‡ั‚ะพ ะฑะพะปัŒัˆัƒัŽ ั‡ะฐัั‚ัŒ ะฒั€ะตะผะตะฝะธ ๐Ÿ•™ ะฟั€ะธัˆะปะพััŒ ะฟั€ะพะฒะตัั‚ะธ ัƒ ะบะฐััั‹ ๐Ÿ˜ž. + +--- + +ะ’ ะพะฟะธัะฐะฝะฝะพะผ ัั†ะตะฝะฐั€ะธะธ ะฒั‹ ะบะพะผะฟัŒัŽั‚ะตั€ / ะฟั€ะพะณั€ะฐะผะผะฐ ๐Ÿค– ั ะดะฒัƒะผั ะธัะฟะพะปะฝะธั‚ะตะปัะผะธ (ะฒั‹ ะธ ะฒะฐัˆะฐ ะฒะพะทะปัŽะฑะปะตะฝะฝะฐั ๐Ÿ˜), +ะฝะฐ ะฟั€ะพั‚ัะถะตะฝะธะธ ะดะพะปะณะพะณะพ ะฒั€ะตะผะตะฝะธ ๐Ÿ•™ ะฒั‹ ะพะฑะฐ ัƒะดะตะปัะตั‚ะต ะฒัั‘ ะฒะฝะธะผะฐะฝะธะต โฏ ะทะฐะดะฐั‡ะต "ะถะดะฐั‚ัŒ ะฝะฐ ะบะฐััะต". + +ะ’ ัั‚ะพะผ ั€ะตัั‚ะพั€ะฐะฝะต ะฑั‹ัั‚ั€ะพะณะพ ะฟะธั‚ะฐะฝะธั 8 ะธัะฟะพะปะฝะธั‚ะตะปะตะน (ะบะฐััะธั€ะพะฒ/ะฟะพะฒะฐั€ะพะฒ) ๐Ÿ‘ฉโ€๐Ÿณ๐Ÿ‘จโ€๐Ÿณ๐Ÿ‘ฉโ€๐Ÿณ๐Ÿ‘จโ€๐Ÿณ๐Ÿ‘ฉโ€๐Ÿณ๐Ÿ‘จโ€๐Ÿณ๐Ÿ‘ฉโ€๐Ÿณ๐Ÿ‘จโ€๐Ÿณ. +ะฅะพั‚ั ะฒ ะฑัƒั€ะณะตั€ะฝะพะน ะบะพะฝะบัƒั€ะตะฝั‚ะฝะพะณะพ ั‚ะธะฟะฐ ะฑั‹ะปะพ ะฒัะตะณะพ ะดะฒะฐ (ะพะดะธะฝ ะบะฐััะธั€ ะธ ะพะดะธะฝ ะฟะพะฒะฐั€) ๐Ÿ’ ๐Ÿ‘จโ€๐Ÿณ. + +ะะตัะผะพั‚ั€ั ะฝะฐ ะพะฑะธะปะธะต ั€ะฐะฑะพั‚ะฝะธะบะพะฒ, ะพะฟั‹ั‚ ะฒ ะธั‚ะพะณะต ะฟะพะปัƒั‡ะธะปัั ะฝะต ะธะท ะปัƒั‡ัˆะธั… ๐Ÿ˜ž. + +--- + +ะขะฐะบ ะฑั‹ ะฒั‹ะณะปัะดะตะป ะฐะฝะฐะปะพะณ ะธัั‚ะพั€ะธะธ ะฟั€ะพ ะฑัƒั€ะณะตั€ะฝัƒัŽ ๐Ÿ” ะฒ "ะฟะฐั€ะฐะปะปะตะปัŒะฝะพะผ" ะผะธั€ะต. + +ะ’ะพั‚ ะฑะพะปะตะต ั€ะตะฐะปะธัั‚ะธั‡ะฝั‹ะน ะฟั€ะธะผะตั€. ะŸั€ะตะดัั‚ะฐะฒัŒั‚ะต ัะตะฑะต ะฑะฐะฝะบ. + +ะ”ะพ ะฝะตะดะฐะฒะฝะธั… ะฟะพั€ ะฒ ะฑะพะปัŒัˆะธะฝัั‚ะฒะต ะฑะฐะฝะบะพะฒ ะฑั‹ะปะพ ะฝะตัะบะพะปัŒะบะพ ะบะฐััะธั€ะพะฒ ๐Ÿ‘จโ€๐Ÿ’ผ๐Ÿ‘จโ€๐Ÿ’ผ๐Ÿ‘จโ€๐Ÿ’ผ๐Ÿ‘จโ€๐Ÿ’ผ ะธ ะดะปะธะฝะฝั‹ะต ะพั‡ะตั€ะตะดะธ ๐Ÿ•™๐Ÿ•™๐Ÿ•™๐Ÿ•™๐Ÿ•™๐Ÿ•™๐Ÿ•™๐Ÿ•™. + +ะšะฐะถะดั‹ะน ะบะฐััะธั€ ะพะฑัะปัƒะถะธะฒะฐะป ะพะดะฝะพะณะพ ะบะปะธะตะฝั‚ะฐ, ะฟะพั‚ะพะผ ัะปะตะดัƒัŽั‰ะตะณะพ ๐Ÿ‘จโ€๐Ÿ’ผโฏ. + +ะัƒะถะฝะพ ะฑั‹ะปะพ ะดะพะปะณะพะต ะฒั€ะตะผั ๐Ÿ•™ ัั‚ะพัั‚ัŒ ะฟะตั€ะตะด ะพะบะพัˆะบะพะผ ะฒะผะตัั‚ะต ัะพ ะฒัะตะผะธ, ะธะฝะฐั‡ะต ะฟั€ะพะฟัƒัั‚ะธัˆัŒ ัะฒะพัŽ ะพั‡ะตั€ะตะดัŒ. + +ะกะพะผะฝะตะฒะฐัŽััŒ, ั‡ั‚ะพ ัƒ ะฒะฐั ะฑั‹ ะฒะพะทะฝะธะบะปะพ ะถะตะปะฐะฝะธะต ะฟั€ะธะนั‚ะธ ั ะฒะพะทะปัŽะฑะปะตะฝะฝะพะน ๐Ÿ˜ ะฒ ะฑะฐะฝะบ ๐Ÿฆ ะพะฟะปะฐั‡ะธะฒะฐั‚ัŒ ะฝะฐะปะพะณะธ. + +### ะ’ั‹ะฒะพะดั‹ ะพ ะฑัƒั€ะณะตั€ะฐั… + +ะ’ ะฝะฐัˆะตะน ะธัั‚ะพั€ะธะธ ะฟั€ะพ ะฟะพั…ะพะด ะฒ ั„ะฐัั‚ั„ัƒะด ะทะฐ ะฑัƒั€ะณะตั€ะฐะผะธ ะฟั€ะธั…ะพะดะธั‚ัั ะผะฝะพะณะพ ะถะดะฐั‚ัŒ ๐Ÿ•™, +ะฟะพัั‚ะพะผัƒ ะธะผะตะตั‚ ัะผั‹ัะป ะพั€ะณะฐะฝะธะทะพะฒะฐั‚ัŒ ะบะพะฝะบัƒั€ะตะฝั‚ะฝัƒัŽ ัะธัั‚ะตะผัƒ โธ๐Ÿ”€โฏ. + +ะ˜ ั‚ะพ ะถะต ัะฐะผะพะต ั ะฑะพะปัŒัˆะธะฝัั‚ะฒะพะผ ะฒะตะฑ-ะฟั€ะธะปะพะถะตะฝะธะน. + +ะŸะพะปัŒะทะพะฒะฐั‚ะตะปะตะน ะพั‡ะตะฝัŒ ะผะฝะพะณะพ, ะฝะพ ะฒะฐัˆ ัะตั€ะฒะตั€ ะฒัั‘ ั€ะฐะฒะฝะพ ะฒั‹ะฝัƒะถะดะตะฝ ะถะดะฐั‚ัŒ ๐Ÿ•™ ะทะฐะฟั€ะพัั‹ ะฟะพ ะธั… ัะปะฐะฑะพะผัƒ ะธะฝั‚ะตั€ะฝะตั‚-ัะพะตะดะธะฝะตะฝะธัŽ. + +ะŸะพั‚ะพะผ ัะฝะพะฒะฐ ะถะดะฐั‚ัŒ ๐Ÿ•™, ะฟะพะบะฐ ะฒะตั€ะฝั‘ั‚ัั ะพั‚ะฒะตั‚. + + +ะญั‚ะพ ะพะถะธะดะฐะฝะธะต ๐Ÿ•™ ะธะทะผะตั€ัะตั‚ัั ะผะธะบั€ะพัะตะบัƒะฝะดะฐะผะธ, ะฝะพ ะตัะปะธ ะฒัั‘ ัะปะพะถะธั‚ัŒ, ั‚ะพ ะฝะฐะฑะตะณะฐะตั‚ ะดะพะฒะพะปัŒะฝะพ ะผะฝะพะณะพ ะฒั€ะตะผะตะฝะธ. + +ะ’ะพั‚ ะฟะพั‡ะตะผัƒ ะตัั‚ัŒ ัะผั‹ัะป ะธัะฟะพะปัŒะทะพะฒะฐั‚ัŒ ะฐัะธะฝั…ั€ะพะฝะฝะพะต โธ๐Ÿ”€โฏ ะฟั€ะพะณั€ะฐะผะผะธั€ะพะฒะฐะฝะธะต ะฟั€ะธ ะฟะพัั‚ั€ะพะตะฝะธะธ ะฒะตะฑ-API. + +ะ‘ะพะปัŒัˆะธะฝัั‚ะฒะพ ะฟะพะฟัƒะปัั€ะฝั‹ั… ั„ั€ะตะนะผะฒะพั€ะบะพะฒ (ะฒะบะปัŽั‡ะฐั Flask ะธ Django) ัะพะทะดะฐะฒะฐะปะธััŒ +ะดะพ ะฟะพัะฒะปะตะฝะธั ะฒ Python ะฝะพะฒั‹ั… ะฒะพะทะผะพะถะฝะพัั‚ะตะน ะฐัะธะฝั…ั€ะพะฝะฝะพะณะพ ะฟั€ะพะณั€ะฐะผะผะธั€ะพะฒะฐะฝะธั. ะŸะพัั‚ะพะผัƒ +ะธั… ะผะพะถะฝะพ ั€ะฐะทะฒะพั€ะฐั‡ะธะฒะฐั‚ัŒ ั ะฟะพะดะดะตั€ะถะบะพะน ะฟะฐั€ะฐะปะปะตะปัŒะฝะพะณะพ ะธัะฟะพะปะฝะตะฝะธั ะธะปะธ ะฐัะธะฝั…ั€ะพะฝะฝะพะณะพ +ะฟั€ะพะณั€ะฐะผะผะธั€ะพะฒะฐะฝะธั ัั‚ะฐั€ะพะณะพ ั‚ะธะฟะฐ, ะบะพั‚ะพั€ะพะต ะฝะต ะฝะฐัั‚ะพะปัŒะบะพ ัั„ั„ะตะบั‚ะธะฒะฝะพ. + +ะŸั€ะธ ั‚ะพะผ, ั‡ั‚ะพ ะพัะฝะพะฒะฝะฐั ัะฟะตั†ะธั„ะธะบะฐั†ะธั ะฐัะธะฝั…ั€ะพะฝะฝะพะณะพ ะฒะทะฐะธะผะพะดะตะนัั‚ะฒะธั Python ั ะฒะตะฑ-ัะตั€ะฒะตั€ะพะผ +(ASGI) +ะฑั‹ะปะฐ ั€ะฐะทั€ะฐะฑะพั‚ะฐะฝะฐ ะบะพะผะฐะฝะดะพะน Django ะดะปั ะฒะฝะตะดั€ะตะฝะธั ะฟะพะดะดะตั€ะถะบะธ ะฒะตะฑ-ัะพะบะตั‚ะพะฒ. + +ะ˜ะผะตะฝะฝะพ ะฐัะธะฝั…ั€ะพะฝะฝะพัั‚ัŒ ัะดะตะปะฐะปะฐ NodeJS ั‚ะฐะบะธะผ ะฟะพะฟัƒะปัั€ะฝั‹ะผ (ะฝะตัะผะพั‚ั€ั ะฝะฐ ั‚ะพ, ั‡ั‚ะพ ะพะฝ ะฝะต ะฟะฐั€ะฐะปะปะตะปัŒะฝั‹ะน), +ะธ ะฒ ัั‚ะพะผ ะฟั€ะตะธะผัƒั‰ะตัั‚ะฒะพ Go ะบะฐะบ ัะทั‹ะบะฐ ะฟั€ะพะณั€ะฐะผะผะธั€ะพะฒะฐะฝะธั. + +ะ˜ ั‚ะพั‚ ะถะต ัƒั€ะพะฒะตะฝัŒ ะฟั€ะพะธะทะฒะพะดะธั‚ะตะปัŒะฝะพัั‚ะธ ะดะฐั‘ั‚ **FastAPI**. + +ะŸะพัะบะพะปัŒะบัƒ ะผะพะถะฝะพ ะธัะฟะพะปัŒะทะพะฒะฐั‚ัŒ ะฟั€ะตะธะผัƒั‰ะตัั‚ะฒะฐ ะฟะฐั€ะฐะปะปะตะปะธะทะผะฐ ะธ ะฐัะธะฝั…ั€ะพะฝะฝะพัั‚ะธ ะฒะผะตัั‚ะต, +ะฒั‹ ะฟะพะปัƒั‡ะฐะตั‚ะต ะฟั€ะพะธะทะฒะพะดะธั‚ะตะปัŒะฝะพัั‚ัŒ ะปัƒั‡ัˆะต, ั‡ะตะผ ัƒ ะฑะพะปัŒัˆะธะฝัั‚ะฒะฐ ะฟั€ะพั‚ะตัั‚ะธั€ะพะฒะฐะฝะฝั‹ั… NodeJS ั„ั€ะตะนะผะฒะพั€ะบะพะฒ +ะธ ะฝะฐ ัƒั€ะพะฒะฝะต ั Go, ะบะพั‚ะพั€ั‹ะน ัะฒะปัะตั‚ัั ะบะพะผะฟะธะปะธั€ัƒะตะผั‹ะผ ัะทั‹ะบะพะผ ะฑะปะธะทะบะธะผ ะบ C (ะฒัั‘ ะฑะปะฐะณะพะดะฐั€ั Starlette). + +### ะŸะพะปัƒั‡ะฐะตั‚ัั, ะบะพะฝะบัƒั€ะตะฝั‚ะฝะพัั‚ัŒ ะปัƒั‡ัˆะต ะฟะฐั€ะฐะปะปะตะปะธะทะผะฐ? + +ะะตั‚! ะœะพั€ะฐะปัŒ ะธัั‚ะพั€ะธะธ ัะพะฒัะตะผ ะฝะต ะฒ ัั‚ะพะผ. + +ะšะพะฝะบัƒั€ะตะฝั‚ะฝะพัั‚ัŒ ะพั‚ะปะธั‡ะฐะตั‚ัั ะพั‚ ะฟะฐั€ะฐะปะปะตะปะธะทะผะฐ. ะžะฝะฐ ะปัƒั‡ัˆะต ะฒ **ะบะพะฝะบั€ะตั‚ะฝั‹ั…** ัะปัƒั‡ะฐัั…, ะณะดะต ะผะฝะพะณะพ ะฒั€ะตะผะตะฝะธ ะฟั€ะธั…ะพะดะธั‚ัั ะฝะฐ ะพะถะธะดะฐะฝะธะต. +ะ’ะพั‚ ะฟะพั‡ะตะผัƒ ะพะฝะฐ ะทะฐั‡ะฐัั‚ัƒัŽ ะปัƒั‡ัˆะต ะฟะฐั€ะฐะปะปะตะปะธะทะผะฐ ะฟั€ะธ ั€ะฐะทั€ะฐะฑะพั‚ะบะต ะฒะตะฑ-ะฟั€ะธะปะพะถะตะฝะธะน. ะะพ ัั‚ะพ ะฝะต ะทะฝะฐั‡ะธั‚, ั‡ั‚ะพ ะบะพะฝะบัƒั€ะตะฝั‚ะฝะพัั‚ัŒ ะปัƒั‡ัˆะต ะฒ ะปัŽะฑั‹ั… ัั†ะตะฝะฐั€ะธัั…. + +ะ”ะฐะฒะฐะนั‚ะต ะฟะพัะผะพั‚ั€ะธะผ ั ะดั€ัƒะณะพะน ัั‚ะพั€ะพะฝั‹, ะฟั€ะตะดัั‚ะฐะฒัŒั‚ะต ั‚ะฐะบัƒัŽ ะบะฐั€ั‚ะธะฝัƒ: + +> ะ’ะฐะผ ะฝัƒะถะฝะพ ัƒะฑั€ะฐั‚ัŒัั ะฒ ะฑะพะปัŒัˆะพะผ ะณั€ัะทะฝะพะผ ะดะพะผะต. + +*ะ”ะฐ, ัั‚ะพ ะฒัั ะธัั‚ะพั€ะธั*. + +--- + +ะขัƒั‚ ะฝะต ะฝัƒะถะฝะพ ะฝะธะณะดะต ะถะดะฐั‚ัŒ ๐Ÿ•™, ะฟั€ะพัั‚ะพ ะตัั‚ัŒ ะบัƒั‡ะฐ ั€ะฐะฑะพั‚ั‹ ะฒ ั€ะฐะทะฝั‹ั… ั‡ะฐัั‚ัั… ะดะพะผะฐ. + +ะœะพะถะฝะพ ะพั€ะณะฐะฝะธะทะพะฒะฐั‚ัŒ ะพั‡ะตั€ะตะดัŒ ะบะฐะบ ะฒ ะฟั€ะธะผะตั€ะต ั ะฑัƒั€ะณะตั€ะฐะผะธ, ัะฝะฐั‡ะฐะปะฐ ะณะพัั‚ะธะฝะฐั, ะฟะพั‚ะพะผ ะบัƒั…ะฝั, +ะฝะพ ัั‚ะพ ะฝะธ ะฝะฐ ั‡ั‚ะพ ะฝะต ะฟะพะฒะปะธัะตั‚, ะฟะพัะบะพะปัŒะบัƒ ะฒั‹ ะฝะธะณะดะต ะฝะต ะถะดั‘ั‚ะต ๐Ÿ•™, ะฐ ะฟั€ะพัั‚ะพ ั‚ั€ั‘ั‚ะต ะดะฐ ะผะพะตั‚ะต. + +ะ˜ ะฟะพะฝะฐะดะพะฑะธั‚ัั ะพะดะธะฝะฐะบะพะฒะพะต ะบะพะปะธั‡ะตัั‚ะฒะพ ะฒั€ะตะผะตะฝะธ ั ะพั‡ะตั€ะตะดัŒัŽ (ะบะพะฝะบัƒั€ะตะฝั‚ะฝะพัั‚ัŒัŽ) ะธ ะฑะตะท ะฝะตั‘, +ะธ ั€ะฐะฑะพั‚ั‹ ะฑัƒะดะตั‚ ัะดะตะปะฐะฝะพ ั‚ะพะถะต ะพะดะธะฝะฐะบะพะฒะพะต ะบะพะปะธั‡ะตัั‚ะฒะพ. + +ะžะดะฝะฐะบะพ ะฒ ัะปัƒั‡ะฐะต, ะตัะปะธ ะฑั‹ ะฒั‹ ะผะพะณะปะธ ะฟั€ะธะฒะตัั‚ะธ 8 ะฑั‹ะฒัˆะธั… ะบะฐััะธั€ะพะฒ/ะฟะพะฒะฐั€ะพะฒ, ะฐ ะฝั‹ะฝะต ัƒะฑะพั€ั‰ะธะบะพะฒ ๐Ÿ‘ฉโ€๐Ÿณ๐Ÿ‘จโ€๐Ÿณ๐Ÿ‘ฉโ€๐Ÿณ๐Ÿ‘จโ€๐Ÿณ๐Ÿ‘ฉโ€๐Ÿณ๐Ÿ‘จโ€๐Ÿณ๐Ÿ‘ฉโ€๐Ÿณ๐Ÿ‘จโ€๐Ÿณ, +ะธ ะบะฐะถะดั‹ะน ะธะท ะฝะธั… (ะฒะผะตัั‚ะต ั ะฒะฐะผะธ) ะฒะทัะปัั ะฑั‹ ะทะฐ ัะฒะพะน ัƒั‡ะฐัั‚ะพะบ ะดะพะผะฐ, +ั ั‚ะฐะบะพะน ะฟะพะผะพั‰ัŒัŽ ะฒั‹ ะฑั‹ ะทะฐะบะพะฝั‡ะธะปะธ ะฝะฐะผะฝะพะณะพ ะฑั‹ัั‚ั€ะตะต, ะดะตะปะฐั ะฒััŽ ั€ะฐะฑะพั‚ัƒ **ะฟะฐั€ะฐะปะปะตะปัŒะฝะพ**. + +ะ’ ะพะฟะธัะฐะฝะฝะพะผ ัั†ะตะฝะฐั€ะธะธ ะบะฐะถะดั‹ะน ัƒะฑะพั€ั‰ะธะบ (ะฒะบะปัŽั‡ะฐั ะฒะฐั) ะฑั‹ะป ะฑั‹ ะธัะฟะพะปะฝะธั‚ะตะปะตะผ, ะทะฐะฝัั‚ั‹ะผ ะฝะฐ ัะฒะพั‘ะผ ัƒั‡ะฐัั‚ะบะต ั€ะฐะฑะพั‚ั‹. + +ะ˜ ะฟะพัะบะพะปัŒะบัƒ ะฑะพะปัŒัˆัƒัŽ ั‡ะฐัั‚ัŒ ะฒั€ะตะผะตะฝะธ ะฒั‹ะฟะพะปะฝะตะฝะธั ะทะฐะฝะธะผะฐะตั‚ ั€ะตะฐะปัŒะฝะฐั ั€ะฐะฑะพั‚ะฐ (ะฐ ะฝะต ะพะถะธะดะฐะฝะธะต), +ะฐ ั€ะฐะฑะพั‚ัƒ ะฒ ะบะพะผะฟัŒัŽั‚ะตั€ะต ะดะตะปะฐะตั‚ ะฆะŸ, +ั‚ะฐะบะธะต ะทะฐะดะฐั‡ะธ ะฝะฐะทั‹ะฒะฐัŽั‚ ะพะณั€ะฐะฝะธั‡ะตะฝะฝั‹ะผะธ ะฟั€ะพะธะทะฒะพะดะธั‚ะตะปัŒะฝะพัั‚ัŒัŽ ะฟั€ะพั†ะตััะพั€ะฐ. + +--- + +ะžะณั€ะฐะฝะธั‡ะตะฝะธะต ะฟะพ ะฟั€ะพั†ะตััะพั€ัƒ ะฟั€ะพัะฒะปัะตั‚ัั ะฒ ะพะฟะตั€ะฐั†ะธัั…, ะณะดะต ั‚ั€ะตะฑัƒะตั‚ัั ะฒั‹ะฟะพะปะฝัั‚ัŒ ัะปะพะถะฝั‹ะต ะผะฐั‚ะตะผะฐั‚ะธั‡ะตัะบะธะต ะฒั‹ั‡ะธัะปะตะฝะธั. + +ะะฐะฟั€ะธะผะตั€: + +* ะžะฑั€ะฐะฑะพั‚ะบะฐ **ะทะฒัƒะบะฐ** ะธะปะธ **ะธะทะพะฑั€ะฐะถะตะฝะธะน**. +* **ะšะพะผะฟัŒัŽั‚ะตั€ะฝะพะต ะทั€ะตะฝะธะต**: ะธะทะพะฑั€ะฐะถะตะฝะธะต ัะพัั‚ะพะธั‚ ะธะท ะผะธะปะปะธะพะฝะพะฒ ะฟะธะบัะตะปะตะน, ะฒ ะบะฐะถะดะพะผ ะฟะธะบัะตะปะต 3 ัะพัั‚ะฐะฒะปััŽั‰ะธั… ั†ะฒะตั‚ะฐ, +ะพะฑั€ะฐะฑะพั‚ะบะฐ ะพะฑั‹ั‡ะฝะพ ั‚ั€ะตะฑัƒะตั‚ ะฟั€ะพะฒะตะดะตะฝะธั ั€ะฐัั‡ั‘ั‚ะพะฒ ะฟะพ ะฒัะตะผ ะฟะธะบัะตะปัะผ ัั€ะฐะทัƒ. +* **ะœะฐัˆะธะฝะฝะพะต ะพะฑัƒั‡ะตะฝะธะต**: ะทะดะตััŒ ะพะฑั‹ั‡ะฝะพ ั‚ั€ะตะฑัƒะตั‚ัั ัƒะผะฝะพะถะตะฝะธะต "ะผะฐั‚ั€ะธั†" ะธ "ะฒะตะบั‚ะพั€ะพะฒ". +ะŸั€ะตะดัั‚ะฐะฒัŒั‚ะต ะณะธะณะฐะฝั‚ัะบัƒัŽ ั‚ะฐะฑะปะธั†ัƒ ั ั‡ะธัะปะฐะผะธ ะฒ ะญะบัะตะปะต, ะธ ะฒัะต ะธั… ะฝะฐะดะพ ะพะดะฝะพะฒั€ะตะผะตะฝะฝะพ ะฟะตั€ะตะผะฝะพะถะธั‚ัŒ. +* **ะ“ะปัƒะฑะพะบะพะต ะพะฑัƒั‡ะตะฝะธะต**: ัั‚ะพ ะพะฑะปะฐัั‚ัŒ *ะผะฐัˆะธะฝะฝะพะณะพ ะพะฑัƒั‡ะตะฝะธั*, ะฟะพัั‚ะพะผัƒ ััŽะดะฐ ะฟะพะดั…ะพะดะธั‚ ั‚ะพ ะถะต ะพะฟะธัะฐะฝะธะต. +ะŸั€ะพัั‚ะพ ัƒ ะฒะฐั ะฑัƒะดะตั‚ ะฝะต ะพะดะฝะฐ ั‚ะฐะฑะปะธั†ะฐ ะฒ ะญะบัะตะปะต, ะฐ ะผะฝะพะถะตัั‚ะฒะพ. ะ’ ั€ัะดะต ัะปัƒั‡ะฐะตะฒ ะธัะฟะพะปัŒะทัƒะตั‚ัั +ัะฟะตั†ะธะฐะปัŒะฝั‹ะน ะฟั€ะพั†ะตััะพั€ ะดะปั ัะพะทะดะฐะฝะธั ะธ / ะธะปะธ ะธัะฟะพะปัŒะทะพะฒะฐะฝะธั ะฟะพัั‚ั€ะพะตะฝะฝั‹ั… ั‚ะฐะบะธะผ ะพะฑั€ะฐะทะพะผ ะผะพะดะตะปะตะน. + +### ะšะพะฝะบัƒั€ะตะฝั‚ะฝะพัั‚ัŒ + ะฟะฐั€ะฐะปะปะตะปะธะทะผ: ะ’ะตะฑ + ะผะฐัˆะธะฝะฝะพะต ะพะฑัƒั‡ะตะฝะธะต + +**FastAPI** ะฟั€ะตะดะพัั‚ะฐะฒะปัะตั‚ ะฒะพะทะผะพะถะฝะพัั‚ะธ ะบะพะฝะบัƒั€ะตั‚ะฝะพะณะพ ะฟั€ะพะณั€ะฐะผะผะธั€ะพะฒะฐะฝะธั, +ะบะพั‚ะพั€ะพะต ะพั‡ะตะฝัŒ ั€ะฐัะฟั€ะพัั‚ั€ะฐะฝะตะฝะพ ะฒ ะฒะตะฑ-ั€ะฐะทั€ะฐะฑะพั‚ะบะต (ะธะผะตะฝะฝะพ ัั‚ะธะผ ัะปะฐะฒะธั‚ัั NodeJS). + +ะšั€ะพะผะต ั‚ะพะณะพ ะฒั‹ ัะผะพะถะตั‚ะต ะธัะฟะพะปัŒะทะพะฒะฐั‚ัŒ ะฒัะต ะฟั€ะตะธะผัƒั‰ะตัั‚ะฒะฐ ะฟะฐั€ะฐะปะปะตะปะธะทะผะฐ ะธ +ะผะฝะพะณะพะฟั€ะพั†ะตััะพั€ะฝะพัั‚ะธ (ะบะพะณะดะฐ ะฝะตัะบะพะปัŒะบะพ ะฟั€ะพั†ะตััะพะฒ ั€ะฐะฑะพั‚ะฐัŽั‚ ะฟะฐั€ะฐะปะปะตะปัŒะฝะพ), +ะตัะปะธ ั€ะฐะฑะพั‡ะฐั ะฝะฐะณั€ัƒะทะบะฐ ะฟั€ะตะดะฟะพะปะฐะณะฐะตั‚ **ะพะณั€ะฐะฝะธั‡ะตะฝะธะต ะฟะพ ะฟั€ะพั†ะตััะพั€ัƒ**, +ะบะฐะบ, ะฝะฐะฟั€ะธะผะตั€, ะฒ ัะธัั‚ะตะผะฐั… ะผะฐัˆะธะฝะฝะพะณะพ ะพะฑัƒั‡ะตะฝะธั. + +ะะตะพะฑั…ะพะดะธะผะพ ั‚ะฐะบะถะต ะพั‚ะผะตั‚ะธั‚ัŒ, ั‡ั‚ะพ Python ัะฒะปัะตั‚ัั ะณะปะฐะฒะฝั‹ะผ ัะทั‹ะบะพะผ ะฒ ะพะฑะปะฐัั‚ะธ +**ะดะฐั‚ะฐ-ัะฐะนะตะฝั**, +ะผะฐัˆะธะฝะฝะพะณะพ ะพะฑัƒั‡ะตะฝะธั ะธ, ะพัะพะฑะตะฝะฝะพ, ะณะปัƒะฑะพะบะพะณะพ ะพะฑัƒั‡ะตะฝะธั. ะ’ัั‘ ัั‚ะพ ะดะตะปะฐะตั‚ FastAPI +ะพั‚ะปะธั‡ะฝั‹ะผ ะฒะฐั€ะธะฐะฝั‚ะพะผ (ัั€ะตะดะธ ะผะฝะพะณะธั… ะดั€ัƒะณะธั…) ะดะปั ั€ะฐะทั€ะฐะฑะพั‚ะบะธ ะฒะตะฑ-API ะธ ะฟั€ะธะปะพะถะตะฝะธะน +ะฒ ะพะฑะปะฐัั‚ะธ ะดะฐั‚ะฐ-ัะฐะนะตะฝั / ะผะฐัˆะธะฝะฝะพะณะพ ะพะฑัƒั‡ะตะฝะธั. + +ะšะฐะบ ะดะพะฑะธั‚ัŒัั ั‚ะฐะบะพะณะพ ะฟะฐั€ะฐะปะปะตะปะธะทะผะฐ ะฒ ัะบัะฟะปัƒะฐั‚ะฐั†ะธะธ ะพะฟะธัะฐะฝะพ ะฒ ั€ะฐะทะดะตะปะต [ะ ะฐะทะฒั‘ั€ั‚ั‹ะฒะฐะฝะธะต](deployment/index.md){.internal-link target=_blank}. + +## `async` ะธ `await` + +ะ’ ัะพะฒั€ะตะผะตะฝะฝั‹ั… ะฒะตั€ัะธัั… Python ั€ะฐะทั€ะฐะฑะพั‚ะบะฐ ะฐัะธะฝั…ั€ะพะฝะฝะพะณะพ ะบะพะดะฐ ั€ะตะฐะปะธะทะพะฒะฐะฝะฐ ะพั‡ะตะฝัŒ ะธะฝั‚ัƒะธั‚ะธะฒะฝะพ. +ะžะฝ ะฒั‹ะณะปัะดะธั‚ ะบะฐะบ ะพะฑั‹ั‡ะฝั‹ะน "ะฟะพัะปะตะดะพะฒะฐั‚ะตะปัŒะฝั‹ะน" ะบะพะด ะธ ัะฐะผะพัั‚ะพัั‚ะตะปัŒะฝะพ ะฒั‹ะฟะพะปะฝัะตั‚ "ะพะถะธะดะฐะฝะธะต", ะบะพะณะดะฐ ัั‚ะพ ะฝะตะพะฑั…ะพะดะธะผะพ. + +ะ•ัะปะธ ะฝะตะบะฐั ะพะฟะตั€ะฐั†ะธั ั‚ั€ะตะฑัƒะตั‚ ะพะถะธะดะฐะฝะธั ะฟะตั€ะตะด ั‚ะตะผ, ะบะฐะบ ะฒะตั€ะฝัƒั‚ัŒ ั€ะตะทัƒะปัŒั‚ะฐั‚, ะธ +ะฟะพะดะดะตั€ะถะธะฒะฐะตั‚ ัะพะฒั€ะตะผะตะฝะฝั‹ะต ะฒะพะทะผะพะถะฝะพัั‚ะธ Python, ะบะพะด ะผะพะถะฝะพ ะฝะฐะฟะธัะฐั‚ัŒ ัะปะตะดัƒัŽั‰ะธะผ ะพะฑั€ะฐะทะพะผ: + +```Python +burgers = await get_burgers(2) +``` + +ะ“ะปะฐะฒะฝะพะต ะทะดะตััŒ ัะปะพะฒะพ `await`. ะžะฝะพ ัะพะพะฑั‰ะฐะตั‚ ะธะฝั‚ะตั€ะฟั€ะตั‚ะฐั‚ะพั€ัƒ, ั‡ั‚ะพ ะฝะตะพะฑั…ะพะดะธะผะพ ะดะพะถะดะฐั‚ัŒัั โธ +ะฟะพะบะฐ `get_burgers(2)` ะทะฐะบะพะฝั‡ะธั‚ ัะฒะพะธ ะดะตะปะฐ ๐Ÿ•™, ะธ ั‚ะพะปัŒะบะพ ะฟะพัะปะต ัั‚ะพะณะพ ัะพั…ั€ะฐะฝะธั‚ัŒ ั€ะตะทัƒะปัŒั‚ะฐั‚ ะฒ `burgers`. +ะ—ะฝะฐั ัั‚ะพ, Python ะผะพะถะตั‚ ะฟะพะบะฐ ะฟะตั€ะตะบะปัŽั‡ะธั‚ัŒัั ะฝะฐ ะฒั‹ะฟะพะปะฝะตะฝะธะต ะดั€ัƒะณะธั… ะทะฐะดะฐั‡ ๐Ÿ”€ โฏ +(ะฝะฐะฟั€ะธะผะตั€ ะฟะพะปัƒั‡ะตะฝะธะต ัะปะตะดัƒัŽั‰ะตะณะพ ะทะฐะฟั€ะพัะฐ). + +ะงั‚ะพะฑั‹ ะบะปัŽั‡ะตะฒะพะต ัะปะพะฒะพ `await` ัั€ะฐะฑะพั‚ะฐะปะพ, ะพะฝะพ ะดะพะปะถะฝะพ ะฝะฐั…ะพะดะธั‚ัŒัั ะฒะฝัƒั‚ั€ะธ ั„ัƒะฝะบั†ะธะธ, +ะบะพั‚ะพั€ะฐั ะฟะพะดะดะตั€ะถะธะฒะฐะตั‚ ะฐัะธะฝั…ั€ะพะฝะฝะพัั‚ัŒ. ะ”ะปั ัั‚ะพะณะพ ะฒะฐะผ ะฟั€ะพัั‚ะพ ะฝัƒะถะฝะพ ะพะฑัŠัะฒะธั‚ัŒ ะตั‘ ะบะฐะบ `async def`: + +```Python hl_lines="1" +async def get_burgers(number: int): + # ะ“ะพั‚ะพะฒะธะผ ะฑัƒั€ะณะตั€ั‹ ะฟะพ ัะฟะตั†ะธะฐะปัŒะฝะพะผัƒ ะฐัะธะฝั…ั€ะพะฝะฝะพะผัƒ ั€ะตั†ะตะฟั‚ัƒ + return burgers +``` + +...ะฒะผะตัั‚ะพ `def`: + +```Python hl_lines="2" +# ะญั‚ะพ ะฝะต ะฐัะธะฝั…ั€ะพะฝะฝั‹ะน ะบะพะด +def get_sequential_burgers(number: int): + # ะ“ะพั‚ะพะฒะธะผ ะฑัƒั€ะณะตั€ั‹ ะฟะพัะปะตะดะพะฒะฐั‚ะตะปัŒะฝะพ ะฟะพ ัˆะฐะณะฐะผ + return burgers +``` + +ะžะฑัŠัะฒะปะตะฝะธะต `async def` ัƒะบะฐะทั‹ะฒะฐะตั‚ ะธะฝั‚ะตั€ะฟั€ะตั‚ะฐั‚ะพั€ัƒ, ั‡ั‚ะพ ะฒะฝัƒั‚ั€ะธ ัั‚ะพะน ั„ัƒะฝะบั†ะธะธ +ัะปะตะดัƒะตั‚ ะพะถะธะดะฐั‚ัŒ ะฒั‹ั€ะฐะถะตะฝะธะน `await`, ะธ ั‡ั‚ะพ ะผะพะถะฝะพ ะฟะพัั‚ะฐะฒะธั‚ัŒ ะฒั‹ะฟะพะปะฝะตะฝะธะต ั‚ะฐะบะพะน ั„ัƒะฝะบั†ะธะธ ะฝะฐ "ะฟะฐัƒะทัƒ" โธ ะธ +ะฟะตั€ะตะบะปัŽั‡ะธั‚ัŒัั ะฝะฐ ะดั€ัƒะณะธะต ะทะฐะดะฐั‡ะธ ๐Ÿ”€, ั ั‚ะตะผ ั‡ั‚ะพะฑั‹ ะฒะตั€ะฝัƒั‚ัŒัั ััŽะดะฐ ะฟะพะทะถะต. + +ะ•ัะปะธ ะฒั‹ ั…ะพั‚ะธั‚ะต ะฒั‹ะทะฒะฐั‚ัŒ ั„ัƒะฝะบั†ะธัŽ ั `async def`, ะฒะฐะผ ะฝัƒะถะฝะพ "ะพะถะธะดะฐั‚ัŒ" ะตั‘. +ะŸะพัั‚ะพะผัƒ ั‚ะฐะบะพะต ะฝะต ัั€ะฐะฑะพั‚ะฐะตั‚: + +```Python +# ะญั‚ะพ ะฝะต ะทะฐั€ะฐะฑะพั‚ะฐะตั‚, ะฟะพัะบะพะปัŒะบัƒ get_burgers ะพะฑัŠัะฒะปะตะฝะฐ ั ะธัะฟะพะปัŒะทะพะฒะฐะฝะธะตะผ async def +burgers = get_burgers(2) +``` + +--- + +ะ•ัะปะธ ัั‚ะพั€ะพะฝะฝัั ะฑะธะฑะปะธะพั‚ะตะบะฐ ั‚ั€ะตะฑัƒะตั‚ ะฒั‹ะทั‹ะฒะฐั‚ัŒ ะตั‘ ั ะบะปัŽั‡ะตะฒั‹ะผ ัะปะพะฒะพะผ `await`, +ะฝะตะพะฑั…ะพะดะธะผะพ ะฟะธัะฐั‚ัŒ *ั„ัƒะฝะบั†ะธะธ ะพะฑั€ะฐะฑะพั‚ะบะธ ะฟัƒั‚ะธ* ั ะธัะฟะพะปัŒะทะพะฒะฐะฝะธะตะผ `async def`, ะฝะฐะฟั€ะธะผะตั€: + +```Python hl_lines="2-3" +@app.get('/burgers') +async def read_burgers(): + burgers = await get_burgers(2) + return burgers +``` + +### ะขะตั…ะฝะธั‡ะตัะบะธะต ะฟะพะดั€ะพะฑะฝะพัั‚ะธ + +ะšะฐะบ ะฒั‹ ะผะพะณะปะธ ะทะฐะผะตั‚ะธั‚ัŒ, `await` ะผะพะถะตั‚ ะฟั€ะธะผะตะฝัั‚ัŒัั ั‚ะพะปัŒะบะพ ะฒ ั„ัƒะฝะบั†ะธัั…, ะพะฑัŠัะฒะปะตะฝะฝั‹ั… ั ะธัะฟะพะปัŒะทะพะฒะฐะฝะธะตะผ `async def`. + + +ะะพ ะฒั‹ะฟะพะปะฝะตะฝะธะต ั‚ะฐะบะพะน ั„ัƒะฝะบั†ะธะธ ะฝะตะพะฑั…ะพะดะธะผะพ "ะพะถะธะดะฐั‚ัŒ" ั ะฟะพะผะพั‰ัŒัŽ `await`. +ะญั‚ะพ ะพะทะฝะฐั‡ะฐะตั‚, ั‡ั‚ะพ ะตั‘ ะผะพะถะฝะพ ะฒั‹ะทะฒะฐั‚ัŒ ั‚ะพะปัŒะบะพ ะธะท ะดั€ัƒะณะพะน ั„ัƒะฝะบั†ะธะธ, ะบะพั‚ะพั€ะฐั ั‚ะพะถะต ะพะฑัŠัะฒะปะตะฝะฐ ั `async def`. + +ะะพ ะบะฐะบ ะถะต ั‚ะพะณะดะฐ ะฟะพัะฒะธะปะฐััŒ ะฟะตั€ะฒะฐั ะบัƒั€ะธั†ะฐ? ะ’ ัะผั‹ัะปะต... ะบะฐะบ ะฝะฐะผ ะฒั‹ะทะฒะฐั‚ัŒ ะฟะตั€ะฒัƒัŽ ะฐัะธะฝั…ั€ะพะฝะฝัƒัŽ ั„ัƒะฝะบั†ะธัŽ? + +ะŸั€ะธ ั€ะฐะฑะพั‚ะต ั **FastAPI** ะฟั€ะพัั‚ะพ ะฝะต ะดัƒะผะฐะนั‚ะต ะพะฑ ัั‚ะพะผ, ะฟะพั‚ะพะผัƒ ั‡ั‚ะพ "ะฟะตั€ะฒะพะน" ั„ัƒะฝะบั†ะธะตะน ัะฒะปัะตั‚ัั ะฒะฐัˆะฐ *ั„ัƒะฝะบั†ะธั ะพะฑั€ะฐะฑะพั‚ะบะธ ะฟัƒั‚ะธ*, +ะธ ะดะฐะปัŒัˆะต ั ัั‚ะธะผ ั€ะฐะทะฑะตั€ั‘ั‚ัั FastAPI. + +ะšั€ะพะผะต ั‚ะพะณะพ, ะตัะปะธ ั…ะพั‚ะธั‚ะต, ะฒั‹ ะผะพะถะตั‚ะต ะธัะฟะพะปัŒะทะพะฒะฐั‚ัŒ ัะธะฝั‚ะฐะบัะธั `async` / `await` ะธ ะฑะตะท FastAPI. + +### ะŸะธัˆะธั‚ะต ัะฒะพะน ะฐัะธะฝั…ั€ะพะฝะฝั‹ะน ะบะพะด + +Starlette (ะธ **FastAPI**) ะพัะฝะพะฒะฐะฝั‹ ะฝะฐ AnyIO, ั‡ั‚ะพ ะดะตะปะฐะตั‚ ะธั… ัะพะฒะผะตัั‚ะธะผั‹ะผะธ ะบะฐะบ ัะพ ัั‚ะฐะฝะดะฐั€ั‚ะฝะพะน ะฑะธะฑะปะธะพั‚ะตะบะพะน asyncio ะฒ Python, ั‚ะฐะบ ะธ ั Trio. + +ะ’ ั‡ะฐัั‚ะฝะพัั‚ะธ, ะฒั‹ ะผะพะถะตั‚ะต ะฝะฐะฟั€ัะผัƒัŽ ะธัะฟะพะปัŒะทะพะฒะฐั‚ัŒ AnyIO ะฒ ั‚ะตั… ะฟั€ะพะตะบั‚ะฐั…, ะณะดะต ั‚ั€ะตะฑัƒะตั‚ัั ะฑะพะปะตะต ัะปะพะถะฝะฐั ะปะพะณะธะบะฐ ั€ะฐะฑะพั‚ั‹ ั ะบะพะฝะบัƒั€ะตะฝั‚ะฝะพัั‚ัŒัŽ. + +ะ”ะฐะถะต ะตัะปะธ ะฒั‹ ะฝะต ะธัะฟะพะปัŒะทัƒะตั‚ะต FastAPI, ะฒั‹ ะผะพะถะตั‚ะต ะฟะธัะฐั‚ัŒ ะฐัะธะฝั…ั€ะพะฝะฝั‹ะต ะฟั€ะธะปะพะถะตะฝะธั ั ะฟะพะผะพั‰ัŒัŽ AnyIO, ั‡ั‚ะพะฑั‹ ะพะฝะธ ะฑั‹ะปะธ ะผะฐะบัะธะผะฐะปัŒะฝะพ ัะพะฒะผะตัั‚ะธะผั‹ะผะธ ะธ ะฟะพะปัƒั‡ะฐะปะธ ะตะณะพ ะฟั€ะตะธะผัƒั‰ะตัั‚ะฒะฐ (ะฝะฐะฟั€ะธะผะตั€ *ัั‚ั€ัƒะบั‚ัƒั€ะฝัƒัŽ ะบะพะฝะบัƒั€ะตะฝั‚ะฝะพัั‚ัŒ*). + +### ะ”ั€ัƒะณะธะต ะฒะธะดั‹ ะฐัะธะฝั…ั€ะพะฝะฝะพะณะพ ะฟั€ะพะณั€ะฐะผะผะธั€ะพะฒะฐะฝะธั + +ะกั‚ะธะปัŒ ะฝะฐะฟะธัะฐะฝะธั ะบะพะดะฐ ั `async` ะธ `await` ะฟะพัะฒะธะปัั ะฒ ัะทั‹ะบะต Python ะพั‚ะฝะพัะธั‚ะตะปัŒะฝะพ ะฝะตะดะฐะฒะฝะพ. + +ะะพ ะพะฝ ัะธะปัŒะฝะพ ะพะฑะปะตะณั‡ะฐะตั‚ ั€ะฐะฑะพั‚ัƒ ั ะฐัะธะฝั…ั€ะพะฝะฝั‹ะผ ะบะพะดะพะผ. + +ะ ะพะฒะฝะพ ั‚ะฐะบะพะน ะถะต ัะธะฝั‚ะฐะบัะธั (ะฝัƒ ะธะปะธ ะฟะพั‡ั‚ะธ ั‚ะฐะบะพะน ะถะต) ะฝะตะดะฐะฒะฝะพ ะฑั‹ะป ะฒะบะปัŽั‡ั‘ะฝ ะฒ ัะพะฒั€ะตะผะตะฝะฝั‹ะต ะฒะตั€ัะธะธ JavaScript (ะฒ ะฑั€ะฐัƒะทะตั€ะต ะธ NodeJS). + +ะ”ะพ ัั‚ะพะณะพ ะฟะพะดะดะตั€ะถะบะฐ ะฐัะธะฝั…ั€ะพะฝะฝะพะณะพ ะบะพะดะฐ ะฑั‹ะปะฐ ั€ะตะฐะปะธะทะพะฒะฐะฝะฐ ะฝะฐะผะฝะพะณะพ ัะปะพะถะฝะตะต, ะธ ะตะณะพ ะฑั‹ะปะพ ั‚ั€ัƒะดะฝะตะต ะฒะพัะฟั€ะธะฝะธะผะฐั‚ัŒ. + +ะ’ ะฟั€ะตะดั‹ะดัƒั‰ะธั… ะฒะตั€ัะธัั… Python ะดะปั ัั‚ะพะณะพ ะธัะฟะพะปัŒะทะพะฒะฐะปะธััŒ ะฟะพั‚ะพะบะธ ะธะปะธ Gevent. ะะพ ั‚ะฐะบะพะน ะบะพะด ะฝะฐะผะฝะพะณะพ ัะปะพะถะฝะตะต ะฟะพะฝะธะผะฐั‚ัŒ, ะพั‚ะปะฐะถะธะฒะฐั‚ัŒ ะธ ะผั‹ัะปะตะฝะฝะพ ะฟั€ะตะดัั‚ะฐะฒะปัั‚ัŒ. + +ะงั‚ะพ ะบะฐัะฐะตั‚ัั JavaScript (ะฒ ะฑั€ะฐัƒะทะตั€ะต ะธ NodeJS), ั€ะฐะฝัŒัˆะต ั‚ะฐะผ ะธัะฟะพะปัŒะทะพะฒะฐะปะธ ะดะปั ัั‚ะพะน ั†ะตะปะธ +"ะพะฑั€ะฐั‚ะฝั‹ะต ะฒั‹ะทะพะฒั‹". ะงั‚ะพ ะฒั‹ะปะธะฒะฐะปะพััŒ ะฒ +ะฐะด ะพะฑั€ะฐั‚ะฝั‹ั… ะฒั‹ะทะพะฒะพะฒ. + +## ะกะพะฟั€ะพะณั€ะฐะผะผั‹ + +**ะšะพั€ัƒั‚ะธฬะฝะฐ** (ะธะปะธ ะถะต ัะพะฟั€ะพะณั€ะฐะผะผะฐ) โ€” ัั‚ะพ ะบั€ัƒั‚ะพะต ัะปะพะฒะตั‡ะบะพ ะดะปั ะธะผะตะฝะพะฒะฐะฝะธั ั‚ะพะน ััƒั‰ะฝะพัั‚ะธ, +ะบะพั‚ะพั€ัƒัŽ ะฒะพะทะฒั€ะฐั‰ะฐะตั‚ ั„ัƒะฝะบั†ะธั `async def`. Python ะทะฝะฐะตั‚, ั‡ั‚ะพ ะตั‘ ะผะพะถะฝะพ ะทะฐะฟัƒัั‚ะธั‚ัŒ, ะบะฐะบ ะธ ะพะฑั‹ั‡ะฝัƒัŽ ั„ัƒะฝะบั†ะธัŽ, +ะฝะพ ะบั€ะพะผะต ั‚ะพะณะพ ัะพะฟั€ะพะณั€ะฐะผะผัƒ ะผะพะถะฝะพ ะฟะพัั‚ะฐะฒะธั‚ัŒ ะฝะฐ ะฟะฐัƒะทัƒ โธ ะฒ ั‚ะพะผ ะผะตัั‚ะต, ะณะดะต ะฒัั‚ั€ะตั‚ะธั‚ัั ัะปะพะฒะพ `await`. + +ะ’ััŽ ั„ัƒะฝะบั†ะธะพะฝะฐะปัŒะฝะพัั‚ัŒ ะฐัะธะฝั…ั€ะพะฝะฝะพะณะพ ะฟั€ะพะณั€ะฐะผะผะธั€ะพะฒะฐะฝะธั ั ะธัะฟะพะปัŒะทะพะฒะฐะฝะธะตะผ `async` ะธ `await` +ั‡ะฐัั‚ะพ ะพะฑะพะฑั‰ะฐัŽั‚ ัะปะพะฒะพะผ "ะบะพั€ัƒั‚ะธะฝั‹". ะžะฝะธ ะฐะฝะฐะปะพะณะธั‡ะฝั‹ "ะณะพั€ัƒั‚ะธะฝะฐะผ", ะบะปัŽั‡ะตะฒะพะน ะพัะพะฑะตะฝะฝะพัั‚ะธ +ัะทั‹ะบะฐ Go. + +## ะ—ะฐะบะปัŽั‡ะตะฝะธะต + +ะ’ ัะฐะผะพะผ ะฝะฐั‡ะฐะปะต ะฑั‹ะปะฐ ั‚ะฐะบะฐั ั„ั€ะฐะทะฐ: + +> ะกะพะฒั€ะตะผะตะฝะฝั‹ะต ะฒะตั€ัะธะธ Python ะฟะพะดะดะตั€ะถะธะฒะฐัŽั‚ ั€ะฐะทั€ะฐะฑะพั‚ะบัƒ ั‚ะฐะบ ะฝะฐะทั‹ะฒะฐะตะผะพะณะพ +**"ะฐัะธะฝั…ั€ะพะฝะฝะพะณะพ ะบะพะดะฐ"** ะฟะพัั€ะตะดัั‚ะฒะพะผ ะฝะฐะฟะธัะฐะฝะธั **"ัะพะฟั€ะพะณั€ะฐะผะผ"** ั ะธัะฟะพะปัŒะทะพะฒะฐะฝะธะตะผ +ัะธะฝั‚ะฐะบัะธัะฐ **`async` ะธ `await`**. + +ะขะตะฟะตั€ัŒ ะฒัั‘ ะดะพะปะถะฝะพ ะทะฒัƒั‡ะฐั‚ัŒ ะฟะพะฝัั‚ะฝะตะต. โœจ + +ะะฐ ัั‚ะพะผ ะพัะฝะพะฒะฐะฝะฐ ั€ะฐะฑะพั‚ะฐ FastAPI (ะฟะพัั€ะตะดัั‚ะฒะพะผ Starlette), ะธ ะธะผะตะฝะฝะพ ัั‚ะพ +ะพะฑะตัะฟะตั‡ะธะฒะฐะตั‚ ะตะณะพ ะฒั‹ัะพะบัƒัŽ ะฟั€ะพะธะทะฒะพะดะธั‚ะตะปัŒะฝะพัั‚ัŒ. + +## ะžั‡ะตะฝัŒ ั‚ะตั…ะฝะธั‡ะตัะบะธะต ะฟะพะดั€ะพะฑะฝะพัั‚ะธ + +!!! warning + ะญั‚ะพั‚ ั€ะฐะทะดะตะป ั‡ะธั‚ะฐั‚ัŒ ะฝะต ะพะฑัะทะฐั‚ะตะปัŒะฝะพ. + + ะ—ะดะตััŒ ะฟั€ะธะฒะพะดัั‚ัั ะฟะพะดั€ะพะฑะฝะพัั‚ะธ ะฒะฝัƒั‚ั€ะตะฝะฝะตะณะพ ัƒัั‚ั€ะพะนัั‚ะฒะฐ **FastAPI**. + + ะะพ ะตัะปะธ ะฒั‹ ะพะฑะปะฐะดะฐะตั‚ะต ั‚ะตั…ะฝะธั‡ะตัะบะธะผะธ ะทะฝะฐะฝะธัะผะธ (ะบะพั€ัƒั‚ะธะฝั‹, ะฟะพั‚ะพะบะธ, ะฑะปะพะบะธั€ะพะฒะบะฐ ะธ ั‚. ะด.) + ะธ ะฒะฐะผ ะธะฝั‚ะตั€ะตัะฝะพ, ะบะฐะบ FastAPI ะพะฑั€ะฐะฑะฐั‚ั‹ะฒะฐะตั‚ `async def` ะฒ ะพั‚ะปะธั‡ะธะต ะพั‚ ะพะฑั‹ั‡ะฝั‹ั… `def`, + ั‡ะธั‚ะฐะนั‚ะต ะดะฐะปัŒัˆะต. + +### ะคัƒะฝะบั†ะธะธ ะพะฑั€ะฐะฑะพั‚ะบะธ ะฟัƒั‚ะธ + +ะšะพะณะดะฐ ะฒั‹ ะพะฑัŠัะฒะปัะตั‚ะต *ั„ัƒะฝะบั†ะธัŽ ะพะฑั€ะฐะฑะพั‚ะบะธ ะฟัƒั‚ะธ* ะพะฑั‹ั‡ะฝั‹ะผ ะพะฑั€ะฐะทะพะผ ั ะบะปัŽั‡ะตะฒั‹ะผ ัะปะพะฒะพะผ `def` +ะฒะผะตัั‚ะพ `async def`, FastAPI ะพะถะธะดะฐะตั‚ ะตั‘ ะฒั‹ะฟะพะปะฝะตะฝะธั, ะทะฐะฟัƒัั‚ะธะฒ ั„ัƒะฝะบั†ะธัŽ ะฒะพ ะฒะฝะตัˆะฝะตะผ +ะฟัƒะปะต ะฟะพั‚ะพะบะพะฒ, ะฐ ะฝะต ะฝะฐะฟั€ัะผัƒัŽ (ัั‚ะพ ะฑั‹ ะทะฐะฑะปะพะบะธั€ะพะฒะฐะปะพ ัะตั€ะฒะตั€). + +ะ•ัะปะธ ั€ะฐะฝะตะต ะฒั‹ ะธัะฟะพะปัŒะทะพะฒะฐะปะธ ะดั€ัƒะณะพะน ะฐัะธะฝั…ั€ะพะฝะฝั‹ะน ั„ั€ะตะนะผะฒะพั€ะบ, ะบะพั‚ะพั€ั‹ะน ั€ะฐะฑะพั‚ะฐะตั‚ ะธะฝะฐั‡ะต, +ะธ ะฟั€ะธะฒั‹ะบะปะธ ะพะฑัŠัะฒะปัั‚ัŒ ะฟั€ะพัั‚ั‹ะต ะฒั‹ั‡ะธัะปะธั‚ะตะปัŒะฝั‹ะต *ั„ัƒะฝะบั†ะธะธ* ั‡ะตั€ะตะท `def` ั€ะฐะดะธ +ะฝะตะทะฝะฐั‡ะธั‚ะตะปัŒะฝะพะณะพ ะฟั€ะธั€ะพัั‚ะฐ ัะบะพั€ะพัั‚ะธ (ะฟะพั€ัะดะบะฐ 100 ะฝะฐะฝะพัะตะบัƒะฝะด), ะพะฑั€ะฐั‚ะธั‚ะต ะฒะฝะธะผะฐะฝะธะต, +ั‡ั‚ะพ ั **FastAPI** ะฒั‹ ะฟะพะปัƒั‡ะธั‚ะต ะฟั€ะพั‚ะธะฒะพะฟะพะปะพะถะฝั‹ะน ัั„ั„ะตะบั‚. ะ’ ั‚ะฐะบะพะผ ัะปัƒั‡ะฐะต ะฑะพะปัŒัˆะต ะฟะพะดั…ะพะดะธั‚ +`async def`, ะตัะปะธ ั‚ะพะปัŒะบะพ *ั„ัƒะฝะบั†ะธั ะพะฑั€ะฐะฑะพั‚ะบะธ ะฟัƒั‚ะธ* ะฝะต ะธัะฟะพะปัŒะทัƒะตั‚ ะบะพะด, ะฟั€ะธะฒะพะดัั‰ะธะน +ะบ ะฑะปะพะบะธั€ะพะฒะบะต I/O. + + + +ะะพ ะฒ ะปัŽะฑะพะผ ัะปัƒั‡ะฐะต ะฒะตะปะธะบะฐ ะฒะตั€ะพัั‚ะฝะพัั‚ัŒ, ั‡ั‚ะพ **FastAPI** [ะพะบะฐะถะตั‚ัั ะฑั‹ัั‚ั€ะตะต](/#performance){.internal-link target=_blank} +ะดั€ัƒะณะพะณะพ ั„ั€ะตะนะผะฒะพั€ะบะฐ (ะธะปะธ ั…ะพั‚ั ะฑั‹ ะฝะฐ ัƒั€ะพะฒะฝะต ั ะฝะธะผ). + +### ะ—ะฐะฒะธัะธะผะพัั‚ะธ + +ะขะพ ะถะต ะพั‚ะฝะพัะธั‚ัั ะบ ะทะฐะฒะธัะธะผะพัั‚ัะผ. ะ•ัะปะธ ัั‚ะพ ะพะฑั‹ั‡ะฝะฐั ั„ัƒะฝะบั†ะธั `def`, ะฐ ะฝะต `async def`, +ะพะฝะฐ ะทะฐะฟัƒัะบะฐะตั‚ัั ะฒะพ ะฒะฝะตัˆะฝะตะผ ะฟัƒะปะต ะฟะพั‚ะพะบะพะฒ. + +### ะŸะพะดะทะฐะฒะธัะธะผะพัั‚ะธ + +ะ’ั‹ ะผะพะถะตั‚ะต ะพะฑัŠัะฒะธั‚ัŒ ะผะฝะพะถะตัั‚ะฒะพ ััั‹ะปะฐัŽั‰ะธั…ัั ะดั€ัƒะณ ะฝะฐ ะดั€ัƒะณะฐ ะทะฐะฒะธัะธะผะพัั‚ะตะน ะธ ะฟะพะดะทะฐะฒะธัะธะผะพัั‚ะตะน +(ะฒ ะฒะธะดะต ะฟะฐั€ะฐะผะตั‚ั€ะพะฒ ะฟั€ะธ ะพะฟั€ะตะดะตะปะตะฝะธะธ ั„ัƒะฝะบั†ะธะธ). ะšะฐะบะธะต-ั‚ะพ ะฑัƒะดัƒั‚ ัะพะทะดะฐะฝั‹ ั ะฟะพะผะพั‰ัŒัŽ `async def`, +ะดั€ัƒะณะธะต ะพะฑั‹ั‡ะฝั‹ะผ ะพะฑั€ะฐะทะพะผ ั‡ะตั€ะตะท `def`, ะธ ั‚ะฐะบะฐั ัั…ะตะผะฐ ะฒะฟะพะปะฝะต ั€ะฐะฑะพั‚ะพัะฟะพัะพะฑะฝะฐ. ะคัƒะฝะบั†ะธะธ, +ะพะฑัŠัะฒะปะตะฝะฝั‹ะต ั ะฟะพะผะพั‰ัŒัŽ `def` ะฑัƒะดัƒั‚ ะทะฐะฟัƒัะบะฐั‚ัŒัั ะฝะฐ ะฒะฝะตัˆะฝะตะผ ะฟะพั‚ะพะบะต (ะธะท ะฟัƒะปะฐ), +ะฐ ะฝะต ั ะฟะพะผะพั‰ัŒัŽ `await`. + +### ะ”ั€ัƒะณะธะต ัะปัƒะถะตะฑะฝั‹ะต ั„ัƒะฝะบั†ะธะธ + +ะ›ัŽะฑั‹ะต ะดั€ัƒะณะธะต ัะปัƒะถะตะฑะฝั‹ะต ั„ัƒะฝะบั†ะธะธ, ะบะพั‚ะพั€ั‹ะต ะฒั‹ ะฒั‹ะทั‹ะฒะฐะตั‚ะต ะฝะฐะฟั€ัะผัƒัŽ, ะผะพะถะฝะพ ะพะฑัŠัะฒะปัั‚ัŒ +ั ะธัะฟะพะปัŒะทะพะฒะฐะฝะธะตะผ `def` ะธะปะธ `async def`. FastAPI ะฝะต ะฑัƒะดะตั‚ ะฒะปะธัั‚ัŒ ะฝะฐ ั‚ะพ, ะบะฐะบ ะฒั‹ +ะธั… ะทะฐะฟัƒัะบะฐะตั‚ะต. + +ะญั‚ะธะผ ะพะฝะธ ะพั‚ะปะธั‡ะฐัŽั‚ัั ะพั‚ ั„ัƒะฝะบั†ะธะน, ะบะพั‚ะพั€ั‹ะต FastAPI ะฒั‹ะทั‹ะฒะฐะตั‚ ัะฐะผะพัั‚ะพัั‚ะตะปัŒะฝะพ: +*ั„ัƒะฝะบั†ะธะธ ะพะฑั€ะฐะฑะพั‚ะบะธ ะฟัƒั‚ะธ* ะธ ะทะฐะฒะธัะธะผะพัั‚ะธ. + +ะ•ัะปะธ ัะปัƒะถะตะฑะฝะฐั ั„ัƒะฝะบั†ะธั ะพะฑัŠัะฒะปะตะฝะฐ ั ะฟะพะผะพั‰ัŒัŽ `def`, ะพะฝะฐ ะฑัƒะดะตั‚ ะฒั‹ะทะฒะฐะฝะฐ ะฝะฐะฟั€ัะผัƒัŽ +(ะบะฐะบ ะฒั‹ ะธ ะฝะฐะฟะธัะฐะปะธ ะฒ ะบะพะดะต), ะฐ ะฝะต ะฒ ะพั‚ะดะตะปัŒะฝะพะผ ะฟะพั‚ะพะบะต. ะ•ัะปะธ ะถะต ะพะฝะฐ ะพะฑัŠัะฒะปะตะฝะฐ ั +ะฟะพะผะพั‰ัŒัŽ `async def`, ะตั‘ ะฒั‹ะทะพะฒ ะดะพะปะถะตะฝ ะพััƒั‰ะตัั‚ะฒะปัั‚ัŒัั ั ะพะถะธะดะฐะฝะธะตะผ ั‡ะตั€ะตะท `await`. + +--- + + +ะ•ั‰ั‘ ั€ะฐะท ะฟะพะฒั‚ะพั€ะธะผ, ั‡ั‚ะพ ะฒัะต ัั‚ะธ ั‚ะตั…ะฝะธั‡ะตัะบะธะต ะฟะพะดั€ะพะฑะฝะพัั‚ะธ ะฟะพะปะตะทะฝั‹, ั‚ะพะปัŒะบะพ ะตัะปะธ ะฒั‹ ัะฟะตั†ะธะฐะปัŒะฝะพ ะธั… ะธัะบะฐะปะธ. + +ะ’ ะฟั€ะพั‚ะธะฒะฝะพะผ ัะปัƒั‡ะฐะต ะฟั€ะพัั‚ะพ ะพะทะฝะฐะบะพะผัŒั‚ะตััŒ ั ะพัะฝะพะฒะฝั‹ะผะธ ะฟั€ะธะฝั†ะธะฟะฐะผะธ ะฒ ั€ะฐะทะดะตะปะต ะฒั‹ัˆะต: ะะตั‚ ะฒั€ะตะผะตะฝะธ?. diff --git a/docs/ru/mkdocs.yml b/docs/ru/mkdocs.yml index 213f941d7..0f8f00411 100644 --- a/docs/ru/mkdocs.yml +++ b/docs/ru/mkdocs.yml @@ -54,6 +54,7 @@ nav: - tr: /tr/ - uk: /uk/ - zh: /zh/ +- async.md markdown_extensions: - toc: permalink: true From df50d7c13f53c5ef06742ebc1d128c8da47ae2f1 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 9 May 2022 18:30:57 +0000 Subject: [PATCH 022/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 3c706ce5c..2b2eb3dec 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐ŸŒ Add Russian translation for `docs/async.md`. PR [#4036](https://github.com/tiangolo/fastapi/pull/4036) by [@Winand](https://github.com/Winand). * ๐ŸŒ Add Portuguese translation for `docs/tutorial/body.md`. PR [#3960](https://github.com/tiangolo/fastapi/pull/3960) by [@leandrodesouzadev](https://github.com/leandrodesouzadev). * ๐ŸŒ Add Portuguese translation of `tutorial/extra-data-types.md`. PR [#4077](https://github.com/tiangolo/fastapi/pull/4077) by [@luccasmmg](https://github.com/luccasmmg). * ๐ŸŒ Update German translation for `docs/features.md`. PR [#3905](https://github.com/tiangolo/fastapi/pull/3905) by [@jomue](https://github.com/jomue). From 8724c493d9be1ea157d78099451c61bcb4a033cb Mon Sep 17 00:00:00 2001 From: Lucas <61513630+lsglucas@users.noreply.github.com> Date: Mon, 9 May 2022 15:34:42 -0300 Subject: [PATCH 023/168] =?UTF-8?q?=F0=9F=8C=90=20Add=20Portuguese=20trans?= =?UTF-8?q?lation=20for=20`docs/deployment/deta.md`=20(#4442)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Lorhan Sohaky Co-authored-by: Izabela Guerreiro Co-authored-by: Sebastiรกn Ramรญrez --- docs/pt/docs/deployment/deta.md | 258 ++++++++++++++++++++++++++++++++ docs/pt/mkdocs.yml | 1 + 2 files changed, 259 insertions(+) create mode 100644 docs/pt/docs/deployment/deta.md diff --git a/docs/pt/docs/deployment/deta.md b/docs/pt/docs/deployment/deta.md new file mode 100644 index 000000000..9271bba42 --- /dev/null +++ b/docs/pt/docs/deployment/deta.md @@ -0,0 +1,258 @@ +# Implantaรงรฃo FastAPI na Deta + +Nessa seรงรฃo vocรช aprenderรก sobre como realizar a implantaรงรฃo de uma aplicaรงรฃo **FastAPI** na Deta utilizando o plano gratuito. ๐ŸŽ + +Isso tudo levarรก aproximadamente **10 minutos**. + +!!! info "Informaรงรฃo" + Deta รฉ uma patrocinadora do **FastAPI**. ๐ŸŽ‰ + +## Uma aplicaรงรฃo **FastAPI** simples + +* Crie e entre em um diretรณrio para a sua aplicaรงรฃo, por exemplo, `./fastapideta/`. + +### Cรณdigo FastAPI + +* Crie o arquivo `main.py` com: + +```Python +from fastapi import FastAPI + +app = FastAPI() + + +@app.get("/") +def read_root(): + return {"Hello": "World"} + + +@app.get("/items/{item_id}") +def read_item(item_id: int): + return {"item_id": item_id} +``` + +### Requisitos + +Agora, no mesmo diretรณrio crie o arquivo `requirements.txt` com: + +```text +fastapi +``` + +!!! tip "Dica" + Vocรช nรฃo precisa instalar Uvicorn para realizar a implantaรงรฃo na Deta, embora provavelmente queira instalรก-lo para testar seu aplicativo localmente. + +### Estrutura de diretรณrio + +Agora vocรช terรก o diretรณrio `./fastapideta/` com dois arquivos: + +``` +. +โ””โ”€โ”€ main.py +โ””โ”€โ”€ requirements.txt +``` + +## Crie uma conta gratuita na Deta + +Agora crie uma conta gratuita na Deta, vocรช precisarรก apenas de um email e senha. + +Vocรช nem precisa de um cartรฃo de crรฉdito. + +## Instale a CLI + +Depois de ter sua conta criada, instale Deta CLI: + +=== "Linux, macOS" + +
+ + ```console + $ curl -fsSL https://get.deta.dev/cli.sh | sh + ``` + +
+ +=== "Windows PowerShell" + +
+ + ```console + $ iwr https://get.deta.dev/cli.ps1 -useb | iex + ``` + +
+ +Apรณs a instalaรงรฃo, abra um novo terminal para que a CLI seja detectada. + +Em um novo terminal, confirme se foi instalado corretamente com: + +
+ +```console +$ deta --help + +Deta command line interface for managing deta micros. +Complete documentation available at https://docs.deta.sh + +Usage: + deta [flags] + deta [command] + +Available Commands: + auth Change auth settings for a deta micro + +... +``` + +
+ +!!! tip "Dica" + Se vocรช tiver problemas ao instalar a CLI, verifique a documentaรงรฃo oficial da Deta. + +## Login pela CLI + +Agora faรงa login na Deta pela CLI com: + +
+ +```console +$ deta login + +Please, log in from the web page. Waiting.. +Logged in successfully. +``` + +
+ +Isso abrirรก um navegador da Web e autenticarรก automaticamente. + +## Implantaรงรฃo com Deta + +Em seguida, implante seu aplicativo com a Deta CLI: + +
+ +```console +$ deta new + +Successfully created a new micro + +// Notice the "endpoint" ๐Ÿ” + +{ + "name": "fastapideta", + "runtime": "python3.7", + "endpoint": "https://qltnci.deta.dev", + "visor": "enabled", + "http_auth": "enabled" +} + +Adding dependencies... + + +---> 100% + + +Successfully installed fastapi-0.61.1 pydantic-1.7.2 starlette-0.13.6 +``` + +
+ +Vocรช verรก uma mensagem JSON semelhante a: + +```JSON hl_lines="4" +{ + "name": "fastapideta", + "runtime": "python3.7", + "endpoint": "https://qltnci.deta.dev", + "visor": "enabled", + "http_auth": "enabled" +} +``` + +!!! tip "Dica" + Sua implantaรงรฃo terรก um URL `"endpoint"` diferente. + +## Confira + +Agora, abra seu navegador na URL do `endpoint`. No exemplo acima foi `https://qltnci.deta.dev`, mas o seu serรก diferente. + +Vocรช verรก a resposta JSON do seu aplicativo FastAPI: + +```JSON +{ + "Hello": "World" +} +``` + +Agora vรก para o `/docs` da sua API, no exemplo acima seria `https://qltnci.deta.dev/docs`. + +Ele mostrarรก sua documentaรงรฃo como: + + + +## Permitir acesso pรบblico + +Por padrรฃo, a Deta lidarรก com a autenticaรงรฃo usando cookies para sua conta. + +Mas quando estiver pronto, vocรช pode tornรก-lo pรบblico com: + +
+ +```console +$ deta auth disable + +Successfully disabled http auth +``` + +
+ +Agora vocรช pode compartilhar essa URL com qualquer pessoa e elas conseguirรฃo acessar sua API. ๐Ÿš€ + +## HTTPS + +Parabรฉns! Vocรช realizou a implantaรงรฃo do seu app FastAPI na Deta! ๐ŸŽ‰ ๐Ÿฐ + +Alรฉm disso, observe que a Deta lida corretamente com HTTPS para vocรช, para que vocรช nรฃo precise cuidar disso e tenha a certeza de que seus clientes terรฃo uma conexรฃo criptografada segura. โœ… ๐Ÿ”’ + +## Verifique o Visor + +Na UI da sua documentaรงรฃo (vocรช estarรก em um URL como `https://qltnci.deta.dev/docs`) envie um request para *operaรงรฃo de rota* `/items/{item_id}`. + +Por exemplo com ID `5`. + +Agora vรก para https://web.deta.sh. + +Vocรช verรก que hรก uma seรงรฃo ร  esquerda chamada "Micros" com cada um dos seus apps. + +Vocรช verรก uma aba com "Detalhes", e tambรฉm a aba "Visor", vรก para "Visor". + +Lรก vocรช pode inspecionar as solicitaรงรตes recentes enviadas ao seu aplicativo. + +Vocรช tambรฉm pode editรก-los e reproduzi-los novamente. + + + +## Saiba mais + +Em algum momento, vocรช provavelmente desejarรก armazenar alguns dados para seu aplicativo de uma forma que persista ao longo do tempo. Para isso vocรช pode usar Deta Base, que tambรฉm tem um generoso **nรญvel gratuito**. + +Vocรช tambรฉm pode ler mais na documentaรงรฃo da Deta. + +## Conceitos de implantaรงรฃo + +Voltando aos conceitos que discutimos em [Deployments Concepts](./concepts.md){.internal-link target=_blank}, veja como cada um deles seria tratado com a Deta: + +* **HTTPS**: Realizado pela Deta, eles fornecerรฃo um subdomรญnio e lidarรฃo com HTTPS automaticamente. +* **Executando na inicializaรงรฃo**: Realizado pela Deta, como parte de seu serviรงo. +* **Reinicializaรงรฃo**: Realizado pela Deta, como parte de seu serviรงo. +* **Replicaรงรฃo**: Realizado pela Deta, como parte de seu serviรงo. +* **Memรณria**: Limite predefinido pela Deta, vocรช pode contatรก-los para aumentรก-lo. +* **Etapas anteriores a inicializaรงรฃo**: Nรฃo suportado diretamente, vocรช pode fazรช-lo funcionar com o sistema Cron ou scripts adicionais. + +!!! note "Nota" + O Deta foi projetado para facilitar (e gratuitamente) a implantaรงรฃo rรกpida de aplicativos simples. + + Ele pode simplificar vรกrios casos de uso, mas, ao mesmo tempo, nรฃo suporta outros, como o uso de bancos de dados externos (alรฉm do prรณprio sistema de banco de dados NoSQL da Deta), mรกquinas virtuais personalizadas, etc. + + Vocรช pode ler mais detalhes na documentaรงรฃo da Deta para ver se รฉ a escolha certa para vocรช. diff --git a/docs/pt/mkdocs.yml b/docs/pt/mkdocs.yml index f6bcdcf02..ebcbabe23 100644 --- a/docs/pt/mkdocs.yml +++ b/docs/pt/mkdocs.yml @@ -72,6 +72,7 @@ nav: - deployment/index.md - deployment/versions.md - deployment/https.md + - deployment/deta.md - alternatives.md - history-design-future.md - external-links.md From d07422a07adebe709710c7fc5e008b1c40862ce2 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 9 May 2022 18:35:27 +0000 Subject: [PATCH 024/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 2b2eb3dec..44fb14afd 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐ŸŒ Add Portuguese translation for `docs/deployment/deta.md`. PR [#4442](https://github.com/tiangolo/fastapi/pull/4442) by [@lsglucas](https://github.com/lsglucas). * ๐ŸŒ Add Russian translation for `docs/async.md`. PR [#4036](https://github.com/tiangolo/fastapi/pull/4036) by [@Winand](https://github.com/Winand). * ๐ŸŒ Add Portuguese translation for `docs/tutorial/body.md`. PR [#3960](https://github.com/tiangolo/fastapi/pull/3960) by [@leandrodesouzadev](https://github.com/leandrodesouzadev). * ๐ŸŒ Add Portuguese translation of `tutorial/extra-data-types.md`. PR [#4077](https://github.com/tiangolo/fastapi/pull/4077) by [@luccasmmg](https://github.com/luccasmmg). From 2ef0b9896e1ea243b8dc70ea0963e6a56a0cba59 Mon Sep 17 00:00:00 2001 From: Izabela Guerreiro Date: Mon, 9 May 2022 20:44:32 -0300 Subject: [PATCH 025/168] =?UTF-8?q?=F0=9F=8C=90=20Add=20Portuguese=20trans?= =?UTF-8?q?lation=20for=20`docs/pt/docs/tutorial/background-tasks.md`=20(#?= =?UTF-8?q?2170)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Lorhan Sohaky <16273730+LorhanSohaky@users.noreply.github.com> Co-authored-by: Sebastiรกn Ramรญrez --- docs/pt/docs/tutorial/background-tasks.md | 94 +++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 docs/pt/docs/tutorial/background-tasks.md diff --git a/docs/pt/docs/tutorial/background-tasks.md b/docs/pt/docs/tutorial/background-tasks.md new file mode 100644 index 000000000..625fa2b11 --- /dev/null +++ b/docs/pt/docs/tutorial/background-tasks.md @@ -0,0 +1,94 @@ +# Tarefas em segundo plano + +Vocรช pode definir tarefas em segundo plano a serem executadas _ apรณs _ retornar uma resposta. + +Isso รฉ รบtil para operaรงรตes que precisam acontecer apรณs uma solicitaรงรฃo, mas que o cliente realmente nรฃo precisa esperar a operaรงรฃo ser concluรญda para receber a resposta. + +Isso inclui, por exemplo: + +- Envio de notificaรงรตes por email apรณs a realizaรงรฃo de uma aรงรฃo: + - Como conectar-se a um servidor de e-mail e enviar um e-mail tende a ser "lento" (vรกrios segundos), vocรช pode retornar a resposta imediatamente e enviar a notificaรงรฃo por e-mail em segundo plano. +- Processando dados: + - Por exemplo, digamos que vocรช receba um arquivo que deve passar por um processo lento, vocรช pode retornar uma resposta de "Aceito" (HTTP 202) e processรก-lo em segundo plano. + +## Usando `BackgroundTasks` + +Primeiro, importe `BackgroundTasks` e defina um parรขmetro em sua _funรงรฃo de operaรงรฃo de caminho_ com uma declaraรงรฃo de tipo de `BackgroundTasks`: + +```Python hl_lines="1 13" +{!../../../docs_src/background_tasks/tutorial001.py!} +``` + +O **FastAPI** criarรก o objeto do tipo `BackgroundTasks` para vocรช e o passarรก como esse parรขmetro. + +## Criar uma funรงรฃo de tarefa + +Crie uma funรงรฃo a ser executada como tarefa em segundo plano. + +ร‰ apenas uma funรงรฃo padrรฃo que pode receber parรขmetros. + +Pode ser uma funรงรฃo `async def` ou `def` normal, o **FastAPI** saberรก como lidar com isso corretamente. + +Nesse caso, a funรงรฃo de tarefa gravarรก em um arquivo (simulando o envio de um e-mail). + +E como a operaรงรฃo de gravaรงรฃo nรฃo usa `async` e `await`, definimos a funรงรฃo com `def` normal: + +```Python hl_lines="6-9" +{!../../../docs_src/background_tasks/tutorial001.py!} +``` + +## Adicionar a tarefa em segundo plano + +Dentro de sua _funรงรฃo de operaรงรฃo de caminho_, passe sua funรงรฃo de tarefa para o objeto _tarefas em segundo plano_ com o mรฉtodo `.add_task()`: + +```Python hl_lines="14" +{!../../../docs_src/background_tasks/tutorial001.py!} +``` + +`.add_task()` recebe como argumentos: + +- Uma funรงรฃo de tarefa a ser executada em segundo plano (`write_notification`). +- Qualquer sequรชncia de argumentos que deve ser passada para a funรงรฃo de tarefa na ordem (`email`). +- Quaisquer argumentos nomeados que devem ser passados โ€‹โ€‹para a funรงรฃo de tarefa (`mensagem = "alguma notificaรงรฃo"`). + +## Injeรงรฃo de dependรชncia + +Usar `BackgroundTasks` tambรฉm funciona com o sistema de injeรงรฃo de dependรชncia, vocรช pode declarar um parรขmetro do tipo `BackgroundTasks` em vรกrios nรญveis: em uma _funรงรฃo de operaรงรฃo de caminho_, em uma dependรชncia (confiรกvel), em uma subdependรชncia, etc. + +O **FastAPI** sabe o que fazer em cada caso e como reutilizar o mesmo objeto, de forma que todas as tarefas em segundo plano sejam mescladas e executadas em segundo plano posteriormente: + +```Python hl_lines="13 15 22 25" +{!../../../docs_src/background_tasks/tutorial002.py!} +``` + +Neste exemplo, as mensagens serรฃo gravadas no arquivo `log.txt` _apรณs_ o envio da resposta. + +Se houver uma consulta na solicitaรงรฃo, ela serรก gravada no log em uma tarefa em segundo plano. + +E entรฃo outra tarefa em segundo plano gerada na _funรงรฃo de operaรงรฃo de caminho_ escreverรก uma mensagem usando o parรขmetro de caminho `email`. + +## Detalhes tรฉcnicos + +A classe `BackgroundTasks` vem diretamente de `starlette.background`. + +Ela รฉ importada/incluรญda diretamente no FastAPI para que vocรช possa importรก-la do `fastapi` e evitar a importaรงรฃo acidental da alternativa `BackgroundTask` (sem o `s` no final) de `starlette.background`. + +Usando apenas `BackgroundTasks` (e nรฃo `BackgroundTask`), รฉ entรฃo possรญvel usรก-la como um parรขmetro de _funรงรฃo de operaรงรฃo de caminho_ e deixar o **FastAPI** cuidar do resto para vocรช, assim como ao usar o objeto `Request` diretamente. + +Ainda รฉ possรญvel usar `BackgroundTask` sozinho no FastAPI, mas vocรช deve criar o objeto em seu cรณdigo e retornar uma Starlette `Response` incluindo-o. + +Vocรช pode ver mais detalhes na documentaรงรฃo oficiais da Starlette para tarefas em segundo plano . + +## Ressalva + +Se vocรช precisa realizar cรกlculos pesados โ€‹โ€‹em segundo plano e nรฃo necessariamente precisa que seja executado pelo mesmo processo (por exemplo, vocรช nรฃo precisa compartilhar memรณria, variรกveis, etc), vocรช pode se beneficiar do uso de outras ferramentas maiores, como Celery . + +Eles tendem a exigir configuraรงรตes mais complexas, um gerenciador de fila de mensagens/tarefas, como RabbitMQ ou Redis, mas permitem que vocรช execute tarefas em segundo plano em vรกrios processos e, especialmente, em vรกrios servidores. + +Para ver um exemplo, verifique os [Geradores de projeto](../project-generation.md){.internal-link target=\_blank}, todos incluem celery jรก configurado. + +Mas se vocรช precisa acessar variรกveis โ€‹โ€‹e objetos do mesmo aplicativo **FastAPI**, ou precisa realizar pequenas tarefas em segundo plano (como enviar uma notificaรงรฃo por e-mail), vocรช pode simplesmente usar `BackgroundTasks`. + +## Recapitulando + +Importe e use `BackgroundTasks` com parรขmetros em _funรงรตes de operaรงรฃo de caminho_ e dependรชncias para adicionar tarefas em segundo plano. From b1c5b64c2ceb124261c79ab2331ac830ccfaa312 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 9 May 2022 23:45:05 +0000 Subject: [PATCH 026/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 44fb14afd..2e90546b3 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐ŸŒ Add Portuguese translation for `docs/pt/docs/tutorial/background-tasks.md`. PR [#2170](https://github.com/tiangolo/fastapi/pull/2170) by [@izaguerreiro](https://github.com/izaguerreiro). * ๐ŸŒ Add Portuguese translation for `docs/deployment/deta.md`. PR [#4442](https://github.com/tiangolo/fastapi/pull/4442) by [@lsglucas](https://github.com/lsglucas). * ๐ŸŒ Add Russian translation for `docs/async.md`. PR [#4036](https://github.com/tiangolo/fastapi/pull/4036) by [@Winand](https://github.com/Winand). * ๐ŸŒ Add Portuguese translation for `docs/tutorial/body.md`. PR [#3960](https://github.com/tiangolo/fastapi/pull/3960) by [@leandrodesouzadev](https://github.com/leandrodesouzadev). From d286e6a5be4926740df9f906bbc19e71da4e2477 Mon Sep 17 00:00:00 2001 From: a-takahashi223 <69033676+a-takahashi223@users.noreply.github.com> Date: Tue, 10 May 2022 08:48:07 +0900 Subject: [PATCH 027/168] =?UTF-8?q?=F0=9F=8C=90=20Fix=20Japanese=20transla?= =?UTF-8?q?tion=20of=20`docs/ja/docs/tutorial/body.md`=20(#3062)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastiรกn Ramรญrez --- docs/ja/docs/tutorial/body.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ja/docs/tutorial/body.md b/docs/ja/docs/tutorial/body.md index 9367ea257..59388d904 100644 --- a/docs/ja/docs/tutorial/body.md +++ b/docs/ja/docs/tutorial/body.md @@ -162,4 +162,4 @@ APIใฏใปใจใ‚“ใฉใฎๅ ดๅˆ **ใƒฌใ‚นใƒใƒณใ‚น** ใƒœใƒ‡ใ‚ฃใ‚’้€ใ‚‰ใชใ‘ใ‚Œใฐ ## Pydanticใ‚’ไฝฟใ‚ใชใ„ๆ–นๆณ• -ใ‚‚ใ—Pydanticใƒขใƒ‡ใƒซใ‚’ไฝฟ็”จใ—ใŸใใชใ„ๅ ดๅˆใฏใ€**ใƒœใƒ‡ใ‚ฃ**ใƒ‘ใƒฉใƒกใƒผใ‚ฟใŒๅˆฉ็”จใงใใพใ™ใ€‚[Body - Multiple Parameters: Singular values in body](body-multiple-params.md#singular-values-in-body){.internal-link target=_blank}ใ‚’็ขบ่ชใ—ใฆใใ ใ•ใ„ใ€‚ +ใ‚‚ใ—Pydanticใƒขใƒ‡ใƒซใ‚’ไฝฟ็”จใ—ใŸใใชใ„ๅ ดๅˆใฏใ€**Body**ใƒ‘ใƒฉใƒกใƒผใ‚ฟใŒๅˆฉ็”จใงใใพใ™ใ€‚[Body - Multiple Parameters: Singular values in body](body-multiple-params.md#singular-values-in-body){.internal-link target=_blank}ใ‚’็ขบ่ชใ—ใฆใใ ใ•ใ„ใ€‚ From 3279ef38ed9ca4630b0f3bb0af28e325339b78fa Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 9 May 2022 23:48:40 +0000 Subject: [PATCH 028/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 2e90546b3..92673f190 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐ŸŒ Fix Japanese translation of `docs/ja/docs/tutorial/body.md`. PR [#3062](https://github.com/tiangolo/fastapi/pull/3062) by [@a-takahashi223](https://github.com/a-takahashi223). * ๐ŸŒ Add Portuguese translation for `docs/pt/docs/tutorial/background-tasks.md`. PR [#2170](https://github.com/tiangolo/fastapi/pull/2170) by [@izaguerreiro](https://github.com/izaguerreiro). * ๐ŸŒ Add Portuguese translation for `docs/deployment/deta.md`. PR [#4442](https://github.com/tiangolo/fastapi/pull/4442) by [@lsglucas](https://github.com/lsglucas). * ๐ŸŒ Add Russian translation for `docs/async.md`. PR [#4036](https://github.com/tiangolo/fastapi/pull/4036) by [@Winand](https://github.com/Winand). From 944f06a901b80a7ad0239a5959adcf7cb46df7ac Mon Sep 17 00:00:00 2001 From: Sho Nakamura Date: Tue, 10 May 2022 08:54:00 +0900 Subject: [PATCH 029/168] =?UTF-8?q?=F0=9F=8C=90=20Add=20Japanese=20transla?= =?UTF-8?q?tion=20for=20`docs/ja/docs/advanced/conditional-openapi.md`=20(?= =?UTF-8?q?#2631)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastiรกn Ramรญrez --- docs/ja/docs/advanced/conditional-openapi.md | 58 ++++++++++++++++++++ docs/ja/mkdocs.yml | 1 + 2 files changed, 59 insertions(+) create mode 100644 docs/ja/docs/advanced/conditional-openapi.md diff --git a/docs/ja/docs/advanced/conditional-openapi.md b/docs/ja/docs/advanced/conditional-openapi.md new file mode 100644 index 000000000..b892ed6c6 --- /dev/null +++ b/docs/ja/docs/advanced/conditional-openapi.md @@ -0,0 +1,58 @@ +# ๆกไปถไป˜ใ OpenAPI + +ๅฟ…่ฆใงใ‚ใ‚Œใฐใ€่จญๅฎšใจ็’ฐๅขƒๅค‰ๆ•ฐใ‚’ๅˆฉ็”จใ—ใฆใ€็’ฐๅขƒใซๅฟœใ˜ใฆๆกไปถไป˜ใใงOpenAPIใ‚’ๆง‹ๆˆใ™ใ‚‹ใ“ใจใŒๅฏ่ƒฝใงใ™ใ€‚ใพใŸใ€ๅฎŒๅ…จใซOpenAPIใ‚’็„กๅŠนใซใ™ใ‚‹ใ“ใจใ‚‚ใงใใพใ™ใ€‚ + +## ใ‚ปใ‚ญใƒฅใƒชใƒ†ใ‚ฃใจAPIใ€ใŠใ‚ˆใณใƒ‰ใ‚ญใƒฅใƒกใƒณใƒˆใซใคใ„ใฆ + +ๆœฌ็•ช็’ฐๅขƒใซใŠใ„ใฆใƒ‰ใ‚ญใƒฅใƒกใƒณใƒˆใฎUIใ‚’้ž่กจ็คบใซใ™ใ‚‹ใ“ใจใซใ‚ˆใฃใฆใ€APIใ‚’ไฟ่ญทใ—ใ‚ˆใ†ใจ *ใ™ในใใงใฏใ‚ใ‚Šใพใ›ใ‚“*ใ€‚ + +ใใ‚Œใฏใ€APIใฎใ‚ปใ‚ญใƒฅใƒชใƒ†ใ‚ฃใฎๅผทๅŒ–ใซใฏใชใ‚‰ใšใ€*path operations* ใฏไพ็„ถใจใ—ใฆๅˆฉ็”จๅฏ่ƒฝใงใ™ใ€‚ + +ใ‚‚ใ—ใ‚ปใ‚ญใƒฅใƒชใƒ†ใ‚ฃไธŠใฎๆฌ ้™ฅใŒใ‚ฝใƒผใ‚นใ‚ณใƒผใƒ‰ใซใ‚ใ‚‹ใชใ‚‰ใฐใ€ใใ‚Œใฏๅญ˜ๅœจใ—ใŸใพใพใงใ™ใ€‚ + +ใƒ‰ใ‚ญใƒฅใƒกใƒณใƒ†ใƒผใ‚ทใƒงใƒณใ‚’้ž่กจ็คบใซใ™ใ‚‹ใฎใฏใ€ๅ˜ใซใ‚ใชใŸใฎAPIใธใฎใ‚ขใ‚ฏใ‚ปใ‚นๆ–นๆณ•ใ‚’้›ฃ่งฃใซใ™ใ‚‹ใ ใ‘ใงใชใใ€ๅŒๆ™‚ใซใ‚ใชใŸ่‡ช่บซใฎๆœฌ็•ช็’ฐๅขƒใงใฎAPIใฎใƒ‡ใƒใƒƒใ‚ฐใ‚’ๅ›ฐ้›ฃใซใ—ใฆใ—ใพใ†ๅฏ่ƒฝๆ€งใŒใ‚ใ‚Šใพใ™ใ€‚ๅ˜็ด”ใซใ€ Security through obscurity ใฎไธ€ใคใฎๅฝขๆ…‹ใจใ—ใฆ่€ƒใˆใ‚‰ใ‚Œใ‚‹ใงใ—ใ‚‡ใ†ใ€‚ + +ใ‚‚ใ—ใ‚ใชใŸใฎAPIใฎใ‚ปใ‚ญใƒฅใƒชใƒ†ใ‚ฃใ‚’ๅผทๅŒ–ใ—ใŸใ„ใชใ‚‰ใ€ใ„ใใคใ‹ใฎใ‚ˆใ‚Šใ‚ˆใ„ๆ–นๆณ•ใŒใ‚ใ‚Šใพใ™ใ€‚ไพ‹ใ‚’็คบใ™ใจใ€ + +* ใƒชใ‚ฏใ‚จใ‚นใƒˆใƒœใƒ‡ใ‚ฃใจใƒฌใ‚นใƒใƒณใ‚นใฎใŸใ‚ใฎPydanticใƒขใƒ‡ใƒซใฎๅฎš็พฉใ‚’่ฆ‹็›ดใ™ใ€‚ +* ไพๅญ˜้–ขไฟ‚ใซๅŸบใฅใใ™ในใฆใฎๅฟ…่ฆใชใƒ‘ใƒผใƒŸใƒƒใ‚ทใƒงใƒณใจใƒญใƒผใƒซใ‚’่จญๅฎšใ™ใ‚‹ใ€‚ +* ใƒ‘ใ‚นใƒฏใƒผใƒ‰ใ‚’็ตถๅฏพใซๅนณๆ–‡ใงไฟๅญ˜ใ—ใชใ„ใ€‚ใƒ‘ใ‚นใƒฏใƒผใƒ‰ใƒใƒƒใ‚ทใƒฅใฎใฟใ‚’ไฟๅญ˜ใ™ใ‚‹ใ€‚ +* Passlibใ‚„JWTใƒˆใƒผใ‚ฏใƒณใซไปฃ่กจใ•ใ‚Œใ‚‹ใ€ใ‚ˆใ็Ÿฅใ‚‰ใ‚ŒใŸๆš—ๅทๅŒ–ใƒ„ใƒผใƒซใ‚’ไฝฟใฃใฆๅฎŸ่ฃ…ใ™ใ‚‹ใ€‚ +* ใใ—ใฆๅฟ…่ฆใชใจใ“ใ‚ใงใฏใ€ใ‚‚ใฃใจ็ดฐใ‹ใ„ใƒ‘ใƒผใƒŸใƒƒใ‚ทใƒงใƒณๅˆถๅพกใ‚’OAuth2ใ‚นใ‚ณใƒผใƒ—ใ‚’ไฝฟใฃใฆ่กŒใ†ใ€‚ +* ใชใฉ + +ใใ‚Œใงใ‚‚ใ€ไพ‹ใˆใฐๆœฌ็•ช็’ฐๅขƒใฎใ‚ˆใ†ใช็‰นๅฎšใฎ็’ฐๅขƒใฎใฟใงใ€ใ‚ใ‚‹ใ„ใฏ็’ฐๅขƒๅค‰ๆ•ฐใฎ่จญๅฎšใซใ‚ˆใฃใฆAPIใƒ‰ใ‚ญใƒฅใƒกใƒณใƒˆใ‚’ใฉใ†ใ—ใฆใ‚‚็„กๅŠนใซใ—ใŸใ„ใจใ„ใ†ใ€้žๅธธใซ็‰นๆฎŠใชใƒฆใƒผใ‚นใ‚ฑใƒผใ‚นใŒใ‚ใ‚‹ใ‹ใ‚‚ใ—ใ‚Œใพใ›ใ‚“ใ€‚ + +## ่จญๅฎšใจ็’ฐๅขƒๅค‰ๆ•ฐใซใ‚ˆใ‚‹ๆกไปถไป˜ใ OpenAPI + +็”Ÿๆˆใ™ใ‚‹OpenAPIใจใƒ‰ใ‚ญใƒฅใƒกใƒณใƒˆUIใฎๆง‹ๆˆใฏใ€ๅ…ฑ้€šใฎPydanticใฎ่จญๅฎšใ‚’ไฝฟ็”จใ—ใฆ็ฐกๅ˜ใซๅˆ‡ใ‚Šๆ›ฟใˆใ‚‰ใ‚Œใพใ™ใ€‚ + +ไพ‹ใˆใฐใ€ + +```Python hl_lines="6 11" +{!../../../docs_src/conditional_openapi/tutorial001.py!} +``` + +ใ“ใ“ใงใฏ `openapi_url` ใฎ่จญๅฎšใ‚’ใ€ใƒ‡ใƒ•ใ‚ฉใƒซใƒˆใฎ `"/openapi.json"` ใฎใพใพๅฎฃ่จ€ใ—ใฆใ„ใพใ™ใ€‚ + +ใใ—ใฆใ€ใ“ใ‚Œใ‚’ `FastAPI` appใ‚’ไฝœใ‚‹้š›ใซไฝฟใ„ใพใ™ใ€‚ + +ใใ‚Œใ‹ใ‚‰ใ€ไปฅไธ‹ใฎใ‚ˆใ†ใซ `OPENAPI_URL` ใจใ„ใ†็’ฐๅขƒๅค‰ๆ•ฐใ‚’็ฉบๆ–‡ๅญ—ๅˆ—ใซ่จญๅฎšใ™ใ‚‹ใ“ใจใซใ‚ˆใฃใฆOpenAPI (UIใƒ‰ใ‚ญใƒฅใƒกใƒณใƒˆใ‚’ๅซใ‚€) ใ‚’็„กๅŠนๅŒ–ใ™ใ‚‹ใ“ใจใŒใงใใพใ™ใ€‚ + +
+ +```console +$ OPENAPI_URL= uvicorn main:app + +INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit) +``` + +
+ +ใ™ใ‚‹ใจใ€ไปฅไธ‹ใฎใ‚ˆใ†ใซ `/openapi.json`, `/docs`, `/redoc` ใฎใฉใฎURLใซใ‚ขใ‚ฏใ‚ปใ‚นใ—ใฆใ‚‚ใ€ `404 Not Found` ใ‚จใƒฉใƒผใŒ่ฟ”ใฃใฆใใ‚‹ใ‚ˆใ†ใซใชใ‚Šใพใ™ใ€‚ + +```JSON +{ + "detail": "Not Found" +} +``` diff --git a/docs/ja/mkdocs.yml b/docs/ja/mkdocs.yml index f972eb0ff..f9f91879b 100644 --- a/docs/ja/mkdocs.yml +++ b/docs/ja/mkdocs.yml @@ -80,6 +80,7 @@ nav: - advanced/additional-status-codes.md - advanced/response-directly.md - advanced/custom-response.md + - advanced/conditional-openapi.md - async.md - ใƒ‡ใƒ—ใƒญใ‚ค: - deployment/index.md From 424674a08276b2c343430906607be396d2515b1c Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 9 May 2022 23:54:33 +0000 Subject: [PATCH 030/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 92673f190..ea928ed6f 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐ŸŒ Add Japanese translation for `docs/ja/docs/advanced/conditional-openapi.md`. PR [#2631](https://github.com/tiangolo/fastapi/pull/2631) by [@sh0nk](https://github.com/sh0nk). * ๐ŸŒ Fix Japanese translation of `docs/ja/docs/tutorial/body.md`. PR [#3062](https://github.com/tiangolo/fastapi/pull/3062) by [@a-takahashi223](https://github.com/a-takahashi223). * ๐ŸŒ Add Portuguese translation for `docs/pt/docs/tutorial/background-tasks.md`. PR [#2170](https://github.com/tiangolo/fastapi/pull/2170) by [@izaguerreiro](https://github.com/izaguerreiro). * ๐ŸŒ Add Portuguese translation for `docs/deployment/deta.md`. PR [#4442](https://github.com/tiangolo/fastapi/pull/4442) by [@lsglucas](https://github.com/lsglucas). From b017a33ebd4b440ba24cd41cb5eb0d1ae107fe7e Mon Sep 17 00:00:00 2001 From: William Poetra Yoga Date: Tue, 10 May 2022 06:54:51 +0700 Subject: [PATCH 031/168] =?UTF-8?q?=E2=9C=8F=20Fix=20typo=20in=20`docs/en/?= =?UTF-8?q?docs/tutorial/sql-databases.md`=20(#4875)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/tutorial/sql-databases.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/docs/tutorial/sql-databases.md b/docs/en/docs/tutorial/sql-databases.md index 9dc2f64c6..60c7fb066 100644 --- a/docs/en/docs/tutorial/sql-databases.md +++ b/docs/en/docs/tutorial/sql-databases.md @@ -491,7 +491,7 @@ You can find an example of Alembic in a FastAPI project in the templates from [P ### Create a dependency -Now use the `SessionLocal` class we created in the `sql_app/databases.py` file to create a dependency. +Now use the `SessionLocal` class we created in the `sql_app/database.py` file to create a dependency. We need to have an independent database session/connection (`SessionLocal`) per request, use the same session through all the request and then close it after the request is finished. From 8fc4872c1b56e435886fd23a4a8bcaf32b80575e Mon Sep 17 00:00:00 2001 From: Sam Courtemanche Date: Tue, 10 May 2022 01:55:11 +0200 Subject: [PATCH 032/168] =?UTF-8?q?=F0=9F=8C=90=20Fix=20French=20translati?= =?UTF-8?q?on=20for=20`docs/tutorial/body.md`=20(#4332)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/fr/docs/tutorial/body.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/fr/docs/tutorial/body.md b/docs/fr/docs/tutorial/body.md index c0953f49f..304584498 100644 --- a/docs/fr/docs/tutorial/body.md +++ b/docs/fr/docs/tutorial/body.md @@ -111,7 +111,7 @@ Mais vous auriez le mรชme support de l'รฉditeur avec !!! tip "Astuce" - Si vous utilisez PyCharm comme รฉditeur, vous pouvez utiliser le Plugin PyCharm. + Si vous utilisez PyCharm comme รฉditeur, vous pouvez utiliser le Plugin Pydantic PyCharm Plugin. Ce qui amรฉliore le support pour les modรจles Pydantic avec : From f2bc8051134bffe373bbf98c5c22aa124f9fd027 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 9 May 2022 23:55:28 +0000 Subject: [PATCH 033/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index ea928ed6f..605d4aa8d 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* โœ Fix typo in `docs/en/docs/tutorial/sql-databases.md`. PR [#4875](https://github.com/tiangolo/fastapi/pull/4875) by [@wpyoga](https://github.com/wpyoga). * ๐ŸŒ Add Japanese translation for `docs/ja/docs/advanced/conditional-openapi.md`. PR [#2631](https://github.com/tiangolo/fastapi/pull/2631) by [@sh0nk](https://github.com/sh0nk). * ๐ŸŒ Fix Japanese translation of `docs/ja/docs/tutorial/body.md`. PR [#3062](https://github.com/tiangolo/fastapi/pull/3062) by [@a-takahashi223](https://github.com/a-takahashi223). * ๐ŸŒ Add Portuguese translation for `docs/pt/docs/tutorial/background-tasks.md`. PR [#2170](https://github.com/tiangolo/fastapi/pull/2170) by [@izaguerreiro](https://github.com/izaguerreiro). From c9eda31dd64eb32310f614ca9483806a36c0fa73 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 9 May 2022 23:55:47 +0000 Subject: [PATCH 034/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 605d4aa8d..34db10454 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐ŸŒ Fix French translation for `docs/tutorial/body.md`. PR [#4332](https://github.com/tiangolo/fastapi/pull/4332) by [@Smlep](https://github.com/Smlep). * โœ Fix typo in `docs/en/docs/tutorial/sql-databases.md`. PR [#4875](https://github.com/tiangolo/fastapi/pull/4875) by [@wpyoga](https://github.com/wpyoga). * ๐ŸŒ Add Japanese translation for `docs/ja/docs/advanced/conditional-openapi.md`. PR [#2631](https://github.com/tiangolo/fastapi/pull/2631) by [@sh0nk](https://github.com/sh0nk). * ๐ŸŒ Fix Japanese translation of `docs/ja/docs/tutorial/body.md`. PR [#3062](https://github.com/tiangolo/fastapi/pull/3062) by [@a-takahashi223](https://github.com/a-takahashi223). From 4fa4432173dbfcb78f351c704f13a51ac25d7a16 Mon Sep 17 00:00:00 2001 From: Lucas Mendes <80999926+lbmendes@users.noreply.github.com> Date: Mon, 9 May 2022 21:09:54 -0300 Subject: [PATCH 035/168] =?UTF-8?q?=F0=9F=8C=90=20Add=20Portuguese=20trans?= =?UTF-8?q?lation=20for=20`docs/pt/docs/tutorial/cookie-params.md`=20(#411?= =?UTF-8?q?2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastiรกn Ramรญrez --- docs/pt/docs/tutorial/cookie-params.md | 33 ++++++++++++++++++++++++++ docs/pt/mkdocs.yml | 1 + 2 files changed, 34 insertions(+) create mode 100644 docs/pt/docs/tutorial/cookie-params.md diff --git a/docs/pt/docs/tutorial/cookie-params.md b/docs/pt/docs/tutorial/cookie-params.md new file mode 100644 index 000000000..1a60e3571 --- /dev/null +++ b/docs/pt/docs/tutorial/cookie-params.md @@ -0,0 +1,33 @@ +# Parรขmetros de Cookie + +Vocรช pode definir parรขmetros de Cookie da mesma maneira que define paramรชtros com `Query` e `Path`. + +## Importe `Cookie` + +Primeiro importe `Cookie`: + +```Python hl_lines="3" +{!../../../docs_src/cookie_params/tutorial001.py!} +``` + +## Declare parรขmetros de `Cookie` + +Entรฃo declare os paramรชtros de cookie usando a mesma estrutura que em `Path` e `Query`. + +O primeiro valor รฉ o valor padrรฃo, vocรช pode passar todas as validaรงรตes adicionais ou parรขmetros de anotaรงรฃo: + +```Python hl_lines="9" +{!../../../docs_src/cookie_params/tutorial001.py!} +``` + +!!! note "Detalhes Tรฉcnicos" + `Cookie` รฉ uma classe "irmรฃ" de `Path` e `Query`. Ela tambรฉm herda da mesma classe em comum `Param`. + + Mas lembre-se que quando vocรช importa `Query`, `Path`, `Cookie` e outras de `fastapi`, elas sรฃo na verdade funรงรตes que retornam classes especiais. + +!!! info "Informaรงรฃo" + Para declarar cookies, vocรช precisa usar `Cookie`, caso contrรกrio, os parรขmetros seriam interpretados como parรขmetros de consulta. + +## Recapitulando + +Declare cookies com `Cookie`, usando o mesmo padrรฃo comum que utiliza-se em `Query` e `Path`. diff --git a/docs/pt/mkdocs.yml b/docs/pt/mkdocs.yml index ebcbabe23..9111ef622 100644 --- a/docs/pt/mkdocs.yml +++ b/docs/pt/mkdocs.yml @@ -64,6 +64,7 @@ nav: - tutorial/body-fields.md - tutorial/extra-data-types.md - tutorial/query-params-str-validations.md + - tutorial/cookie-params.md - Seguranรงa: - tutorial/security/index.md - Guia de Usuรกrio Avanรงado: From 0d1be46481056dc7bface2e4c8da4ad7103d8d8f Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 10 May 2022 00:10:27 +0000 Subject: [PATCH 036/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 34db10454..dfb2570f3 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐ŸŒ Add Portuguese translation for `docs/pt/docs/tutorial/cookie-params.md`. PR [#4112](https://github.com/tiangolo/fastapi/pull/4112) by [@lbmendes](https://github.com/lbmendes). * ๐ŸŒ Fix French translation for `docs/tutorial/body.md`. PR [#4332](https://github.com/tiangolo/fastapi/pull/4332) by [@Smlep](https://github.com/Smlep). * โœ Fix typo in `docs/en/docs/tutorial/sql-databases.md`. PR [#4875](https://github.com/tiangolo/fastapi/pull/4875) by [@wpyoga](https://github.com/wpyoga). * ๐ŸŒ Add Japanese translation for `docs/ja/docs/advanced/conditional-openapi.md`. PR [#2631](https://github.com/tiangolo/fastapi/pull/2631) by [@sh0nk](https://github.com/sh0nk). From e5980a71c2be35755e141b14ac8b67395e63a658 Mon Sep 17 00:00:00 2001 From: wakabame <35513518+wakabame@users.noreply.github.com> Date: Tue, 10 May 2022 09:27:05 +0900 Subject: [PATCH 037/168] =?UTF-8?q?=F0=9F=8C=90=20Fix=20live=20docs=20serv?= =?UTF-8?q?er=20for=20translations=20for=20some=20languages=20(#4729)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastiรกn Ramรญrez --- docs/fr/docs/fastapi-people.md | 3 +++ docs/ja/docs/fastapi-people.md | 4 ++++ docs/zh/docs/fastapi-people.md | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/docs/fr/docs/fastapi-people.md b/docs/fr/docs/fastapi-people.md index 9ec2718c4..945f0794e 100644 --- a/docs/fr/docs/fastapi-people.md +++ b/docs/fr/docs/fastapi-people.md @@ -114,6 +114,8 @@ Ce sont les **Sponsors**. ๐Ÿ˜Ž Ils soutiennent mon travail avec **FastAPI** (et d'autres) avec GitHub Sponsors. +{% if sponsors %} + {% if sponsors.gold %} ### Gold Sponsors @@ -141,6 +143,7 @@ Ils soutiennent mon travail avec **FastAPI** (et d'autres) avec GitHub Sponsors ใ‚’ไป‹ใ—ใฆ็งใฎ **FastAPI** ใชใฉใซ้–ขใ™ใ‚‹ๆดปๅ‹•ใ‚’ๆ”ฏๆดใ—ใฆใใ‚Œใฆใ„ใพใ™ใ€‚ +{% if sponsors %} + {% if sponsors.gold %} ### Gold Sponsors @@ -142,6 +144,8 @@ FastAPIใซใฏใ€ๆง˜ใ€…ใชใƒใƒƒใ‚ฏใ‚ฐใƒฉใ‚ฆใƒณใƒ‰ใฎไบบใ€…ใ‚’ๆญ“่ฟŽใ™ใ‚‹็ด ๆ™ด {% endfor %} {% endif %} +{% endif %} + ### Individual Sponsors {% if github_sponsors %} diff --git a/docs/zh/docs/fastapi-people.md b/docs/zh/docs/fastapi-people.md index 75651592d..5d7b0923f 100644 --- a/docs/zh/docs/fastapi-people.md +++ b/docs/zh/docs/fastapi-people.md @@ -114,6 +114,8 @@ FastAPI ๆœ‰ไธ€ไธช้žๅธธๆฃ’็š„็คพๅŒบ๏ผŒๅฎƒๆฌข่ฟŽๆฅ่‡ชๅ„ไธช้ข†ๅŸŸๅ’Œ่ƒŒๆ™ฏ็š„ๆœ‹ ไป–ไปฌไธป่ฆ้€š่ฟ‡GitHub Sponsorsๆ”ฏๆŒๆˆ‘ๅœจ **FastAPI** (ๅ’Œๅ…ถไป–้กน็›ฎ)็š„ๅทฅไฝœใ€‚ +{% if sponsors %} + {% if sponsors.gold %} ### ้‡‘็‰Œ่ตžๅŠฉๅ•† @@ -141,6 +143,8 @@ FastAPI ๆœ‰ไธ€ไธช้žๅธธๆฃ’็š„็คพๅŒบ๏ผŒๅฎƒๆฌข่ฟŽๆฅ่‡ชๅ„ไธช้ข†ๅŸŸๅ’Œ่ƒŒๆ™ฏ็š„ๆœ‹ {% endfor %} {% endif %} +{% endif %} + ### ไธชไบบ่ตžๅŠฉ {% if github_sponsors %} From 59fbdefd7fe4c283235e91adefa05891f96fdd9b Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 10 May 2022 00:27:42 +0000 Subject: [PATCH 038/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index dfb2570f3..2cedef47a 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐ŸŒ Fix live docs server for translations for some languages. PR [#4729](https://github.com/tiangolo/fastapi/pull/4729) by [@wakabame](https://github.com/wakabame). * ๐ŸŒ Add Portuguese translation for `docs/pt/docs/tutorial/cookie-params.md`. PR [#4112](https://github.com/tiangolo/fastapi/pull/4112) by [@lbmendes](https://github.com/lbmendes). * ๐ŸŒ Fix French translation for `docs/tutorial/body.md`. PR [#4332](https://github.com/tiangolo/fastapi/pull/4332) by [@Smlep](https://github.com/Smlep). * โœ Fix typo in `docs/en/docs/tutorial/sql-databases.md`. PR [#4875](https://github.com/tiangolo/fastapi/pull/4875) by [@wpyoga](https://github.com/wpyoga). From 3d201623dde2c19cfb8893bf30eccf87befdd87d Mon Sep 17 00:00:00 2001 From: Cleo Menezes Jr <54215258+CleoMenezesJr@users.noreply.github.com> Date: Mon, 9 May 2022 20:35:48 -0400 Subject: [PATCH 039/168] =?UTF-8?q?=E2=9C=8F=20=F0=9F=8C=90=20Fix=20typo?= =?UTF-8?q?=20in=20Portuguese=20translation=20for=20`docs/pt/docs/tutorial?= =?UTF-8?q?/path-params.md`=20(#4722)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastiรกn Ramรญrez --- docs/pt/docs/tutorial/path-params.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pt/docs/tutorial/path-params.md b/docs/pt/docs/tutorial/path-params.md index 20913a564..5de3756ed 100644 --- a/docs/pt/docs/tutorial/path-params.md +++ b/docs/pt/docs/tutorial/path-params.md @@ -72,7 +72,7 @@ O mesmo erro apareceria se vocรช tivesse fornecido um `float` ao invรฉs de um `i ## Documentaรงรฃo -Quando vocรช abrir o seu navegador em http://127.0.0.1:8000/docs, vocรช verรก de forma automรกtica e interativa a documtaรงรฃo da API como: +Quando vocรช abrir o seu navegador em http://127.0.0.1:8000/docs, vocรช verรก de forma automรกtica e interativa a documentaรงรฃo da API como: From faf7ce5af51c625fbc638d67a0c4c591ef342a46 Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 10 May 2022 00:36:22 +0000 Subject: [PATCH 040/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 2cedef47a..f9b697b54 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* โœ ๐ŸŒ Fix typo in Portuguese translation for `docs/pt/docs/tutorial/path-params.md`. PR [#4722](https://github.com/tiangolo/fastapi/pull/4722) by [@CleoMenezesJr](https://github.com/CleoMenezesJr). * ๐ŸŒ Fix live docs server for translations for some languages. PR [#4729](https://github.com/tiangolo/fastapi/pull/4729) by [@wakabame](https://github.com/wakabame). * ๐ŸŒ Add Portuguese translation for `docs/pt/docs/tutorial/cookie-params.md`. PR [#4112](https://github.com/tiangolo/fastapi/pull/4112) by [@lbmendes](https://github.com/lbmendes). * ๐ŸŒ Fix French translation for `docs/tutorial/body.md`. PR [#4332](https://github.com/tiangolo/fastapi/pull/4332) by [@Smlep](https://github.com/Smlep). From 262183b534223c7e6316b812671bfce169ac54a5 Mon Sep 17 00:00:00 2001 From: Patryk Cisek Date: Mon, 9 May 2022 17:39:23 -0700 Subject: [PATCH 041/168] =?UTF-8?q?=E2=9C=8F=20Fix=20typo=20in=20`docs/en/?= =?UTF-8?q?docs/async.md`=20(#4726)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastiรกn Ramรญrez --- docs/en/docs/async.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/docs/async.md b/docs/en/docs/async.md index 8194650fd..71f2e7502 100644 --- a/docs/en/docs/async.md +++ b/docs/en/docs/async.md @@ -116,7 +116,7 @@ The cashier ๐Ÿ’ gives you the number of your turn. While you are waiting, you go with your crush ๐Ÿ˜ and pick a table, you sit and talk with your crush ๐Ÿ˜ for a long time (as your burgers are very fancy and take some time to prepare โœจ๐Ÿ”โœจ). -As you are sitting on the table with your crush ๐Ÿ˜, while you wait for the burgers ๐Ÿ”, you can spend that time admiring how awesome, cute and smart your crush is โœจ๐Ÿ˜โœจ. +As you are sitting at the table with your crush ๐Ÿ˜, while you wait for the burgers ๐Ÿ”, you can spend that time admiring how awesome, cute and smart your crush is โœจ๐Ÿ˜โœจ. While waiting and talking to your crush ๐Ÿ˜, from time to time, you check the number displayed on the counter to see if it's your turn already. @@ -134,7 +134,7 @@ Then, when it's your turn, you do actual "productive" work ๐Ÿค“, you process the But then, even though you still don't have your burgers ๐Ÿ”, your work with the cashier ๐Ÿ’ is "on pause" โธ, because you have to wait ๐Ÿ•™ for your burgers to be ready. -But as you go away from the counter and sit on the table with a number for your turn, you can switch ๐Ÿ”€ your attention to your crush ๐Ÿ˜, and "work" โฏ ๐Ÿค“ on that. Then you are again doing something very "productive" ๐Ÿค“, as is flirting with your crush ๐Ÿ˜. +But as you go away from the counter and sit at the table with a number for your turn, you can switch ๐Ÿ”€ your attention to your crush ๐Ÿ˜, and "work" โฏ ๐Ÿค“ on that. Then you are again doing something very "productive" ๐Ÿค“, as is flirting with your crush ๐Ÿ˜. Then the cashier ๐Ÿ’ says "I'm finished with doing the burgers" ๐Ÿ” by putting your number on the counter's display, but you don't jump like crazy immediately when the displayed number changes to your turn number. You know no one will steal your burgers ๐Ÿ” because you have the number of your turn, and they have theirs. From 8a353ab911fb69a984a12c8ed04781b3aeeb6a05 Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 10 May 2022 00:39:57 +0000 Subject: [PATCH 042/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index f9b697b54..2412b09a4 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* โœ Fix typo in `docs/en/docs/async.md`. PR [#4726](https://github.com/tiangolo/fastapi/pull/4726) by [@Prezu](https://github.com/Prezu). * โœ ๐ŸŒ Fix typo in Portuguese translation for `docs/pt/docs/tutorial/path-params.md`. PR [#4722](https://github.com/tiangolo/fastapi/pull/4722) by [@CleoMenezesJr](https://github.com/CleoMenezesJr). * ๐ŸŒ Fix live docs server for translations for some languages. PR [#4729](https://github.com/tiangolo/fastapi/pull/4729) by [@wakabame](https://github.com/wakabame). * ๐ŸŒ Add Portuguese translation for `docs/pt/docs/tutorial/cookie-params.md`. PR [#4112](https://github.com/tiangolo/fastapi/pull/4112) by [@lbmendes](https://github.com/lbmendes). From c0d6865c10d844526f1a0981c9943bdff3213fc2 Mon Sep 17 00:00:00 2001 From: alm Date: Tue, 10 May 2022 04:07:37 +0300 Subject: [PATCH 043/168] =?UTF-8?q?=F0=9F=8C=90=20Remove=20translation=20d?= =?UTF-8?q?ocs=20references=20to=20aiofiles=20as=20it's=20no=20longer=20ne?= =?UTF-8?q?eded=20since=20AnyIO=20(#3594)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: AlonMenczer Co-authored-by: Sebastiรกn Ramรญrez --- docs/de/docs/index.md | 1 - docs/es/docs/index.md | 1 - docs/fr/docs/index.md | 1 - docs/id/docs/index.md | 1 - docs/it/docs/index.md | 1 - docs/ja/docs/index.md | 1 - docs/ja/docs/tutorial/static-files.md | 14 -------------- docs/ko/docs/index.md | 1 - docs/pt/docs/index.md | 1 - docs/ru/docs/index.md | 1 - docs/sq/docs/index.md | 1 - docs/tr/docs/index.md | 1 - docs/uk/docs/index.md | 1 - docs/zh/docs/index.md | 1 - 14 files changed, 27 deletions(-) diff --git a/docs/de/docs/index.md b/docs/de/docs/index.md index d09ce70a0..cdce66223 100644 --- a/docs/de/docs/index.md +++ b/docs/de/docs/index.md @@ -446,7 +446,6 @@ Used by Pydantic: Used by Starlette: * requests - Required if you want to use the `TestClient`. -* aiofiles - Required if you want to use `FileResponse` or `StaticFiles`. * jinja2 - Required if you want to use the default template configuration. * python-multipart - Required if you want to support form "parsing", with `request.form()`. * itsdangerous - Required for `SessionMiddleware` support. diff --git a/docs/es/docs/index.md b/docs/es/docs/index.md index 65eaf75d0..1fa79fdde 100644 --- a/docs/es/docs/index.md +++ b/docs/es/docs/index.md @@ -439,7 +439,6 @@ Usadas por Pydantic: Usados por Starlette: * requests - Requerido si quieres usar el `TestClient`. -* aiofiles - Requerido si quieres usar `FileResponse` o `StaticFiles`. * jinja2 - Requerido si quieres usar la configuraciรณn por defecto de templates. * python-multipart - Requerido si quieres dar soporte a "parsing" de formularios, con `request.form()`. * itsdangerous - Requerido para dar soporte a `SessionMiddleware`. diff --git a/docs/fr/docs/index.md b/docs/fr/docs/index.md index 40e6dfdff..3922d9c77 100644 --- a/docs/fr/docs/index.md +++ b/docs/fr/docs/index.md @@ -447,7 +447,6 @@ Used by Pydantic: Used by Starlette: * requests - Required if you want to use the `TestClient`. -* aiofiles - Required if you want to use `FileResponse` or `StaticFiles`. * jinja2 - Required if you want to use the default template configuration. * python-multipart - Required if you want to support form "parsing", with `request.form()`. * itsdangerous - Required for `SessionMiddleware` support. diff --git a/docs/id/docs/index.md b/docs/id/docs/index.md index 95fb7ae21..a7af14781 100644 --- a/docs/id/docs/index.md +++ b/docs/id/docs/index.md @@ -447,7 +447,6 @@ Used by Pydantic: Used by Starlette: * requests - Required if you want to use the `TestClient`. -* aiofiles - Required if you want to use `FileResponse` or `StaticFiles`. * jinja2 - Required if you want to use the default template configuration. * python-multipart - Required if you want to support form "parsing", with `request.form()`. * itsdangerous - Required for `SessionMiddleware` support. diff --git a/docs/it/docs/index.md b/docs/it/docs/index.md index c52f07e59..e9e428561 100644 --- a/docs/it/docs/index.md +++ b/docs/it/docs/index.md @@ -444,7 +444,6 @@ Used by Pydantic: Used by Starlette: * requests - Required if you want to use the `TestClient`. -* aiofiles - Required if you want to use `FileResponse` or `StaticFiles`. * jinja2 - Required if you want to use the default template configuration. * python-multipart - Required if you want to support form "parsing", with `request.form()`. * itsdangerous - Required for `SessionMiddleware` support. diff --git a/docs/ja/docs/index.md b/docs/ja/docs/index.md index 229361503..5fca78a83 100644 --- a/docs/ja/docs/index.md +++ b/docs/ja/docs/index.md @@ -437,7 +437,6 @@ Pydantic ใซใ‚ˆใฃใฆไฝฟ็”จใ•ใ‚Œใ‚‹ใ‚‚ใฎ: Starlette ใซใ‚ˆใฃใฆไฝฟ็”จใ•ใ‚Œใ‚‹ใ‚‚ใฎ: - requests - `TestClient`ใ‚’ไฝฟ็”จใ™ใ‚‹ใŸใ‚ใซๅฟ…่ฆใงใ™ใ€‚ -- aiofiles - `FileResponse` ใพใŸใฏ `StaticFiles`ใ‚’ไฝฟ็”จใ—ใŸใ„ๅ ดๅˆใฏๅฟ…่ฆใงใ™ใ€‚ - jinja2 - ใƒ‡ใƒ•ใ‚ฉใƒซใƒˆใฎใƒ†ใƒณใƒ—ใƒฌใƒผใƒˆ่จญๅฎšใ‚’ไฝฟ็”จใ™ใ‚‹ๅ ดๅˆใฏๅฟ…่ฆใงใ™ใ€‚ - python-multipart - "parsing"`request.form()`ใ‹ใ‚‰ใฎๅค‰ๆ›ใ‚’ใ‚ตใƒใƒผใƒˆใ—ใŸใ„ๅ ดๅˆใฏๅฟ…่ฆใงใ™ใ€‚ - itsdangerous - `SessionMiddleware` ใ‚ตใƒใƒผใƒˆใฎใŸใ‚ใซใฏๅฟ…่ฆใงใ™ใ€‚ diff --git a/docs/ja/docs/tutorial/static-files.md b/docs/ja/docs/tutorial/static-files.md index fcc3ba924..1d9c434c3 100644 --- a/docs/ja/docs/tutorial/static-files.md +++ b/docs/ja/docs/tutorial/static-files.md @@ -2,20 +2,6 @@ `StaticFiles` ใ‚’ไฝฟ็”จใ—ใฆใ€ใƒ‡ใ‚ฃใƒฌใ‚ฏใƒˆใƒชใ‹ใ‚‰้™็š„ใƒ•ใ‚กใ‚คใƒซใ‚’่‡ชๅ‹•็š„ใซๆไพ›ใงใใพใ™ใ€‚ -## `aiofiles` ใ‚’ใ‚คใƒณใ‚นใƒˆใƒผใƒซ - -ใพใšใ€`aiofiles` ใ‚’ใ‚คใƒณใ‚นใƒˆใƒผใƒซใ™ใ‚‹ๅฟ…่ฆใŒใ‚ใ‚Šใพใ™: - -
- -```console -$ pip install aiofiles - ----> 100% -``` - -
- ## `StaticFiles` ใฎไฝฟ็”จ * `StaticFiles` ใ‚’ใ‚คใƒณใƒใƒผใƒˆใ€‚ diff --git a/docs/ko/docs/index.md b/docs/ko/docs/index.md index d0c236906..284628955 100644 --- a/docs/ko/docs/index.md +++ b/docs/ko/docs/index.md @@ -443,7 +443,6 @@ Pydantic์ด ์‚ฌ์šฉํ•˜๋Š”: Starlette์ด ์‚ฌ์šฉํ•˜๋Š”: * requests - `TestClient`๋ฅผ ์‚ฌ์šฉํ•˜๋ ค๋ฉด ํ•„์š”. -* aiofiles - `FileResponse` ๋˜๋Š” `StaticFiles`๋ฅผ ์‚ฌ์šฉํ•˜๋ ค๋ฉด ํ•„์š”. * jinja2 - ๊ธฐ๋ณธ ํ…œํ”Œ๋ฆฟ ์„ค์ •์„ ์‚ฌ์šฉํ•˜๋ ค๋ฉด ํ•„์š”. * python-multipart - `request.form()`๊ณผ ํ•จ๊ป˜ "parsing"์˜ ์ง€์›์„ ์›ํ•˜๋ฉด ํ•„์š”. * itsdangerous - `SessionMiddleware` ์ง€์›์„ ์œ„ํ•ด ํ•„์š”. diff --git a/docs/pt/docs/index.md b/docs/pt/docs/index.md index 848fff08a..97044dd90 100644 --- a/docs/pt/docs/index.md +++ b/docs/pt/docs/index.md @@ -434,7 +434,6 @@ Usados por Pydantic: Usados por Starlette: * requests - Necessรกrio se vocรช quiser utilizar o `TestClient`. -* aiofiles - Necessรกrio se vocรช quiser utilizar o `FileResponse` ou `StaticFiles`. * jinja2 - Necessรกrio se vocรช quiser utilizar a configuraรงรฃo padrรฃo de templates. * python-multipart - Necessรกrio se vocรช quiser suporte com "parsing" de formulรกrio, com `request.form()`. * itsdangerous - Necessรกrio para suporte a `SessionMiddleware`. diff --git a/docs/ru/docs/index.md b/docs/ru/docs/index.md index 0c2506b87..c0a958c3d 100644 --- a/docs/ru/docs/index.md +++ b/docs/ru/docs/index.md @@ -447,7 +447,6 @@ Used by Pydantic: Used by Starlette: * requests - Required if you want to use the `TestClient`. -* aiofiles - Required if you want to use `FileResponse` or `StaticFiles`. * jinja2 - Required if you want to use the default template configuration. * python-multipart - Required if you want to support form "parsing", with `request.form()`. * itsdangerous - Required for `SessionMiddleware` support. diff --git a/docs/sq/docs/index.md b/docs/sq/docs/index.md index 95fb7ae21..a7af14781 100644 --- a/docs/sq/docs/index.md +++ b/docs/sq/docs/index.md @@ -447,7 +447,6 @@ Used by Pydantic: Used by Starlette: * requests - Required if you want to use the `TestClient`. -* aiofiles - Required if you want to use `FileResponse` or `StaticFiles`. * jinja2 - Required if you want to use the default template configuration. * python-multipart - Required if you want to support form "parsing", with `request.form()`. * itsdangerous - Required for `SessionMiddleware` support. diff --git a/docs/tr/docs/index.md b/docs/tr/docs/index.md index 88660f7eb..19f46fb4c 100644 --- a/docs/tr/docs/index.md +++ b/docs/tr/docs/index.md @@ -455,7 +455,6 @@ Pydantic tarafฤฑnda kullanฤฑlan: Starlette tarafฤฑnda kullanฤฑlan: * requests - EฤŸer `TestClient` kullanmak istiyorsan gerekli. -* aiofiles - `FileResponse` ya da `StaticFiles` kullanmak istiyorsan gerekli. * jinja2 - EฤŸer kendine ait template konfigรผrasyonu oluลŸturmak istiyorsan gerekli * python-multipart - Form kullanmak istiyorsan gerekli ("dรถnรผลŸรผmรผ"). * itsdangerous - `SessionMiddleware` desteฤŸi iรงin gerekli. diff --git a/docs/uk/docs/index.md b/docs/uk/docs/index.md index 95fb7ae21..a7af14781 100644 --- a/docs/uk/docs/index.md +++ b/docs/uk/docs/index.md @@ -447,7 +447,6 @@ Used by Pydantic: Used by Starlette: * requests - Required if you want to use the `TestClient`. -* aiofiles - Required if you want to use `FileResponse` or `StaticFiles`. * jinja2 - Required if you want to use the default template configuration. * python-multipart - Required if you want to support form "parsing", with `request.form()`. * itsdangerous - Required for `SessionMiddleware` support. diff --git a/docs/zh/docs/index.md b/docs/zh/docs/index.md index 85707e573..20755283d 100644 --- a/docs/zh/docs/index.md +++ b/docs/zh/docs/index.md @@ -443,7 +443,6 @@ item: Item ็”จไบŽ Starlette๏ผš * requests - ไฝฟ็”จ `TestClient` ๆ—ถๅฎ‰่ฃ…ใ€‚ -* aiofiles - ไฝฟ็”จ `FileResponse` ๆˆ– `StaticFiles` ๆ—ถๅฎ‰่ฃ…ใ€‚ * jinja2 - ไฝฟ็”จ้ป˜่ฎคๆจกๆฟ้…็ฝฎๆ—ถๅฎ‰่ฃ…ใ€‚ * python-multipart - ้œ€่ฆ้€š่ฟ‡ `request.form()` ๅฏน่กจๅ•่ฟ›่กŒใ€Œ่งฃๆžใ€ๆ—ถๅฎ‰่ฃ…ใ€‚ * itsdangerous - ้œ€่ฆ `SessionMiddleware` ๆ”ฏๆŒๆ—ถๅฎ‰่ฃ…ใ€‚ From fa1ffa567702f70d956366ffa6093dd28d8582be Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 10 May 2022 01:08:12 +0000 Subject: [PATCH 044/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 2412b09a4..4be88c90f 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐ŸŒ Remove translation docs references to aiofiles as it's no longer needed since AnyIO. PR [#3594](https://github.com/tiangolo/fastapi/pull/3594) by [@alonme](https://github.com/alonme). * โœ Fix typo in `docs/en/docs/async.md`. PR [#4726](https://github.com/tiangolo/fastapi/pull/4726) by [@Prezu](https://github.com/Prezu). * โœ ๐ŸŒ Fix typo in Portuguese translation for `docs/pt/docs/tutorial/path-params.md`. PR [#4722](https://github.com/tiangolo/fastapi/pull/4722) by [@CleoMenezesJr](https://github.com/CleoMenezesJr). * ๐ŸŒ Fix live docs server for translations for some languages. PR [#4729](https://github.com/tiangolo/fastapi/pull/4729) by [@wakabame](https://github.com/wakabame). From 8f90e514f47d57bddc7db2cbedc9409f16956bb1 Mon Sep 17 00:00:00 2001 From: Ben Gamble Date: Mon, 9 May 2022 21:21:29 -0400 Subject: [PATCH 045/168] =?UTF-8?q?=F0=9F=93=9D=20Add=20external=20link=20?= =?UTF-8?q?to=20blog=20post=20about=20Kafka,=20FastAPI,=20and=20Ably=20(#4?= =?UTF-8?q?044)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastiรกn Ramรญrez --- docs/en/data/external_links.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/en/data/external_links.yml b/docs/en/data/external_links.yml index 0850d9788..a25c3757f 100644 --- a/docs/en/data/external_links.yml +++ b/docs/en/data/external_links.yml @@ -12,6 +12,10 @@ articles: author_link: https://pystar.substack.com/ link: https://pystar.substack.com/p/how-to-create-a-fake-certificate title: How to Create A Fake Certificate Authority And Generate TLS Certs for FastAPI + - author: Ben Gamble + author_link: https://uk.linkedin.com/in/bengamble7 + link: https://ably.com/blog/realtime-ticket-booking-solution-kafka-fastapi-ably + title: Building a realtime ticket booking solution with Kafka, FastAPI, and Ably - author: Shahriyar(Shako) Rzayev author_link: https://www.linkedin.com/in/shahriyar-rzayev/ link: https://www.azepug.az/posts/fastapi/#building-simple-e-commerce-with-nuxtjs-and-fastapi-series From edd38c0230358b35f645fc3df039505f1c0d709f Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 10 May 2022 01:22:07 +0000 Subject: [PATCH 046/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 4be88c90f..24313be48 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐Ÿ“ Add external link to blog post about Kafka, FastAPI, and Ably. PR [#4044](https://github.com/tiangolo/fastapi/pull/4044) by [@Ugbot](https://github.com/Ugbot). * ๐ŸŒ Remove translation docs references to aiofiles as it's no longer needed since AnyIO. PR [#3594](https://github.com/tiangolo/fastapi/pull/3594) by [@alonme](https://github.com/alonme). * โœ Fix typo in `docs/en/docs/async.md`. PR [#4726](https://github.com/tiangolo/fastapi/pull/4726) by [@Prezu](https://github.com/Prezu). * โœ ๐ŸŒ Fix typo in Portuguese translation for `docs/pt/docs/tutorial/path-params.md`. PR [#4722](https://github.com/tiangolo/fastapi/pull/4722) by [@CleoMenezesJr](https://github.com/CleoMenezesJr). From 4fa0cd4def62d789f7f61675e21bd7fa4fdb7bf8 Mon Sep 17 00:00:00 2001 From: Yue Chen Date: Tue, 10 May 2022 09:25:28 +0800 Subject: [PATCH 047/168] =?UTF-8?q?=F0=9F=8C=90=20Update=20source=20exampl?= =?UTF-8?q?e=20highlights=20for=20`docs/zh/docs/tutorial/query-params-str-?= =?UTF-8?q?validations.md`=20(#4237)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastiรกn Ramรญrez --- .../docs/tutorial/query-params-str-validations.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/zh/docs/tutorial/query-params-str-validations.md b/docs/zh/docs/tutorial/query-params-str-validations.md index 2a1d41a89..1d1d383d4 100644 --- a/docs/zh/docs/tutorial/query-params-str-validations.md +++ b/docs/zh/docs/tutorial/query-params-str-validations.md @@ -26,7 +26,7 @@ ็Žฐๅœจ๏ผŒๅฐ† `Query` ็”จไฝœๆŸฅ่ฏขๅ‚ๆ•ฐ็š„้ป˜่ฎคๅ€ผ๏ผŒๅนถๅฐ†ๅฎƒ็š„ `max_length` ๅ‚ๆ•ฐ่ฎพ็ฝฎไธบ 50๏ผš -```Python hl_lines="7" +```Python hl_lines="9" {!../../../docs_src/query_params_str_validations/tutorial002.py!} ``` @@ -58,7 +58,7 @@ q: str = Query(None, max_length=50) ไฝ ่ฟ˜ๅฏไปฅๆทปๅŠ  `min_length` ๅ‚ๆ•ฐ๏ผš -```Python hl_lines="7" +```Python hl_lines="9" {!../../../docs_src/query_params_str_validations/tutorial003.py!} ``` @@ -66,7 +66,7 @@ q: str = Query(None, max_length=50) ไฝ ๅฏไปฅๅฎšไน‰ไธ€ไธชๅ‚ๆ•ฐๅ€ผๅฟ…้กปๅŒน้…็š„ๆญฃๅˆ™่กจ่พพๅผ๏ผš -```Python hl_lines="8" +```Python hl_lines="10" {!../../../docs_src/query_params_str_validations/tutorial004.py!} ``` @@ -211,13 +211,13 @@ http://localhost:8000/items/ ไฝ ๅฏไปฅๆทปๅŠ  `title`๏ผš -```Python hl_lines="7" +```Python hl_lines="10" {!../../../docs_src/query_params_str_validations/tutorial007.py!} ``` ไปฅๅŠ `description`๏ผš -```Python hl_lines="11" +```Python hl_lines="13" {!../../../docs_src/query_params_str_validations/tutorial008.py!} ``` @@ -239,7 +239,7 @@ http://127.0.0.1:8000/items/?item-query=foobaritems ่ฟ™ๆ—ถไฝ ๅฏไปฅ็”จ `alias` ๅ‚ๆ•ฐๅฃฐๆ˜Žไธ€ไธชๅˆซๅ๏ผŒ่ฏฅๅˆซๅๅฐ†็”จไบŽๅœจ URL ไธญๆŸฅๆ‰พๆŸฅ่ฏขๅ‚ๆ•ฐๅ€ผ๏ผš -```Python hl_lines="7" +```Python hl_lines="9" {!../../../docs_src/query_params_str_validations/tutorial009.py!} ``` @@ -251,7 +251,7 @@ http://127.0.0.1:8000/items/?item-query=foobaritems ้‚ฃไนˆๅฐ†ๅ‚ๆ•ฐ `deprecated=True` ไผ ๅ…ฅ `Query`๏ผš -```Python hl_lines="16" +```Python hl_lines="18" {!../../../docs_src/query_params_str_validations/tutorial010.py!} ``` From 38902407c0599b9547815dedfb47c0a81320765f Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 10 May 2022 01:26:01 +0000 Subject: [PATCH 048/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 24313be48..b222d0e57 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐ŸŒ Update source example highlights for `docs/zh/docs/tutorial/query-params-str-validations.md`. PR [#4237](https://github.com/tiangolo/fastapi/pull/4237) by [@caimaoy](https://github.com/caimaoy). * ๐Ÿ“ Add external link to blog post about Kafka, FastAPI, and Ably. PR [#4044](https://github.com/tiangolo/fastapi/pull/4044) by [@Ugbot](https://github.com/Ugbot). * ๐ŸŒ Remove translation docs references to aiofiles as it's no longer needed since AnyIO. PR [#3594](https://github.com/tiangolo/fastapi/pull/3594) by [@alonme](https://github.com/alonme). * โœ Fix typo in `docs/en/docs/async.md`. PR [#4726](https://github.com/tiangolo/fastapi/pull/4726) by [@Prezu](https://github.com/Prezu). From 1233a7d93b116422bdc6e87093452a11c1354bc9 Mon Sep 17 00:00:00 2001 From: Rob Gilton Date: Tue, 10 May 2022 02:30:38 +0100 Subject: [PATCH 049/168] =?UTF-8?q?=E2=9C=8F=20Reword=20to=20improve=20leg?= =?UTF-8?q?ibility=20of=20docs=20about=20`TestClient`=20(#4389)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastiรกn Ramรญrez --- docs/en/docs/tutorial/testing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/docs/tutorial/testing.md b/docs/en/docs/tutorial/testing.md index 7e2ae84d0..fea5a54f5 100644 --- a/docs/en/docs/tutorial/testing.md +++ b/docs/en/docs/tutorial/testing.md @@ -10,7 +10,7 @@ With it, you can use Date: Tue, 10 May 2022 01:31:28 +0000 Subject: [PATCH 050/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index b222d0e57..74123c593 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* โœ Reword to improve legibility of docs about `TestClient`. PR [#4389](https://github.com/tiangolo/fastapi/pull/4389) by [@rgilton](https://github.com/rgilton). * ๐ŸŒ Update source example highlights for `docs/zh/docs/tutorial/query-params-str-validations.md`. PR [#4237](https://github.com/tiangolo/fastapi/pull/4237) by [@caimaoy](https://github.com/caimaoy). * ๐Ÿ“ Add external link to blog post about Kafka, FastAPI, and Ably. PR [#4044](https://github.com/tiangolo/fastapi/pull/4044) by [@Ugbot](https://github.com/Ugbot). * ๐ŸŒ Remove translation docs references to aiofiles as it's no longer needed since AnyIO. PR [#3594](https://github.com/tiangolo/fastapi/pull/3594) by [@alonme](https://github.com/alonme). From f9134fe5e473b2a2f9d8cab6323fa015977686b2 Mon Sep 17 00:00:00 2001 From: Kaustubh Gupta Date: Tue, 10 May 2022 07:02:32 +0530 Subject: [PATCH 051/168] =?UTF-8?q?=F0=9F=93=9D=20Add=20external=20link=20?= =?UTF-8?q?to=20article:=205=20Advanced=20Features=20of=20FastAPI=20You=20?= =?UTF-8?q?Should=20Try=20(#4436)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/data/external_links.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/en/data/external_links.yml b/docs/en/data/external_links.yml index a25c3757f..26446720d 100644 --- a/docs/en/data/external_links.yml +++ b/docs/en/data/external_links.yml @@ -1,5 +1,9 @@ articles: english: + - author: Kaustubh Gupta + author_link: https://medium.com/@kaustubhgupta1828/ + link: https://levelup.gitconnected.com/5-advance-features-of-fastapi-you-should-try-7c0ac7eebb3e + title: 5 Advanced Features of FastAPI You Should Try - author: Kaustubh Gupta author_link: https://medium.com/@kaustubhgupta1828/ link: https://www.analyticsvidhya.com/blog/2021/06/deploying-ml-models-as-api-using-fastapi-and-heroku/ From 4ce27b5d4d98261412df2304733399dbafb444f3 Mon Sep 17 00:00:00 2001 From: silvanmelchior Date: Tue, 10 May 2022 03:33:05 +0200 Subject: [PATCH 052/168] =?UTF-8?q?=F0=9F=93=9D=20Add=20external=20link=20?= =?UTF-8?q?to=20article:=20Seamless=20FastAPI=20Configuration=20with=20Con?= =?UTF-8?q?fZ=20(#4414)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastiรกn Ramรญrez --- docs/en/data/external_links.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/en/data/external_links.yml b/docs/en/data/external_links.yml index 26446720d..c3afb7012 100644 --- a/docs/en/data/external_links.yml +++ b/docs/en/data/external_links.yml @@ -1,5 +1,9 @@ articles: english: + - author: Silvan Melchior + author_link: https://github.com/silvanmelchior + link: https://blog.devgenius.io/seamless-fastapi-configuration-with-confz-90949c14ea12 + title: Seamless FastAPI Configuration with ConfZ - author: Kaustubh Gupta author_link: https://medium.com/@kaustubhgupta1828/ link: https://levelup.gitconnected.com/5-advance-features-of-fastapi-you-should-try-7c0ac7eebb3e From 938b1a35428de2e9bbcb18b9004b42b534963e12 Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 10 May 2022 01:33:06 +0000 Subject: [PATCH 053/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 74123c593..0d7a4389f 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐Ÿ“ Add external link to article: 5 Advanced Features of FastAPI You Should Try. PR [#4436](https://github.com/tiangolo/fastapi/pull/4436) by [@kaustubhgupta](https://github.com/kaustubhgupta). * โœ Reword to improve legibility of docs about `TestClient`. PR [#4389](https://github.com/tiangolo/fastapi/pull/4389) by [@rgilton](https://github.com/rgilton). * ๐ŸŒ Update source example highlights for `docs/zh/docs/tutorial/query-params-str-validations.md`. PR [#4237](https://github.com/tiangolo/fastapi/pull/4237) by [@caimaoy](https://github.com/caimaoy). * ๐Ÿ“ Add external link to blog post about Kafka, FastAPI, and Ably. PR [#4044](https://github.com/tiangolo/fastapi/pull/4044) by [@Ugbot](https://github.com/Ugbot). From 453471d07b70e95911352fe3161e690de67e8cbf Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 10 May 2022 01:33:38 +0000 Subject: [PATCH 054/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 0d7a4389f..951e64106 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐Ÿ“ Add external link to article: Seamless FastAPI Configuration with ConfZ. PR [#4414](https://github.com/tiangolo/fastapi/pull/4414) by [@silvanmelchior](https://github.com/silvanmelchior). * ๐Ÿ“ Add external link to article: 5 Advanced Features of FastAPI You Should Try. PR [#4436](https://github.com/tiangolo/fastapi/pull/4436) by [@kaustubhgupta](https://github.com/kaustubhgupta). * โœ Reword to improve legibility of docs about `TestClient`. PR [#4389](https://github.com/tiangolo/fastapi/pull/4389) by [@rgilton](https://github.com/rgilton). * ๐ŸŒ Update source example highlights for `docs/zh/docs/tutorial/query-params-str-validations.md`. PR [#4237](https://github.com/tiangolo/fastapi/pull/4237) by [@caimaoy](https://github.com/caimaoy). From a145d3d2771736180893f10b0fe33ee78db28460 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Mon, 9 May 2022 20:39:10 -0500 Subject: [PATCH 055/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 951e64106..96a51544f 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,18 +2,28 @@ ## Latest Changes +### Upgrades + +* โฌ† Upgrade Starlette from 0.18.0 to 0.19.0. PR [#4488](https://github.com/tiangolo/fastapi/pull/4488) by [@Kludex](https://github.com/Kludex). + * When creating an explicit `JSONResponse` the `content` argument is now required. + +### Docs + * ๐Ÿ“ Add external link to article: Seamless FastAPI Configuration with ConfZ. PR [#4414](https://github.com/tiangolo/fastapi/pull/4414) by [@silvanmelchior](https://github.com/silvanmelchior). * ๐Ÿ“ Add external link to article: 5 Advanced Features of FastAPI You Should Try. PR [#4436](https://github.com/tiangolo/fastapi/pull/4436) by [@kaustubhgupta](https://github.com/kaustubhgupta). * โœ Reword to improve legibility of docs about `TestClient`. PR [#4389](https://github.com/tiangolo/fastapi/pull/4389) by [@rgilton](https://github.com/rgilton). -* ๐ŸŒ Update source example highlights for `docs/zh/docs/tutorial/query-params-str-validations.md`. PR [#4237](https://github.com/tiangolo/fastapi/pull/4237) by [@caimaoy](https://github.com/caimaoy). * ๐Ÿ“ Add external link to blog post about Kafka, FastAPI, and Ably. PR [#4044](https://github.com/tiangolo/fastapi/pull/4044) by [@Ugbot](https://github.com/Ugbot). -* ๐ŸŒ Remove translation docs references to aiofiles as it's no longer needed since AnyIO. PR [#3594](https://github.com/tiangolo/fastapi/pull/3594) by [@alonme](https://github.com/alonme). +* โœ Fix typo in `docs/en/docs/tutorial/sql-databases.md`. PR [#4875](https://github.com/tiangolo/fastapi/pull/4875) by [@wpyoga](https://github.com/wpyoga). * โœ Fix typo in `docs/en/docs/async.md`. PR [#4726](https://github.com/tiangolo/fastapi/pull/4726) by [@Prezu](https://github.com/Prezu). + +### Translations + +* ๐ŸŒ Update source example highlights for `docs/zh/docs/tutorial/query-params-str-validations.md`. PR [#4237](https://github.com/tiangolo/fastapi/pull/4237) by [@caimaoy](https://github.com/caimaoy). +* ๐ŸŒ Remove translation docs references to aiofiles as it's no longer needed since AnyIO. PR [#3594](https://github.com/tiangolo/fastapi/pull/3594) by [@alonme](https://github.com/alonme). * โœ ๐ŸŒ Fix typo in Portuguese translation for `docs/pt/docs/tutorial/path-params.md`. PR [#4722](https://github.com/tiangolo/fastapi/pull/4722) by [@CleoMenezesJr](https://github.com/CleoMenezesJr). * ๐ŸŒ Fix live docs server for translations for some languages. PR [#4729](https://github.com/tiangolo/fastapi/pull/4729) by [@wakabame](https://github.com/wakabame). * ๐ŸŒ Add Portuguese translation for `docs/pt/docs/tutorial/cookie-params.md`. PR [#4112](https://github.com/tiangolo/fastapi/pull/4112) by [@lbmendes](https://github.com/lbmendes). * ๐ŸŒ Fix French translation for `docs/tutorial/body.md`. PR [#4332](https://github.com/tiangolo/fastapi/pull/4332) by [@Smlep](https://github.com/Smlep). -* โœ Fix typo in `docs/en/docs/tutorial/sql-databases.md`. PR [#4875](https://github.com/tiangolo/fastapi/pull/4875) by [@wpyoga](https://github.com/wpyoga). * ๐ŸŒ Add Japanese translation for `docs/ja/docs/advanced/conditional-openapi.md`. PR [#2631](https://github.com/tiangolo/fastapi/pull/2631) by [@sh0nk](https://github.com/sh0nk). * ๐ŸŒ Fix Japanese translation of `docs/ja/docs/tutorial/body.md`. PR [#3062](https://github.com/tiangolo/fastapi/pull/3062) by [@a-takahashi223](https://github.com/a-takahashi223). * ๐ŸŒ Add Portuguese translation for `docs/pt/docs/tutorial/background-tasks.md`. PR [#2170](https://github.com/tiangolo/fastapi/pull/2170) by [@izaguerreiro](https://github.com/izaguerreiro). @@ -22,7 +32,6 @@ * ๐ŸŒ Add Portuguese translation for `docs/tutorial/body.md`. PR [#3960](https://github.com/tiangolo/fastapi/pull/3960) by [@leandrodesouzadev](https://github.com/leandrodesouzadev). * ๐ŸŒ Add Portuguese translation of `tutorial/extra-data-types.md`. PR [#4077](https://github.com/tiangolo/fastapi/pull/4077) by [@luccasmmg](https://github.com/luccasmmg). * ๐ŸŒ Update German translation for `docs/features.md`. PR [#3905](https://github.com/tiangolo/fastapi/pull/3905) by [@jomue](https://github.com/jomue). -* โฌ† Upgrade Starlette from 0.18.0 to 0.19.0. PR [#4488](https://github.com/tiangolo/fastapi/pull/4488) by [@Kludex](https://github.com/Kludex). ## 0.76.0 From 069645444547cdfb083f84e84982f03fb4e597cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Mon, 9 May 2022 20:40:03 -0500 Subject: [PATCH 056/168] =?UTF-8?q?=F0=9F=94=96=20Release=20version=200.77?= =?UTF-8?q?.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 3 +++ fastapi/__init__.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 96a51544f..64d784916 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,9 @@ ## Latest Changes + +## 0.77.0 + ### Upgrades * โฌ† Upgrade Starlette from 0.18.0 to 0.19.0. PR [#4488](https://github.com/tiangolo/fastapi/pull/4488) by [@Kludex](https://github.com/Kludex). diff --git a/fastapi/__init__.py b/fastapi/__init__.py index fcd036ee4..c4c04525b 100644 --- a/fastapi/__init__.py +++ b/fastapi/__init__.py @@ -1,6 +1,6 @@ """FastAPI framework, high performance, easy to learn, fast to code, ready for production""" -__version__ = "0.76.0" +__version__ = "0.77.0" from starlette import status as status From f3969120438a104597a2d7e62039b00264360fa3 Mon Sep 17 00:00:00 2001 From: Marcelo Trylesinski Date: Tue, 10 May 2022 05:22:26 +0200 Subject: [PATCH 057/168] =?UTF-8?q?=E2=AC=86=20Upgrade=20Starlette=20from?= =?UTF-8?q?=200.19.0=20to=200.19.1=20(#4819)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastiรกn Ramรญrez --- fastapi/applications.py | 20 ++++++++++++++------ fastapi/exceptions.py | 4 +--- fastapi/routing.py | 10 +++++----- pyproject.toml | 2 +- 4 files changed, 21 insertions(+), 15 deletions(-) diff --git a/fastapi/applications.py b/fastapi/applications.py index 132a94c9a..7530ddb9b 100644 --- a/fastapi/applications.py +++ b/fastapi/applications.py @@ -1,5 +1,16 @@ from enum import Enum -from typing import Any, Callable, Coroutine, Dict, List, Optional, Sequence, Type, Union +from typing import ( + Any, + Awaitable, + Callable, + Coroutine, + Dict, + List, + Optional, + Sequence, + Type, + Union, +) from fastapi import routing from fastapi.datastructures import Default, DefaultPlaceholder @@ -121,11 +132,8 @@ class FastAPI(Starlette): generate_unique_id_function=generate_unique_id_function, ) self.exception_handlers: Dict[ - Union[int, Type[Exception]], - Callable[[Request, Any], Coroutine[Any, Any, Response]], - ] = ( - {} if exception_handlers is None else dict(exception_handlers) - ) + Any, Callable[[Request, Any], Union[Response, Awaitable[Response]]] + ] = ({} if exception_handlers is None else dict(exception_handlers)) self.exception_handlers.setdefault(HTTPException, http_exception_handler) self.exception_handlers.setdefault( RequestValidationError, request_validation_exception_handler diff --git a/fastapi/exceptions.py b/fastapi/exceptions.py index fcb718748..0f50acc6c 100644 --- a/fastapi/exceptions.py +++ b/fastapi/exceptions.py @@ -12,9 +12,7 @@ class HTTPException(StarletteHTTPException): detail: Any = None, headers: Optional[Dict[str, Any]] = None, ) -> None: - super().__init__( - status_code=status_code, detail=detail, headers=headers # type: ignore - ) + super().__init__(status_code=status_code, detail=detail, headers=headers) RequestErrorModel: Type[BaseModel] = create_model("Request") diff --git a/fastapi/routing.py b/fastapi/routing.py index 6680c04ed..db39d3ffd 100644 --- a/fastapi/routing.py +++ b/fastapi/routing.py @@ -478,11 +478,11 @@ class APIRouter(routing.Router): ), ) -> None: super().__init__( - routes=routes, # type: ignore # in Starlette + routes=routes, redirect_slashes=redirect_slashes, - default=default, # type: ignore # in Starlette - on_startup=on_startup, # type: ignore # in Starlette - on_shutdown=on_shutdown, # type: ignore # in Starlette + default=default, + on_startup=on_startup, + on_shutdown=on_shutdown, ) if prefix: assert prefix.startswith("/"), "A path prefix must start with '/'" @@ -757,7 +757,7 @@ class APIRouter(routing.Router): generate_unique_id_function=current_generate_unique_id, ) elif isinstance(route, routing.Route): - methods = list(route.methods or []) # type: ignore # in Starlette + methods = list(route.methods or []) self.add_route( prefix + route.path, route.endpoint, diff --git a/pyproject.toml b/pyproject.toml index fc803f8fc..b23d0db05 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,7 @@ classifiers = [ "Topic :: Internet :: WWW/HTTP", ] requires = [ - "starlette==0.19.0", + "starlette==0.19.1", "pydantic >=1.6.2,!=1.7,!=1.7.1,!=1.7.2,!=1.7.3,!=1.8,!=1.8.1,<2.0.0", ] description-file = "README.md" From 9a87c6d8d2da1d8b4feb94e16f030ac24f56b103 Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 10 May 2022 03:23:03 +0000 Subject: [PATCH 058/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 64d784916..524adcf92 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* โฌ† Upgrade Starlette from 0.19.0 to 0.19.1. PR [#4819](https://github.com/tiangolo/fastapi/pull/4819) by [@Kludex](https://github.com/Kludex). ## 0.77.0 From 9262a699f255fe98a1681b16df5d63fc6883efb0 Mon Sep 17 00:00:00 2001 From: Yashasvi Singh Date: Tue, 10 May 2022 09:02:21 +0530 Subject: [PATCH 059/168] =?UTF-8?q?=F0=9F=93=9D=20Add=20external=20link=20?= =?UTF-8?q?to=20article:=20Building=20an=20API=20with=20FastAPI=20and=20Su?= =?UTF-8?q?pabase=20and=20Deploying=20on=20Deta=20(#4440)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastiรกn Ramรญrez --- docs/en/data/external_links.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/en/data/external_links.yml b/docs/en/data/external_links.yml index c3afb7012..86c0aafcc 100644 --- a/docs/en/data/external_links.yml +++ b/docs/en/data/external_links.yml @@ -32,6 +32,10 @@ articles: author_link: https://rodrigo-arenas.medium.com/ link: https://medium.com/analytics-vidhya/serve-a-machine-learning-model-using-sklearn-fastapi-and-docker-85aabf96729b title: "Serve a machine learning model using Sklearn, FastAPI and Docker" + - author: Yashasvi Singh + author_link: https://hashnode.com/@aUnicornDev + link: https://aunicorndev.hashnode.dev/series/supafast-api + title: "Building an API with FastAPI and Supabase and Deploying on Deta" - author: Navule Pavan Kumar Rao author_link: https://www.linkedin.com/in/navule/ link: https://www.tutlinks.com/deploy-fastapi-on-ubuntu-gunicorn-caddy-2/ From 170123a41f140c23ee252c87aff350662d0312f5 Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 10 May 2022 03:32:54 +0000 Subject: [PATCH 060/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 524adcf92..89f0bf037 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐Ÿ“ Add external link to article: Building an API with FastAPI and Supabase and Deploying on Deta. PR [#4440](https://github.com/tiangolo/fastapi/pull/4440) by [@aUnicornDev](https://github.com/aUnicornDev). * โฌ† Upgrade Starlette from 0.19.0 to 0.19.1. PR [#4819](https://github.com/tiangolo/fastapi/pull/4819) by [@Kludex](https://github.com/Kludex). ## 0.77.0 From 98bb5480a53648dad3daae67fba222689cc7007a Mon Sep 17 00:00:00 2001 From: Mukul Mantosh Date: Tue, 10 May 2022 09:03:51 +0530 Subject: [PATCH 061/168] =?UTF-8?q?=F0=9F=93=9D=20Add=20external=20link:?= =?UTF-8?q?=20PyCharm=20Guide=20to=20FastAPI=20(#4512)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Mukul Mantosh Co-authored-by: Sebastiรกn Ramรญrez --- docs/en/data/external_links.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/en/data/external_links.yml b/docs/en/data/external_links.yml index 86c0aafcc..6d358089d 100644 --- a/docs/en/data/external_links.yml +++ b/docs/en/data/external_links.yml @@ -204,6 +204,10 @@ articles: author_link: https://medium.com/@williamhayes link: https://medium.com/@williamhayes/fastapi-starlette-debug-vs-prod-5f7561db3a59 title: FastAPI/Starlette debug vs prod + - author: Mukul Mantosh + author_link: https://twitter.com/MantoshMukul + link: https://www.jetbrains.com/pycharm/guide/tutorials/fastapi-aws-kubernetes/ + title: Developing FastAPI Application using K8s & AWS german: - author: Nico Axtmann author_link: https://twitter.com/_nicoax From 88606940f58a5b8732354954121f280cb5548e3d Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 10 May 2022 03:34:23 +0000 Subject: [PATCH 062/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 89f0bf037..ad73f949e 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐Ÿ“ Add external link: PyCharm Guide to FastAPI. PR [#4512](https://github.com/tiangolo/fastapi/pull/4512) by [@mukulmantosh](https://github.com/mukulmantosh). * ๐Ÿ“ Add external link to article: Building an API with FastAPI and Supabase and Deploying on Deta. PR [#4440](https://github.com/tiangolo/fastapi/pull/4440) by [@aUnicornDev](https://github.com/aUnicornDev). * โฌ† Upgrade Starlette from 0.19.0 to 0.19.1. PR [#4819](https://github.com/tiangolo/fastapi/pull/4819) by [@Kludex](https://github.com/Kludex). From 6337186ff4add4a612205ba5c30c75f3fff5e0eb Mon Sep 17 00:00:00 2001 From: Kiko Ilievski <64956873+KikoIlievski@users.noreply.github.com> Date: Tue, 10 May 2022 15:35:21 +1200 Subject: [PATCH 063/168] =?UTF-8?q?=E2=9C=8F=20Fix=20small=20typo=20in=20`?= =?UTF-8?q?docs/en/docs/tutorial/security/first-steps.md`=20(#4515)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastiรกn Ramรญrez --- docs/en/docs/tutorial/security/first-steps.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/docs/tutorial/security/first-steps.md b/docs/en/docs/tutorial/security/first-steps.md index 360d85ae4..45ffaab90 100644 --- a/docs/en/docs/tutorial/security/first-steps.md +++ b/docs/en/docs/tutorial/security/first-steps.md @@ -121,7 +121,7 @@ When we create an instance of the `OAuth2PasswordBearer` class we pass in the `t ``` !!! tip - here `tokenUrl="token"` refers to a relative URL `token` that we haven't created yet. As it's a relative URL, it's equivalent to `./token`. + Here `tokenUrl="token"` refers to a relative URL `token` that we haven't created yet. As it's a relative URL, it's equivalent to `./token`. Because we are using a relative URL, if your API was located at `https://example.com/`, then it would refer to `https://example.com/token`. But if your API was located at `https://example.com/api/v1/`, then it would refer to `https://example.com/api/v1/token`. From cc51b251ddb0439b4bb28c20eeea0b0571761ad3 Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 10 May 2022 03:35:53 +0000 Subject: [PATCH 064/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index ad73f949e..bb16b6143 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* โœ Fix small typo in `docs/en/docs/tutorial/security/first-steps.md`. PR [#4515](https://github.com/tiangolo/fastapi/pull/4515) by [@KikoIlievski](https://github.com/KikoIlievski). * ๐Ÿ“ Add external link: PyCharm Guide to FastAPI. PR [#4512](https://github.com/tiangolo/fastapi/pull/4512) by [@mukulmantosh](https://github.com/mukulmantosh). * ๐Ÿ“ Add external link to article: Building an API with FastAPI and Supabase and Deploying on Deta. PR [#4440](https://github.com/tiangolo/fastapi/pull/4440) by [@aUnicornDev](https://github.com/aUnicornDev). * โฌ† Upgrade Starlette from 0.19.0 to 0.19.1. PR [#4819](https://github.com/tiangolo/fastapi/pull/4819) by [@Kludex](https://github.com/Kludex). From 71ea5883cd671e49511e94c845e36b3925aca23f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Mon, 9 May 2022 23:02:55 -0500 Subject: [PATCH 065/168] =?UTF-8?q?=F0=9F=94=A7=20Add=20notifications=20in?= =?UTF-8?q?=20issue=20for=20Uzbek=20translations=20(#4884)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/actions/notify-translations/app/translations.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/notify-translations/app/translations.yml b/.github/actions/notify-translations/app/translations.yml index f0bccd470..0e5093f3a 100644 --- a/.github/actions/notify-translations/app/translations.yml +++ b/.github/actions/notify-translations/app/translations.yml @@ -14,3 +14,4 @@ de: 3716 id: 3717 az: 3994 nl: 4701 +uz: 4883 From 764703cc564c12bd7edb064a19ff572099432f1c Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 10 May 2022 04:03:35 +0000 Subject: [PATCH 066/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index bb16b6143..e39b507b6 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐Ÿ”ง Add notifications in issue for Uzbek translations. PR [#4884](https://github.com/tiangolo/fastapi/pull/4884) by [@tiangolo](https://github.com/tiangolo). * โœ Fix small typo in `docs/en/docs/tutorial/security/first-steps.md`. PR [#4515](https://github.com/tiangolo/fastapi/pull/4515) by [@KikoIlievski](https://github.com/KikoIlievski). * ๐Ÿ“ Add external link: PyCharm Guide to FastAPI. PR [#4512](https://github.com/tiangolo/fastapi/pull/4512) by [@mukulmantosh](https://github.com/mukulmantosh). * ๐Ÿ“ Add external link to article: Building an API with FastAPI and Supabase and Deploying on Deta. PR [#4440](https://github.com/tiangolo/fastapi/pull/4440) by [@aUnicornDev](https://github.com/aUnicornDev). From 2a91ee945dd9de283ce6f50e34873176f2d39a53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCrmeyer?= Date: Tue, 10 May 2022 06:05:10 +0200 Subject: [PATCH 067/168] =?UTF-8?q?=F0=9F=93=9D=20Add=20link=20to=20german?= =?UTF-8?q?=20article:=20REST-API=20Programmieren=20mittels=20Python=20und?= =?UTF-8?q?=20dem=20FastAPI=20Modul=20(#4624)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A beginner article in German to get started with the FastAPI with a small Todo API as an example. Co-authored-by: Sebastiรกn Ramรญrez --- docs/en/data/external_links.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/en/data/external_links.yml b/docs/en/data/external_links.yml index 6d358089d..b918c8fd3 100644 --- a/docs/en/data/external_links.yml +++ b/docs/en/data/external_links.yml @@ -213,6 +213,10 @@ articles: author_link: https://twitter.com/_nicoax link: https://blog.codecentric.de/2019/08/inbetriebnahme-eines-scikit-learn-modells-mit-onnx-und-fastapi/ title: Inbetriebnahme eines scikit-learn-Modells mit ONNX und FastAPI + - author: Felix Schรผrmeyer + author_link: https://hellocoding.de/autor/felix-schuermeyer/ + link: https://hellocoding.de/blog/coding-language/python/fastapi + title: REST-API Programmieren mittels Python und dem FastAPI Modul japanese: - author: '@bee2' author_link: https://qiita.com/bee2 From 86c459d1e86356ddc3d6e751405e999f29358420 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateus=20Jos=C3=A9?= Date: Tue, 10 May 2022 01:05:45 -0300 Subject: [PATCH 068/168] =?UTF-8?q?=F0=9F=8C=90=20Add=20Portuguese=20trans?= =?UTF-8?q?lation=20for=20`docs/pt/docs/help-fastapi.md`=20(#4583)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastiรกn Ramรญrez --- docs/pt/docs/help-fastapi.md | 148 +++++++++++++++++++++++++++++++++++ docs/pt/mkdocs.yml | 1 + 2 files changed, 149 insertions(+) create mode 100644 docs/pt/docs/help-fastapi.md diff --git a/docs/pt/docs/help-fastapi.md b/docs/pt/docs/help-fastapi.md new file mode 100644 index 000000000..086273a1d --- /dev/null +++ b/docs/pt/docs/help-fastapi.md @@ -0,0 +1,148 @@ +# Ajuda FastAPI - Obter Ajuda + +Vocรช gosta do **FastAPI**? + +Vocรช gostaria de ajudar o FastAPI, outros usรกrios, e o autor? + +Ou vocรช gostaria de obter ajuda relacionada ao **FastAPI**?? + +Existem mรฉtodos muito simples de ajudar (A maioria das ajudas podem ser feitas com um ou dois cliques). + +E tambรฉm existem vรกrios modos de se conseguir ajuda. + +## Inscreva-se na newsletter + +Vocรช pode se inscrever (pouco frequente) [**FastAPI e amigos** newsletter](/newsletter/){.internal-link target=_blank} para receber atualizaรงรตes: + +* Notรญcias sobre FastAPI e amigos ๐Ÿš€ +* Tutoriais ๐Ÿ“ +* Recursos โœจ +* Mudanรงas de รบltima hora ๐Ÿšจ +* Truques e dicas โœ… + +## Siga o FastAPI no twitter + +Siga @fastapi no **Twitter** para receber as รบltimas notรญcias sobre o **FastAPI**. ๐Ÿฆ + +## Favorite o **FastAPI** no GitHub + +Vocรช pode "favoritar" o FastAPI no GitHub (clicando na estrela no canto superior direito): https://github.com/tiangolo/fastapi. โญ๏ธ + +Favoritando, outros usuรกrios poderรฃo encontrar mais facilmente e verรฃo que jรก foi รบtil para muita gente. + +## Acompanhe novos updates no repositorio do GitHub + +Vocรช pode "acompanhar" (watch) o FastAPI no GitHub (clicando no botรฃo com um "olho" no canto superior direito): https://github.com/tiangolo/fastapi. ๐Ÿ‘€ + +Podendo selecionar apenas "Novos Updates". + +Fazendo isto, serรฃo enviadas notificaรงรตes (em seu email) sempre que tiver novos updates (uma nova versรฃo) com correรงรตes de bugs e novos recursos no **FastAPI** + +## Conect-se com o autor + +Vocรช pode se conectar comigo (Sebastiรกn Ramรญrez / `tiangolo`), o autor. + +Vocรช pode: + +* Me siga no **GitHub**. + * Ver tambรฉm outros projetos Open Source criados por mim que podem te ajudar. + * Me seguir para saber quando um novo projeto Open Source for criado. +* Me siga no **Twitter**. + * Me dizer o motivo pelo o qual vocรช estรก usando o FastAPI(Adoro ouvir esse tipo de comentรกrio). + * Saber quando eu soltar novos anรบncios ou novas ferramentas. + * Tambรฉm รฉ possivel seguir o @fastapi no Twitter (uma conta aparte). +* Conect-se comigo no **Linkedin**. + * Saber quando eu fizer novos anรบncios ou novas ferramentas (apesar de que uso o twitter com mais frequรชncia ๐Ÿคทโ€โ™‚). +* Ler meus artigos (ou me seguir) no **Dev.to** ou no **Medium**. + * Ficar por dentro de novas ideias, artigos, e ferramentas criadas por mim. + * Me siga para saber quando eu publicar algo novo. + +## Tweete sobre **FastAPI** + +Tweete sobre o **FastAPI** e compartilhe comigo e com os outros o porque de gostar do FastAPI. ๐ŸŽ‰ + +Adoro ouvir sobre como o **FastAPI** รฉ usado, o que vocรช gosta nele, em qual projeto/empresa estรก sendo usado, etc. + +## Vote no FastAPI + +* Vote no **FastAPI** no Slant. +* Vote no **FastAPI** no AlternativeTo. + +## Responda perguntas no GitHub + +Vocรช pode acompanhar as perguntas existentes e tentar ajudar outros, . ๐Ÿค“ + +Ajudando a responder as questรตes de varias pessoas, vocรช pode se tornar um [Expert em FastAPI](fastapi-people.md#experts){.internal-link target=_blank} oficial. ๐ŸŽ‰ + +## Acompanhe o repositรณrio do GitHub + +Vocรช pode "acompanhar" (watch) o FastAPI no GitHub (clicando no "olho" no canto superior direito): https://github.com/tiangolo/fastapi. ๐Ÿ‘€ + +Se vocรช selecionar "Acompanhando" (Watching) em vez de "Apenas Lanรงamentos" (Releases only) vocรช receberรก notificaรงรตes quando alguรฉm tiver uma nova pergunta. + +Assim podendo tentar ajudar a resolver essas questรตes. + +## Faรงa perguntas + +ร‰ possรญvel criar uma nova pergunta no repositรณrio do GitHub, por exemplo: + +* Faรงa uma **pergunta** ou pergunte sobre um **problema**. +* Sugira novos **recursos**. + +**Nota**: Se vocรช fizer uma pergunta, entรฃo eu gostaria de pedir que vocรช tambรฉm ajude os outros com suas respectivas perguntas. ๐Ÿ˜‰ + +## Crie um Pull Request + +ร‰ possรญvel [contribuir](contributing.md){.internal-link target=_blank} no cรณdigo fonte fazendo Pull Requests, por exemplo: + +* Para corrigir um erro de digitaรงรฃo que vocรช encontrou na documentaรงรฃo. +* Para compartilhar um artigo, video, ou podcast criados por vocรช sobre o FastAPI editando este arquivo. + * Nรฃo se esqueรงa de adicionar o link no comeรงo da seรงรฃo correspondente. +* Para ajudar [traduzir a documentaรงรฃo](contributing.md#translations){.internal-link target=_blank} para sua lingua. + * Tambรฉm รฉ possivel revisar as traduรงรตes jรก existentes. +* Para propor novas seรงรตes na documentaรงรฃo. +* Para corrigir um bug/questรฃo. +* Para adicionar um novo recurso. + +## Entre no chat + +Entre no ๐Ÿ‘ฅ server de conversa do Discord ๐Ÿ‘ฅ e conheรงa novas pessoas da comunidade +do FastAPI. + +!!! dica + Para perguntas, pergunte nas questรตes do GitHub, lรก tem um chance maior de vocรช ser ajudado sobre o FastAPI [FastAPI Experts](fastapi-people.md#experts){.internal-link target=_blank}. + + Use o chat apenas para outro tipo de assunto. + +Tambรฉm existe o chat do Gitter, porรฉm ele nรฃo possuรญ canais e recursos avanรงados, conversas sรฃo mais engessadas, por isso o Discord รฉ mais recomendado. + +### Nรฃo faรงa perguntas no chat + +Tenha em mente que os chats permitem uma "conversa mais livre", dessa forma รฉ muito fรกcil fazer perguntas que sรฃo muito genรฉricas e dificeรญs de responder, assim vocรช pode acabar nรฃo sendo respondido. + +Nas questรตes do GitHub o template irรก te guiar para que vocรช faรงa a sua pergunta de um jeito mais correto, fazendo com que vocรช receba respostas mais completas, e atรฉ mesmo que vocรช mesmo resolva o problema antes de perguntar. E no GitHub eu garanto que sempre irei responder todas as perguntas, mesmo que leve um tempo. Eu pessoalmente nรฃo consigo fazer isso via chat. ๐Ÿ˜… + +Conversas no chat nรฃo sรฃo tรฃo fรกceis de serem encontrados quanto no GitHub, entรฃo questรตes e respostas podem se perder dentro da conversa. E apenas as que estรฃo nas questรตes do GitHub contam para vocรช se tornar um [Expert em FastAPI](fastapi-people.md#experts){.internal-link target=_blank}, entรฃo vocรช receberรก mais atenรงรฃo nas questรตes do GitHub. + +Por outro lado, existem milhares de usuรกrios no chat, entรฃo tem uma grande chance de vocรช encontrar alguรฉm para trocar uma idรฉia por lรก em qualquer horรกrio. ๐Ÿ˜„ + +## Patrocine o autor + +Vocรช tambรฉm pode ajudar o autor financeiramente (eu) atravรฉs do GitHub sponsors. + +Lรก vocรช pode me pagar um cafรฉzinho โ˜•๏ธ como agradecimento. ๐Ÿ˜„ + +E vocรช tambรฉm pode se tornar um patrocinador Prata ou Ouro do FastAPI. ๐Ÿ…๐ŸŽ‰ + +## Patrocine as ferramente que potencializam o FastAPI + +Como vocรช viu na documentaรงรฃo, o FastAPI se apoia em nos gigantes, Starlette e Pydantic. + +Patrocine tambรฉm: + +* Samuel Colvin (Pydantic) +* Encode (Starlette, Uvicorn) + +--- + +Muito Obrigado! ๐Ÿš€ diff --git a/docs/pt/mkdocs.yml b/docs/pt/mkdocs.yml index 9111ef622..253400800 100644 --- a/docs/pt/mkdocs.yml +++ b/docs/pt/mkdocs.yml @@ -78,6 +78,7 @@ nav: - history-design-future.md - external-links.md - benchmarks.md +- help-fastapi.md markdown_extensions: - toc: permalink: true From 8082b45f24953771d5efc611fa8b0dc6f5c4f486 Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 10 May 2022 04:05:48 +0000 Subject: [PATCH 069/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index e39b507b6..8e123f1e4 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐Ÿ“ Add link to german article: REST-API Programmieren mittels Python und dem FastAPI Modul. PR [#4624](https://github.com/tiangolo/fastapi/pull/4624) by [@fschuermeyer](https://github.com/fschuermeyer). * ๐Ÿ”ง Add notifications in issue for Uzbek translations. PR [#4884](https://github.com/tiangolo/fastapi/pull/4884) by [@tiangolo](https://github.com/tiangolo). * โœ Fix small typo in `docs/en/docs/tutorial/security/first-steps.md`. PR [#4515](https://github.com/tiangolo/fastapi/pull/4515) by [@KikoIlievski](https://github.com/KikoIlievski). * ๐Ÿ“ Add external link: PyCharm Guide to FastAPI. PR [#4512](https://github.com/tiangolo/fastapi/pull/4512) by [@mukulmantosh](https://github.com/mukulmantosh). From 9b4e6751bbca9ebfdcb588e4e5ce161b5fad5828 Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 10 May 2022 04:06:19 +0000 Subject: [PATCH 070/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 8e123f1e4..5c45b3a56 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐ŸŒ Add Portuguese translation for `docs/pt/docs/help-fastapi.md`. PR [#4583](https://github.com/tiangolo/fastapi/pull/4583) by [@mateusjs](https://github.com/mateusjs). * ๐Ÿ“ Add link to german article: REST-API Programmieren mittels Python und dem FastAPI Modul. PR [#4624](https://github.com/tiangolo/fastapi/pull/4624) by [@fschuermeyer](https://github.com/fschuermeyer). * ๐Ÿ”ง Add notifications in issue for Uzbek translations. PR [#4884](https://github.com/tiangolo/fastapi/pull/4884) by [@tiangolo](https://github.com/tiangolo). * โœ Fix small typo in `docs/en/docs/tutorial/security/first-steps.md`. PR [#4515](https://github.com/tiangolo/fastapi/pull/4515) by [@KikoIlievski](https://github.com/KikoIlievski). From b1e691091d85503a44685d72284bbe0ff30b0aaf Mon Sep 17 00:00:00 2001 From: Mohammad Raisul ISlam Date: Tue, 10 May 2022 10:07:45 +0600 Subject: [PATCH 071/168] =?UTF-8?q?=E2=9C=8F=20Fix=20typo=20in=20deploymen?= =?UTF-8?q?t=20(#4629)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: raisul1234 Co-authored-by: Sebastiรกn Ramรญrez --- docs/en/docs/deployment/manually.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/docs/deployment/manually.md b/docs/en/docs/deployment/manually.md index 7fd1f4d4f..16286533a 100644 --- a/docs/en/docs/deployment/manually.md +++ b/docs/en/docs/deployment/manually.md @@ -59,7 +59,7 @@ You can install an ASGI compatible server with: ## Run the Server Program -You can then your application the same way you have done in the tutorials, but without the `--reload` option, e.g.: +You can then run your application the same way you have done in the tutorials, but without the `--reload` option, e.g.: === "Uvicorn" From d0e40150341f22a793484cd91832ecf9bfcbf30c Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 10 May 2022 04:08:22 +0000 Subject: [PATCH 072/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 5c45b3a56..ab1107ebd 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* โœ Fix typo in deployment. PR [#4629](https://github.com/tiangolo/fastapi/pull/4629) by [@raisulislam541](https://github.com/raisulislam541). * ๐ŸŒ Add Portuguese translation for `docs/pt/docs/help-fastapi.md`. PR [#4583](https://github.com/tiangolo/fastapi/pull/4583) by [@mateusjs](https://github.com/mateusjs). * ๐Ÿ“ Add link to german article: REST-API Programmieren mittels Python und dem FastAPI Modul. PR [#4624](https://github.com/tiangolo/fastapi/pull/4624) by [@fschuermeyer](https://github.com/fschuermeyer). * ๐Ÿ”ง Add notifications in issue for Uzbek translations. PR [#4884](https://github.com/tiangolo/fastapi/pull/4884) by [@tiangolo](https://github.com/tiangolo). From 350745c54512c132a93235365cfcbc094e6bca23 Mon Sep 17 00:00:00 2001 From: Maciej Kaczkowski Date: Tue, 10 May 2022 06:12:18 +0200 Subject: [PATCH 073/168] =?UTF-8?q?=F0=9F=8C=90=20Add=20Polish=20translati?= =?UTF-8?q?on=20for=20`docs/pl/docs/tutorial/index.md`=20(#4516)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastiรกn Ramรญrez --- docs/pl/docs/tutorial/index.md | 81 ++++++++++++++++++++++++++++++++++ docs/pl/mkdocs.yml | 2 + 2 files changed, 83 insertions(+) create mode 100644 docs/pl/docs/tutorial/index.md diff --git a/docs/pl/docs/tutorial/index.md b/docs/pl/docs/tutorial/index.md new file mode 100644 index 000000000..1a97214af --- /dev/null +++ b/docs/pl/docs/tutorial/index.md @@ -0,0 +1,81 @@ +# Samouczek - Wprowadzenie + +Ten samouczek pokaลผe Ci, krok po kroku, jak uลผywaฤ‡ wiฤ™kszoล›ci funkcji **FastAPI**. + +Kaลผda czฤ™ล›ฤ‡ korzysta z poprzednich, ale jest jednoczeล›nie osobnym tematem. Moลผesz przejล›ฤ‡ bezpoล›rednio do kaลผdego rozdziaล‚u, jeล›li szukasz rozwiฤ…zania konkretnego problemu. + +Samouczek jest tak zbudowany, ลผeby sล‚uลผyล‚ jako punkt odniesienia w przyszล‚oล›ci. + +Moลผesz wracaฤ‡ i sprawdzaฤ‡ dokล‚adnie to czego potrzebujesz. + +## Wykonywanie kodu + +Wszystkie fragmenty kodu mogฤ… byฤ‡ skopiowane bezpoล›rednio i uลผyte (sฤ… poprawnymi i przetestowanymi plikami). + +ลปeby wykonaฤ‡ kaลผdy przykล‚ad skopiuj kod to pliku `main.py` i uruchom `uvicorn` za pomocฤ…: + +
+ +```console +$ uvicorn main:app --reload + +INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit) +INFO: Started reloader process [28720] +INFO: Started server process [28722] +INFO: Waiting for application startup. +INFO: Application startup complete. +``` + +
+ +**BARDZO zalecamy** pisanie bฤ…dลบ kopiowanie kodu, edycjฤ™, a nastฤ™pnie wykonywanie go lokalnie. + +Uลผycie w Twoim edytorze jest tym, co pokazuje prawdziwe korzyล›ci z FastAPI, pozwala zobaczyฤ‡ jak maล‚o kodu musisz napisaฤ‡, wszystkie funkcje, takie jak kontrola typรณw, automatyczne uzupeล‚nianie, itd. + +--- + +## Instalacja FastAPI + +Jako pierwszy krok zainstaluj FastAPI. + +Na potrzeby samouczka moลผesz zainstalowaฤ‡ rรณwnieลผ wszystkie opcjonalne biblioteki: + +
+ +```console +$ pip install "fastapi[all]" + +---> 100% +``` + +
+ +...wliczajฤ…c w to `uvicorn`, ktรณry bฤ™dzie sล‚uลผyล‚ jako serwer wykonujacy Twรณj kod. + +!!! note + Moลผesz rรณwnieลผ wykonaฤ‡ instalacjฤ™ "krok po kroku". + + Prawdopodobnie zechcesz to zrobiฤ‡, kiedy bฤ™dziesz wdraลผaฤ‡ swojฤ… aplikacjฤ™ w ล›rodowisku produkcyjnym: + + ``` + pip install fastapi + ``` + + Zainstaluj teลผ `uvicorn`, ktรณry bฤ™dzie sล‚uลผyล‚ jako serwer: + + ``` + pip install "uvicorn[standard]" + ``` + + Tak samo moลผesz zainstalowaฤ‡ wszystkie dodatkowe biblioteki, ktรณrych chcesz uลผyฤ‡. + +## Zaawansowany poradnik + +Jest teลผ **Zaawansowany poradnik**, ktรณry moลผesz przeczytaฤ‡ po lekturze tego **Samouczka**. + +**Zaawansowany poradnik** opiera siฤ™ na tym samouczku, uลผywa tych samych pojฤ™ฤ‡, ลผeby pokazaฤ‡ Ci kilka dodatkowych funkcji. + +Najpierw jednak powinieneล› przeczytaฤ‡ **Samouczek** (czytasz go teraz). + +Ten rozdziaล‚ jest zaprojektowany tak, ลผe moลผesz stworzyฤ‡ kompletnฤ… aplikacjฤ™ uลผywajฤ…c tylko informacji tutaj zawartych, a nastฤ™pnie rozszerzaฤ‡ jฤ… na rรณลผne sposoby, w zaleลผnoล›ci od potrzeb, uลผywajฤ…c kilku dodatkowych pomysล‚รณw z **Zaawansowanego poradnika**. + diff --git a/docs/pl/mkdocs.yml b/docs/pl/mkdocs.yml index 67b41fe53..932a43da4 100644 --- a/docs/pl/mkdocs.yml +++ b/docs/pl/mkdocs.yml @@ -54,6 +54,8 @@ nav: - tr: /tr/ - uk: /uk/ - zh: /zh/ +- Samouczek: + - tutorial/index.md markdown_extensions: - toc: permalink: true From a7e659e472ad42a3fa42dd3134dc092b2531f04c Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 10 May 2022 04:12:55 +0000 Subject: [PATCH 074/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index ab1107ebd..e055ebf99 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐ŸŒ Add Polish translation for `docs/pl/docs/tutorial/index.md`. PR [#4516](https://github.com/tiangolo/fastapi/pull/4516) by [@MKaczkow](https://github.com/MKaczkow). * โœ Fix typo in deployment. PR [#4629](https://github.com/tiangolo/fastapi/pull/4629) by [@raisulislam541](https://github.com/raisulislam541). * ๐ŸŒ Add Portuguese translation for `docs/pt/docs/help-fastapi.md`. PR [#4583](https://github.com/tiangolo/fastapi/pull/4583) by [@mateusjs](https://github.com/mateusjs). * ๐Ÿ“ Add link to german article: REST-API Programmieren mittels Python und dem FastAPI Modul. PR [#4624](https://github.com/tiangolo/fastapi/pull/4624) by [@fschuermeyer](https://github.com/fschuermeyer). From 03cbdd4f745e1c6e235ccf5bb9f86c0cc5786120 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Mon, 9 May 2022 23:18:03 -0500 Subject: [PATCH 075/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index e055ebf99..a64211c95 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,15 +2,26 @@ ## Latest Changes +### Upgrades + +* โฌ† Upgrade Starlette from 0.19.0 to 0.19.1. PR [#4819](https://github.com/tiangolo/fastapi/pull/4819) by [@Kludex](https://github.com/Kludex). + +### Docs + +* ๐Ÿ“ Add link to german article: REST-API Programmieren mittels Python und dem FastAPI Modul. PR [#4624](https://github.com/tiangolo/fastapi/pull/4624) by [@fschuermeyer](https://github.com/fschuermeyer). +* ๐Ÿ“ Add external link: PyCharm Guide to FastAPI. PR [#4512](https://github.com/tiangolo/fastapi/pull/4512) by [@mukulmantosh](https://github.com/mukulmantosh). +* ๐Ÿ“ Add external link to article: Building an API with FastAPI and Supabase and Deploying on Deta. PR [#4440](https://github.com/tiangolo/fastapi/pull/4440) by [@aUnicornDev](https://github.com/aUnicornDev). +* โœ Fix small typo in `docs/en/docs/tutorial/security/first-steps.md`. PR [#4515](https://github.com/tiangolo/fastapi/pull/4515) by [@KikoIlievski](https://github.com/KikoIlievski). + +### Translations + * ๐ŸŒ Add Polish translation for `docs/pl/docs/tutorial/index.md`. PR [#4516](https://github.com/tiangolo/fastapi/pull/4516) by [@MKaczkow](https://github.com/MKaczkow). * โœ Fix typo in deployment. PR [#4629](https://github.com/tiangolo/fastapi/pull/4629) by [@raisulislam541](https://github.com/raisulislam541). * ๐ŸŒ Add Portuguese translation for `docs/pt/docs/help-fastapi.md`. PR [#4583](https://github.com/tiangolo/fastapi/pull/4583) by [@mateusjs](https://github.com/mateusjs). -* ๐Ÿ“ Add link to german article: REST-API Programmieren mittels Python und dem FastAPI Modul. PR [#4624](https://github.com/tiangolo/fastapi/pull/4624) by [@fschuermeyer](https://github.com/fschuermeyer). + +### Internal + * ๐Ÿ”ง Add notifications in issue for Uzbek translations. PR [#4884](https://github.com/tiangolo/fastapi/pull/4884) by [@tiangolo](https://github.com/tiangolo). -* โœ Fix small typo in `docs/en/docs/tutorial/security/first-steps.md`. PR [#4515](https://github.com/tiangolo/fastapi/pull/4515) by [@KikoIlievski](https://github.com/KikoIlievski). -* ๐Ÿ“ Add external link: PyCharm Guide to FastAPI. PR [#4512](https://github.com/tiangolo/fastapi/pull/4512) by [@mukulmantosh](https://github.com/mukulmantosh). -* ๐Ÿ“ Add external link to article: Building an API with FastAPI and Supabase and Deploying on Deta. PR [#4440](https://github.com/tiangolo/fastapi/pull/4440) by [@aUnicornDev](https://github.com/aUnicornDev). -* โฌ† Upgrade Starlette from 0.19.0 to 0.19.1. PR [#4819](https://github.com/tiangolo/fastapi/pull/4819) by [@Kludex](https://github.com/Kludex). ## 0.77.0 From 2aaac141ddb79d1f9071f8e02d2b2097f3d4589f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Mon, 9 May 2022 23:19:32 -0500 Subject: [PATCH 076/168] =?UTF-8?q?=F0=9F=94=96=20Release=20version=200.77?= =?UTF-8?q?.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 3 +++ fastapi/__init__.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index a64211c95..4d8bacf4c 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,9 @@ ## Latest Changes + +## 0.77.1 + ### Upgrades * โฌ† Upgrade Starlette from 0.19.0 to 0.19.1. PR [#4819](https://github.com/tiangolo/fastapi/pull/4819) by [@Kludex](https://github.com/Kludex). diff --git a/fastapi/__init__.py b/fastapi/__init__.py index c4c04525b..1a4d00162 100644 --- a/fastapi/__init__.py +++ b/fastapi/__init__.py @@ -1,6 +1,6 @@ """FastAPI framework, high performance, easy to learn, fast to code, ready for production""" -__version__ = "0.77.0" +__version__ = "0.77.1" from starlette import status as status From cb5a200a7cd8215c950a37a356cab21e9beb6c3b Mon Sep 17 00:00:00 2001 From: Kinuax Date: Wed, 11 May 2022 19:03:41 +0200 Subject: [PATCH 077/168] =?UTF-8?q?=E2=9C=8F=20Fix=20links=20to=20Pydantic?= =?UTF-8?q?=20docs=20(#4670)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastiรกn Ramรญrez --- docs/de/docs/features.md | 2 +- docs/en/docs/features.md | 2 +- docs/en/docs/tutorial/extra-data-types.md | 2 +- docs/en/docs/tutorial/handling-errors.md | 2 +- docs/en/docs/tutorial/sql-databases.md | 2 +- docs/es/docs/features.md | 2 +- docs/fr/docs/features.md | 2 +- docs/ja/docs/features.md | 2 +- docs/pt/docs/features.md | 2 +- docs/tr/docs/features.md | 2 +- docs/zh/docs/features.md | 2 +- docs/zh/docs/tutorial/extra-data-types.md | 2 +- docs/zh/docs/tutorial/handling-errors.md | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/de/docs/features.md b/docs/de/docs/features.md index a92a2bfeb..767a17073 100644 --- a/docs/de/docs/features.md +++ b/docs/de/docs/features.md @@ -193,7 +193,7 @@ Mit **FastAPI** bekommen Sie alle Funktionen von **Pydantic** (da FastAPI fรผr d * Gutes Zusammenspiel mit Ihrer/Ihrem **IDE/linter/Gehirn**: * Weil Datenstrukturen von Pydantic einfach nur Instanzen ihrer definierten Klassen sind, sollten Autovervollstรคndigung, Linting, mypy und ihre Intuition einwandfrei funktionieren. * **Schnell**: - * In Vergleichen ist Pydantic schneller als jede andere getestete Bibliothek. + * In Vergleichen ist Pydantic schneller als jede andere getestete Bibliothek. * Validierung von **komplexen Strukturen**: * Benutzung von hierachischen Pydantic Schemata, Python `typing`โ€™s `List` und `Dict`, etc. * Validierungen erlauben klare und einfache Datenschemadefinition, รผberprรผft und dokumentiert als JSON Schema. diff --git a/docs/en/docs/features.md b/docs/en/docs/features.md index 36f80783a..e4672d532 100644 --- a/docs/en/docs/features.md +++ b/docs/en/docs/features.md @@ -190,7 +190,7 @@ With **FastAPI** you get all of **Pydantic**'s features (as FastAPI is based on * Plays nicely with your **IDE/linter/brain**: * Because pydantic data structures are just instances of classes you define; auto-completion, linting, mypy and your intuition should all work properly with your validated data. * **Fast**: - * in benchmarks Pydantic is faster than all other tested libraries. + * in benchmarks Pydantic is faster than all other tested libraries. * Validate **complex structures**: * Use of hierarchical Pydantic models, Python `typing`โ€™s `List` and `Dict`, etc. * And validators allow complex data schemas to be clearly and easily defined, checked and documented as JSON Schema. diff --git a/docs/en/docs/tutorial/extra-data-types.md b/docs/en/docs/tutorial/extra-data-types.md index a00bd3212..fb3efd318 100644 --- a/docs/en/docs/tutorial/extra-data-types.md +++ b/docs/en/docs/tutorial/extra-data-types.md @@ -36,7 +36,7 @@ Here are some of the additional data types you can use: * `datetime.timedelta`: * A Python `datetime.timedelta`. * In requests and responses will be represented as a `float` of total seconds. - * Pydantic also allows representing it as a "ISO 8601 time diff encoding", see the docs for more info. + * Pydantic also allows representing it as a "ISO 8601 time diff encoding", see the docs for more info. * `frozenset`: * In requests and responses, treated the same as a `set`: * In requests, a list will be read, eliminating duplicates and converting it to a `set`. diff --git a/docs/en/docs/tutorial/handling-errors.md b/docs/en/docs/tutorial/handling-errors.md index 82e166266..8c30326ce 100644 --- a/docs/en/docs/tutorial/handling-errors.md +++ b/docs/en/docs/tutorial/handling-errors.md @@ -163,7 +163,7 @@ path -> item_id !!! warning These are technical details that you might skip if it's not important for you now. -`RequestValidationError` is a sub-class of Pydantic's `ValidationError`. +`RequestValidationError` is a sub-class of Pydantic's `ValidationError`. **FastAPI** uses it so that, if you use a Pydantic model in `response_model`, and your data has an error, you will see the error in your log. diff --git a/docs/en/docs/tutorial/sql-databases.md b/docs/en/docs/tutorial/sql-databases.md index 60c7fb066..15ad71eb5 100644 --- a/docs/en/docs/tutorial/sql-databases.md +++ b/docs/en/docs/tutorial/sql-databases.md @@ -317,7 +317,7 @@ Not only the IDs of those items, but all the data that we defined in the Pydanti Now, in the Pydantic *models* for reading, `Item` and `User`, add an internal `Config` class. -This `Config` class is used to provide configurations to Pydantic. +This `Config` class is used to provide configurations to Pydantic. In the `Config` class, set the attribute `orm_mode = True`. diff --git a/docs/es/docs/features.md b/docs/es/docs/features.md index 945b2cc94..3c59eb88c 100644 --- a/docs/es/docs/features.md +++ b/docs/es/docs/features.md @@ -191,7 +191,7 @@ Con **FastAPI** obtienes todas las caracterรญsticas de **Pydantic** (dado que Fa * Interactรบa bien con tu **IDE/linter/cerebro**: * Porque las estructuras de datos de Pydantic son solo instances de clases que tu defines, el auto-completado, el linting, mypy y tu intuiciรณn deberรญan funcionar bien con tus datos validados. * **Rรกpido**: - * En benchmarks Pydantic es mรกs rรกpido que todas las otras libraries probadas. + * En benchmarks Pydantic es mรกs rรกpido que todas las otras libraries probadas. * Valida **estructuras complejas**: * Usa modelos jerรกrquicos de modelos de Pydantic, `typing` de Python, `List` y `Dict`, etc. * Los validadores tambiรฉn permiten que se definan fรกcil y claramente schemas complejos de datos. Estos son chequeados y documentados como JSON Schema. diff --git a/docs/fr/docs/features.md b/docs/fr/docs/features.md index 4d8f18403..4b00ecb6f 100644 --- a/docs/fr/docs/features.md +++ b/docs/fr/docs/features.md @@ -190,7 +190,7 @@ Avec **FastAPI** vous aurez toutes les fonctionnalitรฉs de **Pydantic** (comme * Aide votre **IDE/linter/cerveau**: * Parce que les structures de donnรฉes de pydantic consistent seulement en une instance de classe que vous dรฉfinissez; l'auto-complรฉtion, le linting, mypy et votre intuition devrait รชtre largement suffisante pour valider vos donnรฉes. * **Rapide**: - * Dans les benchmarks Pydantic est plus rapide que toutes les autres librairies testรฉes. + * Dans les benchmarks Pydantic est plus rapide que toutes les autres librairies testรฉes. * Valide les **structures complexes**: * Utilise les modรจles hiรฉrarchique de Pydantic, le `typage` Python pour les `Lists`, `Dict`, etc. * Et les validateurs permettent aux schรฉmas de donnรฉes complexes d'รชtre clairement et facilement dรฉfinis, validรฉs et documentรฉs sous forme d'un schรฉma JSON. diff --git a/docs/ja/docs/features.md b/docs/ja/docs/features.md index 2c406f481..5ea68515d 100644 --- a/docs/ja/docs/features.md +++ b/docs/ja/docs/features.md @@ -193,7 +193,7 @@ FastAPIใซใฏ้žๅธธใซไฝฟใ„ใ‚„ใ™ใใ€้žๅธธใซๅผทๅŠ›ใชBenchmarklarda, Pydantic'in diฤŸer bรผtรผn test edilmiลŸ bรผtรผn kรผtรผphanelerden daha hฤฑzlฤฑ. + * Benchmarklarda, Pydantic'in diฤŸer bรผtรผn test edilmiลŸ bรผtรผn kรผtรผphanelerden daha hฤฑzlฤฑ. * **En kompleks** yapฤฑlarฤฑ bile doฤŸrula: * HiyerarลŸik Pydantic modellerinin kullanฤฑmฤฑ ile beraber, Python `typing`โ€™s `List` and `Dict`, vs gibi ลŸeyleri doฤŸrula. * DoฤŸrulayฤฑcฤฑlar en kompleks data ลŸemalarฤฑnฤฑn bile temiz ve kolay bir ลŸekilde tanฤฑmlanmasฤฑna izin veriyor, ve hepsi JSON ลŸemasฤฑ olarak dokรผmante ediliyor diff --git a/docs/zh/docs/features.md b/docs/zh/docs/features.md index 4752947a3..2d5ba2982 100644 --- a/docs/zh/docs/features.md +++ b/docs/zh/docs/features.md @@ -195,7 +195,7 @@ FastAPI ๆœ‰ไธ€ไธชไฝฟ็”จ้žๅธธ็ฎ€ๅ•๏ผŒไฝ†ๆ˜ฏ้žๅธธๅผบๅคง็š„Celery. +If you need to perform heavy background computation and you don't necessarily need it to be run by the same process (for example, you don't need to share memory, variables, etc), you might benefit from using other bigger tools like Celery. They tend to require more complex configurations, a message/job queue manager, like RabbitMQ or Redis, but they allow you to run background tasks in multiple processes, and especially, in multiple servers. diff --git a/docs/en/docs/tutorial/sql-databases.md b/docs/en/docs/tutorial/sql-databases.md index 15ad71eb5..3436543a5 100644 --- a/docs/en/docs/tutorial/sql-databases.md +++ b/docs/en/docs/tutorial/sql-databases.md @@ -616,7 +616,7 @@ And as the code related to SQLAlchemy and the SQLAlchemy models lives in separat The same way, you would be able to use the same SQLAlchemy models and utilities in other parts of your code that are not related to **FastAPI**. -For example, in a background task worker with Celery, RQ, or ARQ. +For example, in a background task worker with Celery, RQ, or ARQ. ## Review all the files diff --git a/docs/fr/docs/tutorial/background-tasks.md b/docs/fr/docs/tutorial/background-tasks.md index 06ef93cd7..bb6afb457 100644 --- a/docs/fr/docs/tutorial/background-tasks.md +++ b/docs/fr/docs/tutorial/background-tasks.md @@ -81,7 +81,7 @@ Plus de dรฉtails sont disponibles dans Celery. +Si vous avez besoin de rรฉaliser des traitements lourds en tรขche d'arriรจre-plan et que vous n'avez pas besoin que ces traitements aient lieu dans le mรชme process (par exemple, pas besoin de partager la mรฉmoire, les variables, etc.), il peut s'avรฉrer profitable d'utiliser des outils plus importants tels que Celery. Ces outils nรฉcessitent gรฉnรฉralement des configurations plus complexes ainsi qu'un gestionnaire de queue de message, comme RabbitMQ ou Redis, mais ils permettent d'exรฉcuter des tรขches d'arriรจre-plan dans diffรฉrents process, et potentiellement, sur plusieurs serveurs. From 643291b9cabaee2008d38fc78d68eee5af42aae3 Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 11 May 2022 17:35:38 +0000 Subject: [PATCH 082/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 1430113e9..4d484843e 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐Ÿ“ Updates links for Celery documentation. PR [#4736](https://github.com/tiangolo/fastapi/pull/4736) by [@sammyzord](https://github.com/sammyzord). * โœ Fix example code with sets in tutorial for body nested models. PR [#3030](https://github.com/tiangolo/fastapi/pull/3030) by [@hitrust](https://github.com/hitrust). * โœ Fix links to Pydantic docs. PR [#4670](https://github.com/tiangolo/fastapi/pull/4670) by [@kinuax](https://github.com/kinuax). From a38b0a7facae1c652a02f3ae65650012e021e16b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B0=B4=E4=B8=8A=20=E7=9A=93=E7=99=BB?= Date: Thu, 12 May 2022 02:42:13 +0900 Subject: [PATCH 083/168] =?UTF-8?q?=F0=9F=8C=90=20Fix=20code=20examples=20?= =?UTF-8?q?in=20Japanese=20translation=20for=20`docs/ja/docs/tutorial/test?= =?UTF-8?q?ing.md`=20(#4623)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastiรกn Ramรญrez --- docs/ja/docs/tutorial/testing.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/docs/ja/docs/tutorial/testing.md b/docs/ja/docs/tutorial/testing.md index ebd2de37c..3db493294 100644 --- a/docs/ja/docs/tutorial/testing.md +++ b/docs/ja/docs/tutorial/testing.md @@ -74,16 +74,24 @@ ใ“ใ‚Œใ‚‰ใฎ *path operation* ใซใฏ `X-Token` ใƒ˜ใƒƒใƒ€ใƒผใŒๅฟ…่ฆใงใ™ใ€‚ -```Python -{!../../../docs_src/app_testing/main_b.py!} -``` +=== "Python 3.6 and above" + + ```Python + {!> ../../../docs_src/app_testing/app_b/main.py!} + ``` + +=== "Python 3.10 and above" + + ```Python + {!> ../../../docs_src/app_testing/app_b_py310/main.py!} + ``` ### ๆ‹กๅผต็‰ˆใƒ†ใ‚นใƒˆใƒ•ใ‚กใ‚คใƒซ ๆฌกใซใ€ๅ…ˆ็จ‹ใฎใ‚‚ใฎใซๆ‹กๅผต็‰ˆใฎใƒ†ใ‚นใƒˆใ‚’ๅŠ ใˆใŸใ€`test_main_b.py` ใ‚’ไฝœๆˆใ—ใพใ™ใ€‚ ```Python -{!../../../docs_src/app_testing/test_main_b.py!} +{!> ../../../docs_src/app_testing/app_b/test_main.py!} ``` ใƒชใ‚ฏใ‚จใ‚นใƒˆใซๆƒ…ๅ ฑใ‚’ๆธกใ›ใ‚‹ใ‚ฏใƒฉใ‚คใ‚ขใƒณใƒˆใŒๅฟ…่ฆใงใ€ใใฎๆ–นๆณ•ใŒใ‚ใ‹ใ‚‰ใชใ„ๅ ดๅˆใฏใ„ใคใงใ‚‚ใ€`requests` ใงใฎๅฎŸ็พๆ–นๆณ•ใ‚’ๆคœ็ดข (Google) ใงใใพใ™ใ€‚ From 062107159f948ec1cbb2d97e5c749f1ba538fcea Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 11 May 2022 17:42:56 +0000 Subject: [PATCH 084/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 4d484843e..583b65acf 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐ŸŒ Fix code examples in Japanese translation for `docs/ja/docs/tutorial/testing.md`. PR [#4623](https://github.com/tiangolo/fastapi/pull/4623) by [@hirotoKirimaru](https://github.com/hirotoKirimaru). * ๐Ÿ“ Updates links for Celery documentation. PR [#4736](https://github.com/tiangolo/fastapi/pull/4736) by [@sammyzord](https://github.com/sammyzord). * โœ Fix example code with sets in tutorial for body nested models. PR [#3030](https://github.com/tiangolo/fastapi/pull/3030) by [@hitrust](https://github.com/hitrust). * โœ Fix links to Pydantic docs. PR [#4670](https://github.com/tiangolo/fastapi/pull/4670) by [@kinuax](https://github.com/kinuax). From e9098abe8cd890a96b0e646847e49ef6ee26a192 Mon Sep 17 00:00:00 2001 From: jbrocher Date: Wed, 11 May 2022 19:48:25 +0200 Subject: [PATCH 085/168] =?UTF-8?q?=F0=9F=93=9D=20Add=20link=20to=20extern?= =?UTF-8?q?al=20article:=20Building=20the=20Poll=20App=20From=20Django=20T?= =?UTF-8?q?utorial=20With=20FastAPI=20And=20React=20(#4778)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastiรกn Ramรญrez --- docs/en/data/external_links.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/en/data/external_links.yml b/docs/en/data/external_links.yml index b918c8fd3..f73ce4a6c 100644 --- a/docs/en/data/external_links.yml +++ b/docs/en/data/external_links.yml @@ -1,5 +1,9 @@ articles: english: + - author: Jean-Baptiste Rocher + author_link: https://hashnode.com/@jibrocher + link: https://dev.indooroutdoor.io/series/fastapi-react-poll-app + title: Building the Poll App From Django Tutorial With FastAPI And React - author: Silvan Melchior author_link: https://github.com/silvanmelchior link: https://blog.devgenius.io/seamless-fastapi-configuration-with-confz-90949c14ea12 From ff2daa0471c7a6360fdedddd409c745fc8538d56 Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 11 May 2022 17:49:06 +0000 Subject: [PATCH 086/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 583b65acf..105b4b6a0 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐Ÿ“ Add link to external article: Building the Poll App From Django Tutorial With FastAPI And React. PR [#4778](https://github.com/tiangolo/fastapi/pull/4778) by [@jbrocher](https://github.com/jbrocher). * ๐ŸŒ Fix code examples in Japanese translation for `docs/ja/docs/tutorial/testing.md`. PR [#4623](https://github.com/tiangolo/fastapi/pull/4623) by [@hirotoKirimaru](https://github.com/hirotoKirimaru). * ๐Ÿ“ Updates links for Celery documentation. PR [#4736](https://github.com/tiangolo/fastapi/pull/4736) by [@sammyzord](https://github.com/sammyzord). * โœ Fix example code with sets in tutorial for body nested models. PR [#3030](https://github.com/tiangolo/fastapi/pull/3030) by [@hitrust](https://github.com/hitrust). From 35445828c85013c21d4da2370f65e430cbcb0c41 Mon Sep 17 00:00:00 2001 From: Lorenzo Castellino Date: Wed, 11 May 2022 20:49:16 +0200 Subject: [PATCH 087/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20docs=20about=20?= =?UTF-8?q?Swagger=20UI=20self-hosting=20with=20newer=20source=20links=20(?= =?UTF-8?q?#4813)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastiรกn Ramรญrez --- docs/en/docs/advanced/extending-openapi.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/docs/advanced/extending-openapi.md b/docs/en/docs/advanced/extending-openapi.md index d1b14bc00..36619696b 100644 --- a/docs/en/docs/advanced/extending-openapi.md +++ b/docs/en/docs/advanced/extending-openapi.md @@ -132,8 +132,8 @@ You can probably right-click each link and select an option similar to `Save lin **Swagger UI** uses the files: -* `swagger-ui-bundle.js` -* `swagger-ui.css` +* `swagger-ui-bundle.js` +* `swagger-ui.css` And **ReDoc** uses the file: From 0f7de452dd3b4040197259c27dd3bc8003884c9d Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 11 May 2022 18:49:56 +0000 Subject: [PATCH 088/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 105b4b6a0..ec3b2807d 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐Ÿ“ Update docs about Swagger UI self-hosting with newer source links. PR [#4813](https://github.com/tiangolo/fastapi/pull/4813) by [@Kastakin](https://github.com/Kastakin). * ๐Ÿ“ Add link to external article: Building the Poll App From Django Tutorial With FastAPI And React. PR [#4778](https://github.com/tiangolo/fastapi/pull/4778) by [@jbrocher](https://github.com/jbrocher). * ๐ŸŒ Fix code examples in Japanese translation for `docs/ja/docs/tutorial/testing.md`. PR [#4623](https://github.com/tiangolo/fastapi/pull/4623) by [@hirotoKirimaru](https://github.com/hirotoKirimaru). * ๐Ÿ“ Updates links for Celery documentation. PR [#4736](https://github.com/tiangolo/fastapi/pull/4736) by [@sammyzord](https://github.com/sammyzord). From 15dd12629ea4feee52f0ba35e5cc9f9eab8c7d6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rio=20Victor=20Ribeiro=20Silva?= Date: Wed, 11 May 2022 15:53:57 -0300 Subject: [PATCH 089/168] =?UTF-8?q?=F0=9F=93=9D=20Add=20dark=20mode=20auto?= =?UTF-8?q?=20switch=20to=20docs=20based=20on=20OS=20preference=20(#4869)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/az/mkdocs.yml | 6 ++++-- docs/de/mkdocs.yml | 6 ++++-- docs/en/mkdocs.yml | 6 ++++-- docs/es/mkdocs.yml | 6 ++++-- docs/fa/mkdocs.yml | 6 ++++-- docs/fr/mkdocs.yml | 6 ++++-- docs/id/mkdocs.yml | 6 ++++-- docs/it/mkdocs.yml | 6 ++++-- docs/ja/mkdocs.yml | 6 ++++-- docs/ko/mkdocs.yml | 6 ++++-- docs/nl/mkdocs.yml | 6 ++++-- docs/pl/mkdocs.yml | 6 ++++-- docs/pt/mkdocs.yml | 6 ++++-- docs/ru/mkdocs.yml | 6 ++++-- docs/sq/mkdocs.yml | 6 ++++-- docs/tr/mkdocs.yml | 6 ++++-- docs/uk/mkdocs.yml | 6 ++++-- docs/zh/mkdocs.yml | 6 ++++-- 18 files changed, 72 insertions(+), 36 deletions(-) diff --git a/docs/az/mkdocs.yml b/docs/az/mkdocs.yml index 58bbb0758..60bd8eaad 100644 --- a/docs/az/mkdocs.yml +++ b/docs/az/mkdocs.yml @@ -5,13 +5,15 @@ theme: name: material custom_dir: overrides palette: - - scheme: default + - media: "(prefers-color-scheme: light)" + scheme: default primary: teal accent: amber toggle: icon: material/lightbulb name: Switch to light mode - - scheme: slate + - media: "(prefers-color-scheme: dark)" + scheme: slate primary: teal accent: amber toggle: diff --git a/docs/de/mkdocs.yml b/docs/de/mkdocs.yml index 1242af504..c72f325f6 100644 --- a/docs/de/mkdocs.yml +++ b/docs/de/mkdocs.yml @@ -5,13 +5,15 @@ theme: name: material custom_dir: overrides palette: - - scheme: default + - media: "(prefers-color-scheme: light)" + scheme: default primary: teal accent: amber toggle: icon: material/lightbulb name: Switch to light mode - - scheme: slate + - media: "(prefers-color-scheme: dark)" + scheme: slate primary: teal accent: amber toggle: diff --git a/docs/en/mkdocs.yml b/docs/en/mkdocs.yml index e7aa40def..322de0f2f 100644 --- a/docs/en/mkdocs.yml +++ b/docs/en/mkdocs.yml @@ -5,13 +5,15 @@ theme: name: material custom_dir: overrides palette: - - scheme: default + - media: "(prefers-color-scheme: light)" + scheme: default primary: teal accent: amber toggle: icon: material/lightbulb name: Switch to light mode - - scheme: slate + - media: "(prefers-color-scheme: dark)" + scheme: slate primary: teal accent: amber toggle: diff --git a/docs/es/mkdocs.yml b/docs/es/mkdocs.yml index eb7538cf4..b544f9b38 100644 --- a/docs/es/mkdocs.yml +++ b/docs/es/mkdocs.yml @@ -5,13 +5,15 @@ theme: name: material custom_dir: overrides palette: - - scheme: default + - media: "(prefers-color-scheme: light)" + scheme: default primary: teal accent: amber toggle: icon: material/lightbulb name: Switch to light mode - - scheme: slate + - media: "(prefers-color-scheme: dark)" + scheme: slate primary: teal accent: amber toggle: diff --git a/docs/fa/mkdocs.yml b/docs/fa/mkdocs.yml index 6fb3891b7..3966a6026 100644 --- a/docs/fa/mkdocs.yml +++ b/docs/fa/mkdocs.yml @@ -5,13 +5,15 @@ theme: name: material custom_dir: overrides palette: - - scheme: default + - media: "(prefers-color-scheme: light)" + scheme: default primary: teal accent: amber toggle: icon: material/lightbulb name: Switch to light mode - - scheme: slate + - media: "(prefers-color-scheme: dark)" + scheme: slate primary: teal accent: amber toggle: diff --git a/docs/fr/mkdocs.yml b/docs/fr/mkdocs.yml index d2681f8d5..bf0d2b21c 100644 --- a/docs/fr/mkdocs.yml +++ b/docs/fr/mkdocs.yml @@ -5,13 +5,15 @@ theme: name: material custom_dir: overrides palette: - - scheme: default + - media: "(prefers-color-scheme: light)" + scheme: default primary: teal accent: amber toggle: icon: material/lightbulb name: Switch to light mode - - scheme: slate + - media: "(prefers-color-scheme: dark)" + scheme: slate primary: teal accent: amber toggle: diff --git a/docs/id/mkdocs.yml b/docs/id/mkdocs.yml index 0c60fecd9..769547d11 100644 --- a/docs/id/mkdocs.yml +++ b/docs/id/mkdocs.yml @@ -5,13 +5,15 @@ theme: name: material custom_dir: overrides palette: - - scheme: default + - media: "(prefers-color-scheme: light)" + scheme: default primary: teal accent: amber toggle: icon: material/lightbulb name: Switch to light mode - - scheme: slate + - media: "(prefers-color-scheme: dark)" + scheme: slate primary: teal accent: amber toggle: diff --git a/docs/it/mkdocs.yml b/docs/it/mkdocs.yml index 3bf3d7396..ebec9a642 100644 --- a/docs/it/mkdocs.yml +++ b/docs/it/mkdocs.yml @@ -5,13 +5,15 @@ theme: name: material custom_dir: overrides palette: - - scheme: default + - media: "(prefers-color-scheme: light)" + scheme: default primary: teal accent: amber toggle: icon: material/lightbulb name: Switch to light mode - - scheme: slate + - media: "(prefers-color-scheme: dark)" + scheme: slate primary: teal accent: amber toggle: diff --git a/docs/ja/mkdocs.yml b/docs/ja/mkdocs.yml index f9f91879b..055404fea 100644 --- a/docs/ja/mkdocs.yml +++ b/docs/ja/mkdocs.yml @@ -5,13 +5,15 @@ theme: name: material custom_dir: overrides palette: - - scheme: default + - media: "(prefers-color-scheme: light)" + scheme: default primary: teal accent: amber toggle: icon: material/lightbulb name: Switch to light mode - - scheme: slate + - media: "(prefers-color-scheme: dark)" + scheme: slate primary: teal accent: amber toggle: diff --git a/docs/ko/mkdocs.yml b/docs/ko/mkdocs.yml index 1e7d60dbd..60cf7d30a 100644 --- a/docs/ko/mkdocs.yml +++ b/docs/ko/mkdocs.yml @@ -5,13 +5,15 @@ theme: name: material custom_dir: overrides palette: - - scheme: default + - media: "(prefers-color-scheme: light)" + scheme: default primary: teal accent: amber toggle: icon: material/lightbulb name: Switch to light mode - - scheme: slate + - media: "(prefers-color-scheme: dark)" + scheme: slate primary: teal accent: amber toggle: diff --git a/docs/nl/mkdocs.yml b/docs/nl/mkdocs.yml index c853216f5..9cd1e0401 100644 --- a/docs/nl/mkdocs.yml +++ b/docs/nl/mkdocs.yml @@ -5,13 +5,15 @@ theme: name: material custom_dir: overrides palette: - - scheme: default + - media: "(prefers-color-scheme: light)" + scheme: default primary: teal accent: amber toggle: icon: material/lightbulb name: Switch to light mode - - scheme: slate + - media: "(prefers-color-scheme: dark)" + scheme: slate primary: teal accent: amber toggle: diff --git a/docs/pl/mkdocs.yml b/docs/pl/mkdocs.yml index 932a43da4..0c3d100e7 100644 --- a/docs/pl/mkdocs.yml +++ b/docs/pl/mkdocs.yml @@ -5,13 +5,15 @@ theme: name: material custom_dir: overrides palette: - - scheme: default + - media: "(prefers-color-scheme: light)" + scheme: default primary: teal accent: amber toggle: icon: material/lightbulb name: Switch to light mode - - scheme: slate + - media: "(prefers-color-scheme: dark)" + scheme: slate primary: teal accent: amber toggle: diff --git a/docs/pt/mkdocs.yml b/docs/pt/mkdocs.yml index 253400800..2bb0b568d 100644 --- a/docs/pt/mkdocs.yml +++ b/docs/pt/mkdocs.yml @@ -5,13 +5,15 @@ theme: name: material custom_dir: overrides palette: - - scheme: default + - media: "(prefers-color-scheme: light)" + scheme: default primary: teal accent: amber toggle: icon: material/lightbulb name: Switch to light mode - - scheme: slate + - media: "(prefers-color-scheme: dark)" + scheme: slate primary: teal accent: amber toggle: diff --git a/docs/ru/mkdocs.yml b/docs/ru/mkdocs.yml index 0f8f00411..bb0702489 100644 --- a/docs/ru/mkdocs.yml +++ b/docs/ru/mkdocs.yml @@ -5,13 +5,15 @@ theme: name: material custom_dir: overrides palette: - - scheme: default + - media: "(prefers-color-scheme: light)" + scheme: default primary: teal accent: amber toggle: icon: material/lightbulb name: Switch to light mode - - scheme: slate + - media: "(prefers-color-scheme: dark)" + scheme: slate primary: teal accent: amber toggle: diff --git a/docs/sq/mkdocs.yml b/docs/sq/mkdocs.yml index a61f49bc9..8914395fe 100644 --- a/docs/sq/mkdocs.yml +++ b/docs/sq/mkdocs.yml @@ -5,13 +5,15 @@ theme: name: material custom_dir: overrides palette: - - scheme: default + - media: "(prefers-color-scheme: light)" + scheme: default primary: teal accent: amber toggle: icon: material/lightbulb name: Switch to light mode - - scheme: slate + - media: "(prefers-color-scheme: dark)" + scheme: slate primary: teal accent: amber toggle: diff --git a/docs/tr/mkdocs.yml b/docs/tr/mkdocs.yml index dd52d7fcc..74186033c 100644 --- a/docs/tr/mkdocs.yml +++ b/docs/tr/mkdocs.yml @@ -5,13 +5,15 @@ theme: name: material custom_dir: overrides palette: - - scheme: default + - media: "(prefers-color-scheme: light)" + scheme: default primary: teal accent: amber toggle: icon: material/lightbulb name: Switch to light mode - - scheme: slate + - media: "(prefers-color-scheme: dark)" + scheme: slate primary: teal accent: amber toggle: diff --git a/docs/uk/mkdocs.yml b/docs/uk/mkdocs.yml index 971a182db..ddf299d8b 100644 --- a/docs/uk/mkdocs.yml +++ b/docs/uk/mkdocs.yml @@ -5,13 +5,15 @@ theme: name: material custom_dir: overrides palette: - - scheme: default + - media: "(prefers-color-scheme: light)" + scheme: default primary: teal accent: amber toggle: icon: material/lightbulb name: Switch to light mode - - scheme: slate + - media: "(prefers-color-scheme: dark)" + scheme: slate primary: teal accent: amber toggle: diff --git a/docs/zh/mkdocs.yml b/docs/zh/mkdocs.yml index 408166489..a72ecb657 100644 --- a/docs/zh/mkdocs.yml +++ b/docs/zh/mkdocs.yml @@ -5,13 +5,15 @@ theme: name: material custom_dir: overrides palette: - - scheme: default + - media: "(prefers-color-scheme: light)" + scheme: default primary: teal accent: amber toggle: icon: material/lightbulb name: Switch to light mode - - scheme: slate + - media: "(prefers-color-scheme: dark)" + scheme: slate primary: teal accent: amber toggle: From 1bbbdb4b7fe86196b9c4f1d4f69c77818e7bfe95 Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 11 May 2022 18:54:33 +0000 Subject: [PATCH 090/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index ec3b2807d..6b7d793a0 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐Ÿ“ Add dark mode auto switch to docs based on OS preference. PR [#4869](https://github.com/tiangolo/fastapi/pull/4869) by [@ComicShrimp](https://github.com/ComicShrimp). * ๐Ÿ“ Update docs about Swagger UI self-hosting with newer source links. PR [#4813](https://github.com/tiangolo/fastapi/pull/4813) by [@Kastakin](https://github.com/Kastakin). * ๐Ÿ“ Add link to external article: Building the Poll App From Django Tutorial With FastAPI And React. PR [#4778](https://github.com/tiangolo/fastapi/pull/4778) by [@jbrocher](https://github.com/jbrocher). * ๐ŸŒ Fix code examples in Japanese translation for `docs/ja/docs/tutorial/testing.md`. PR [#4623](https://github.com/tiangolo/fastapi/pull/4623) by [@hirotoKirimaru](https://github.com/hirotoKirimaru). From 4fcdb31947f23c1bf9aa661dfd86079ea0a433b9 Mon Sep 17 00:00:00 2001 From: Matthew Evans <7916000+ml-evs@users.noreply.github.com> Date: Wed, 11 May 2022 22:43:47 +0100 Subject: [PATCH 091/168] =?UTF-8?q?=F0=9F=93=9D=20Add=20OpenAPI=20warning?= =?UTF-8?q?=20to=20"Body=20-=20Fields"=20docs=20with=20extra=20schema=20ex?= =?UTF-8?q?tensions=20(#4846)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastiรกn Ramรญrez --- docs/en/docs/tutorial/body-fields.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/en/docs/tutorial/body-fields.md b/docs/en/docs/tutorial/body-fields.md index 1f38a0c5c..0cfe576d6 100644 --- a/docs/en/docs/tutorial/body-fields.md +++ b/docs/en/docs/tutorial/body-fields.md @@ -57,6 +57,10 @@ You can declare extra information in `Field`, `Query`, `Body`, etc. And it will You will learn more about adding extra information later in the docs, when learning to declare examples. +!!! warning + Extra keys passed to `Field` will also be present in the resulting OpenAPI schema for your application. + As these keys may not necessarily be part of the OpenAPI specification, some OpenAPI tools, for example [the OpenAPI validator](https://validator.swagger.io/), may not work with your generated schema. + ## Recap You can use Pydantic's `Field` to declare extra validations and metadata for model attributes. From f3b04a611880991271173f3694555176f27b4916 Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 11 May 2022 21:44:52 +0000 Subject: [PATCH 092/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 6b7d793a0..be0048337 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐Ÿ“ Add OpenAPI warning to "Body - Fields" docs with extra schema extensions. PR [#4846](https://github.com/tiangolo/fastapi/pull/4846) by [@ml-evs](https://github.com/ml-evs). * ๐Ÿ“ Add dark mode auto switch to docs based on OS preference. PR [#4869](https://github.com/tiangolo/fastapi/pull/4869) by [@ComicShrimp](https://github.com/ComicShrimp). * ๐Ÿ“ Update docs about Swagger UI self-hosting with newer source links. PR [#4813](https://github.com/tiangolo/fastapi/pull/4813) by [@Kastakin](https://github.com/Kastakin). * ๐Ÿ“ Add link to external article: Building the Poll App From Django Tutorial With FastAPI And React. PR [#4778](https://github.com/tiangolo/fastapi/pull/4778) by [@jbrocher](https://github.com/jbrocher). From 8c593a9cc9e1aa8387a3e004b0e3dc789ab926e9 Mon Sep 17 00:00:00 2001 From: Maxim Martynov Date: Thu, 12 May 2022 01:31:52 +0300 Subject: [PATCH 093/168] =?UTF-8?q?=F0=9F=91=B7=20Disable=20CI=20installin?= =?UTF-8?q?g=20Material=20for=20MkDocs=20in=20forks=20(#4410)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastiรกn Ramรญrez --- .github/workflows/build-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 2482660f3..bdef6ea8a 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -30,7 +30,7 @@ jobs: if: steps.cache.outputs.cache-hit != 'true' run: python3.7 -m flit install --deps production --extras doc - name: Install Material for MkDocs Insiders - if: github.event.pull_request.head.repo.fork == false && steps.cache.outputs.cache-hit != 'true' + if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false && steps.cache.outputs.cache-hit != 'true' run: pip install git+https://${{ secrets.ACTIONS_TOKEN }}@github.com/squidfunk/mkdocs-material-insiders.git - name: Build Docs run: python3.7 ./scripts/docs.py build-all From 9cbd42b13e5686b4bd298af1431b07b75bc477c8 Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 11 May 2022 22:32:26 +0000 Subject: [PATCH 094/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index be0048337..13348a423 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐Ÿ‘ท Disable CI installing Material for MkDocs in forks. PR [#4410](https://github.com/tiangolo/fastapi/pull/4410) by [@dolfinus](https://github.com/dolfinus). * ๐Ÿ“ Add OpenAPI warning to "Body - Fields" docs with extra schema extensions. PR [#4846](https://github.com/tiangolo/fastapi/pull/4846) by [@ml-evs](https://github.com/ml-evs). * ๐Ÿ“ Add dark mode auto switch to docs based on OS preference. PR [#4869](https://github.com/tiangolo/fastapi/pull/4869) by [@ComicShrimp](https://github.com/ComicShrimp). * ๐Ÿ“ Update docs about Swagger UI self-hosting with newer source links. PR [#4813](https://github.com/tiangolo/fastapi/pull/4813) by [@Kastakin](https://github.com/Kastakin). From 3d0f130ff355f3a57a929eadd68f0cc3ab96b2f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Wed, 11 May 2022 19:06:16 -0500 Subject: [PATCH 095/168] =?UTF-8?q?=F0=9F=94=A7=20Add=20pre-commit=20with?= =?UTF-8?q?=20first=20config=20and=20first=20formatting=20pass=20(#4888)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ๐Ÿ”ง Add first pre-commit config * ๐ŸŽจ Format YAML files with pre-commit * ๐ŸŽจ Format Markdown with pre-commit * ๐ŸŽจ Format SVGs, drawio, JS, HTML with pre-commit * โž• Add pre-commit to dev dependencies * โฌ‡๏ธ Extend pre-commit range to support Python 3.6 --- .github/ISSUE_TEMPLATE/feature-request.yml | 8 ++++---- .github/ISSUE_TEMPLATE/question.yml | 8 ++++---- .github/workflows/latest-changes.yml | 2 +- .github/workflows/people.yml | 2 +- .github/workflows/preview-docs.yml | 2 +- .pre-commit-config.yaml | 14 +++++++++++++ docs/de/docs/features.md | 2 +- docs/de/docs/index.md | 4 ++-- docs/en/data/external_links.yml | 4 ++-- docs/en/docs/advanced/additional-responses.md | 2 +- .../docs/advanced/additional-status-codes.md | 2 +- .../docs/advanced/security/oauth2-scopes.md | 8 ++++---- docs/en/docs/advanced/sql-databases-peewee.md | 2 +- docs/en/docs/alternatives.md | 6 +++--- docs/en/docs/deployment/docker.md | 2 +- docs/en/docs/deployment/manually.md | 4 ++-- .../deployment/concepts/process-ram.drawio | 2 +- .../img/deployment/concepts/process-ram.svg | 2 +- .../en/docs/img/deployment/https/https.drawio | 2 +- docs/en/docs/img/deployment/https/https.svg | 2 +- .../docs/img/deployment/https/https01.drawio | 2 +- docs/en/docs/img/deployment/https/https01.svg | 2 +- .../docs/img/deployment/https/https02.drawio | 2 +- docs/en/docs/img/deployment/https/https02.svg | 2 +- .../docs/img/deployment/https/https03.drawio | 2 +- docs/en/docs/img/deployment/https/https03.svg | 2 +- .../docs/img/deployment/https/https04.drawio | 2 +- docs/en/docs/img/deployment/https/https04.svg | 2 +- .../docs/img/deployment/https/https05.drawio | 2 +- docs/en/docs/img/deployment/https/https05.svg | 2 +- .../docs/img/deployment/https/https06.drawio | 2 +- docs/en/docs/img/deployment/https/https06.svg | 2 +- .../docs/img/deployment/https/https07.drawio | 2 +- docs/en/docs/img/deployment/https/https07.svg | 2 +- .../docs/img/deployment/https/https08.drawio | 2 +- docs/en/docs/img/deployment/https/https08.svg | 2 +- .../bigger-applications/package.drawio | 2 +- .../tutorial/bigger-applications/package.svg | 2 +- docs/en/docs/js/termynal.js | 14 ++++++------- docs/en/docs/python-types.md | 8 ++++---- docs/en/docs/tutorial/bigger-applications.md | 2 +- docs/en/docs/tutorial/body-nested-models.md | 2 +- docs/en/docs/tutorial/body.md | 2 +- .../dependencies/dependencies-with-yield.md | 4 ++-- docs/en/docs/tutorial/request-files.md | 2 +- docs/en/docs/tutorial/request-forms.md | 2 +- docs/en/overrides/main.html | 4 ++-- docs/es/docs/tutorial/first-steps.md | 2 +- docs/fr/docs/alternatives.md | 6 +++--- docs/fr/docs/async.md | 6 +++--- docs/fr/docs/deployment/docker.md | 8 ++++---- docs/fr/docs/features.md | 2 +- docs/fr/docs/index.md | 6 +++--- docs/fr/docs/tutorial/background-tasks.md | 4 ++-- docs/fr/docs/tutorial/body.md | 2 +- docs/fr/docs/tutorial/first-steps.md | 2 +- docs/fr/docs/tutorial/path-params.md | 8 ++++---- docs/fr/docs/tutorial/query-params.md | 4 ++-- docs/id/docs/index.md | 4 ++-- docs/it/docs/index.md | 4 ++-- docs/ja/docs/alternatives.md | 4 ++-- docs/ja/docs/async.md | 2 +- docs/ja/docs/deployment/index.md | 2 +- docs/ja/docs/deployment/manually.md | 2 +- docs/ja/docs/history-design-future.md | 2 +- docs/ja/docs/tutorial/body.md | 4 ++-- docs/ja/docs/tutorial/middleware.md | 2 +- docs/ja/docs/tutorial/path-params.md | 2 +- docs/ja/docs/tutorial/query-params.md | 6 +++--- docs/ja/docs/tutorial/request-forms.md | 2 +- docs/ja/docs/tutorial/testing.md | 4 ++-- docs/ko/docs/deployment/versions.md | 6 +++--- docs/ko/docs/tutorial/header-params.md | 2 +- docs/ko/docs/tutorial/path-params.md | 2 +- docs/ko/docs/tutorial/request-files.md | 10 +++++----- .../docs/tutorial/request-forms-and-files.md | 4 ++-- docs/ko/docs/tutorial/response-status-code.md | 10 +++++----- docs/pl/docs/tutorial/index.md | 1 - docs/pt/docs/alternatives.md | 4 ++-- docs/pt/docs/async.md | 8 ++++---- docs/pt/docs/benchmarks.md | 2 +- docs/pt/docs/help-fastapi.md | 2 +- docs/pt/docs/index.md | 2 +- docs/pt/docs/python-types.md | 1 - docs/pt/docs/tutorial/body.md | 2 +- docs/ru/docs/async.md | 4 ++-- docs/ru/docs/index.md | 4 ++-- docs/ru/docs/python-types.md | 2 +- docs/sq/docs/index.md | 4 ++-- docs/tr/docs/features.md | 7 +++---- docs/tr/docs/index.md | 14 ++++++------- docs/tr/docs/python-types.md | 2 +- docs/uk/docs/index.md | 4 ++-- .../docs/advanced/additional-status-codes.md | 2 +- docs/zh/docs/advanced/custom-response.md | 2 +- docs/zh/docs/advanced/response-directly.md | 3 +-- docs/zh/docs/benchmarks.md | 2 +- docs/zh/docs/contributing.md | 2 +- docs/zh/docs/features.md | 2 +- docs/zh/docs/help-fastapi.md | 5 ++--- docs/zh/docs/tutorial/bigger-applications.md | 4 ++-- docs/zh/docs/tutorial/body-nested-models.md | 2 +- docs/zh/docs/tutorial/body-updates.md | 10 +++++----- ...pendencies-in-path-operation-decorators.md | 6 +++--- .../dependencies/global-dependencies.md | 1 - docs/zh/docs/tutorial/dependencies/index.md | 4 ++-- .../tutorial/dependencies/sub-dependencies.md | 8 ++++---- docs/zh/docs/tutorial/extra-data-types.md | 2 +- docs/zh/docs/tutorial/first-steps.md | 2 +- docs/zh/docs/tutorial/handling-errors.md | 2 +- .../tutorial/path-operation-configuration.md | 4 ++-- .../path-params-numeric-validations.md | 2 +- docs/zh/docs/tutorial/request-files.md | 20 +++++++++---------- .../docs/tutorial/request-forms-and-files.md | 5 ++--- docs/zh/docs/tutorial/request-forms.md | 10 +++++----- docs/zh/docs/tutorial/schema-extra-example.md | 2 +- docs/zh/docs/tutorial/security/index.md | 2 +- docs/zh/docs/tutorial/security/oauth2-jwt.md | 1 - pyproject.toml | 1 + 119 files changed, 228 insertions(+), 221 deletions(-) create mode 100644 .pre-commit-config.yaml diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml index 8176602a7..322b6536a 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.yml +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -8,9 +8,9 @@ body: Thanks for your interest in FastAPI! ๐Ÿš€ Please follow these instructions, fill every question, and do every step. ๐Ÿ™ - + I'm asking this because answering questions and solving problems in GitHub issues is what consumes most of the time. - + I end up not being able to add new features, fix bugs, review pull requests, etc. as fast as I wish because I have to spend too much time handling issues. All that, on top of all the incredible help provided by a bunch of community members, the [FastAPI Experts](https://fastapi.tiangolo.com/fastapi-people/#experts), that give a lot of their time to come here and help others. @@ -18,7 +18,7 @@ body: That's a lot of work they are doing, but if more FastAPI users came to help others like them just a little bit more, it would be much less effort for them (and you and me ๐Ÿ˜…). By asking questions in a structured way (following this) it will be much easier to help you. - + And there's a high chance that you will find the solution along the way and you won't even have to submit it and wait for an answer. ๐Ÿ˜Ž As there are too many issues with questions, I'll have to close the incomplete ones. That will allow me (and others) to focus on helping people like you that follow the whole process and help us help you. ๐Ÿค“ @@ -50,7 +50,7 @@ body: label: Commit to Help description: | After submitting this, I commit to one of: - + * Read open issues with questions until I find 2 issues where I can help someone and add a comment to help there. * I already hit the "watch" button in this repository to receive notifications and I commit to help at least 2 people that ask questions in the future. * Implement a Pull Request for a confirmed bug. diff --git a/.github/ISSUE_TEMPLATE/question.yml b/.github/ISSUE_TEMPLATE/question.yml index 5c76fd17e..3b16b4ad0 100644 --- a/.github/ISSUE_TEMPLATE/question.yml +++ b/.github/ISSUE_TEMPLATE/question.yml @@ -8,9 +8,9 @@ body: Thanks for your interest in FastAPI! ๐Ÿš€ Please follow these instructions, fill every question, and do every step. ๐Ÿ™ - + I'm asking this because answering questions and solving problems in GitHub issues is what consumes most of the time. - + I end up not being able to add new features, fix bugs, review pull requests, etc. as fast as I wish because I have to spend too much time handling issues. All that, on top of all the incredible help provided by a bunch of community members, the [FastAPI Experts](https://fastapi.tiangolo.com/fastapi-people/#experts), that give a lot of their time to come here and help others. @@ -18,7 +18,7 @@ body: That's a lot of work they are doing, but if more FastAPI users came to help others like them just a little bit more, it would be much less effort for them (and you and me ๐Ÿ˜…). By asking questions in a structured way (following this) it will be much easier to help you. - + And there's a high chance that you will find the solution along the way and you won't even have to submit it and wait for an answer. ๐Ÿ˜Ž As there are too many issues with questions, I'll have to close the incomplete ones. That will allow me (and others) to focus on helping people like you that follow the whole process and help us help you. ๐Ÿค“ @@ -50,7 +50,7 @@ body: label: Commit to Help description: | After submitting this, I commit to one of: - + * Read open issues with questions until I find 2 issues where I can help someone and add a comment to help there. * I already hit the "watch" button in this repository to receive notifications and I commit to help at least 2 people that ask questions in the future. * Implement a Pull Request for a confirmed bug. diff --git a/.github/workflows/latest-changes.yml b/.github/workflows/latest-changes.yml index 42236beba..5783c993a 100644 --- a/.github/workflows/latest-changes.yml +++ b/.github/workflows/latest-changes.yml @@ -12,7 +12,7 @@ on: description: PR number required: true debug_enabled: - description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)' + description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)' required: false default: false diff --git a/.github/workflows/people.yml b/.github/workflows/people.yml index 970813da7..2004ee7b3 100644 --- a/.github/workflows/people.yml +++ b/.github/workflows/people.yml @@ -6,7 +6,7 @@ on: workflow_dispatch: inputs: debug_enabled: - description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)' + description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)' required: false default: false diff --git a/.github/workflows/preview-docs.yml b/.github/workflows/preview-docs.yml index 0c0d2ac59..104c2677f 100644 --- a/.github/workflows/preview-docs.yml +++ b/.github/workflows/preview-docs.yml @@ -3,7 +3,7 @@ on: workflow_run: workflows: - Build Docs - types: + types: - completed jobs: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..2d9dce2d8 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,14 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.2.0 + hooks: + - id: check-added-large-files + - id: check-toml + - id: check-yaml + args: + - --unsafe + - id: end-of-file-fixer + - id: trailing-whitespace + diff --git a/docs/de/docs/features.md b/docs/de/docs/features.md index 767a17073..d99ade402 100644 --- a/docs/de/docs/features.md +++ b/docs/de/docs/features.md @@ -27,7 +27,7 @@ Mit einer interaktiven API-Dokumentation und explorativen webbasierten Benutzers Alles basiert auf **Python 3.6 Typ**-Deklarationen (dank Pydantic). Es muss keine neue Syntax gelernt werden, nur standardisiertes modernes Python. - + Wenn Sie eine kurze, zweiminรผtige, Auffrischung in der Benutzung von Python Typ-Deklarationen benรถtigen (auch wenn Sie FastAPI nicht nutzen), schauen Sie sich diese kurze Einfรผhrung an (Englisch): Python Types{.internal-link target=_blank}. diff --git a/docs/de/docs/index.md b/docs/de/docs/index.md index cdce66223..ce13bcc4a 100644 --- a/docs/de/docs/index.md +++ b/docs/de/docs/index.md @@ -321,7 +321,7 @@ And now, go to Falcon @@ -333,7 +333,7 @@ Now APIStar is a set of tools to validate OpenAPI specifications, not a web fram Exist. The idea of declaring multiple things (data validation, serialization and documentation) with the same Python types, that at the same time provided great editor support, was something I considered a brilliant idea. - + And after searching for a long time for a similar framework and testing many different alternatives, APIStar was the best option available. Then APIStar stopped to exist as a server and Starlette was created, and was a new better foundation for such a system. That was the final inspiration to build **FastAPI**. @@ -391,7 +391,7 @@ That's one of the main things that **FastAPI** adds on top, all based on Python Handle all the core web parts. Adding features on top. The class `FastAPI` itself inherits directly from the class `Starlette`. - + So, anything that you can do with Starlette, you can do it directly with **FastAPI**, as it is basically Starlette on steroids. ### Uvicorn diff --git a/docs/en/docs/deployment/docker.md b/docs/en/docs/deployment/docker.md index 3f86efcce..651b0e840 100644 --- a/docs/en/docs/deployment/docker.md +++ b/docs/en/docs/deployment/docker.md @@ -350,7 +350,7 @@ If your FastAPI is a single file, for example, `main.py` without an `./app` dire Then you would just have to change the corresponding paths to copy the file inside the `Dockerfile`: ```{ .dockerfile .annotate hl_lines="10 13" } -FROM python:3.9 +FROM python:3.9 WORKDIR /code diff --git a/docs/en/docs/deployment/manually.md b/docs/en/docs/deployment/manually.md index 16286533a..d6892b2c1 100644 --- a/docs/en/docs/deployment/manually.md +++ b/docs/en/docs/deployment/manually.md @@ -38,7 +38,7 @@ You can install an ASGI compatible server with: !!! tip By adding the `standard`, Uvicorn will install and use some recommended extra dependencies. - + That including `uvloop`, the high-performance drop-in replacement for `asyncio`, that provides the big concurrency performance boost. === "Hypercorn" @@ -89,7 +89,7 @@ You can then run your application the same way you have done in the tutorials, b Remember to remove the `--reload` option if you were using it. The `--reload` option consumes much more resources, is more unstable, etc. - + It helps a lot during **development**, but you **shouldn't** use it in **production**. ## Hypercorn with Trio diff --git a/docs/en/docs/img/deployment/concepts/process-ram.drawio b/docs/en/docs/img/deployment/concepts/process-ram.drawio index 51fc30ed3..b29c8a342 100644 --- a/docs/en/docs/img/deployment/concepts/process-ram.drawio +++ b/docs/en/docs/img/deployment/concepts/process-ram.drawio @@ -103,4 +103,4 @@ - \ No newline at end of file + diff --git a/docs/en/docs/img/deployment/concepts/process-ram.svg b/docs/en/docs/img/deployment/concepts/process-ram.svg index cd086c36b..c1bf0d589 100644 --- a/docs/en/docs/img/deployment/concepts/process-ram.svg +++ b/docs/en/docs/img/deployment/concepts/process-ram.svg @@ -56,4 +56,4 @@ }
Server
Server
RAM
RAM
CPU
CPU -
Processย Manager
Processย Manager
Worker Process
Worker Process
Worker Process
Worker Process
Another Process
Another Process
1 GB
1 GB
1 GB
1 GB
Viewer does not support full SVG 1.1 \ No newline at end of file +
Processย Manager
Processย Manager
Worker Process
Worker Process
Worker Process
Worker Process
Another Process
Another Process
1 GB
1 GB
1 GB
1 GB
Viewer does not support full SVG 1.1 diff --git a/docs/en/docs/img/deployment/https/https.drawio b/docs/en/docs/img/deployment/https/https.drawio index 31cfab96b..c4c8a3628 100644 --- a/docs/en/docs/img/deployment/https/https.drawio +++ b/docs/en/docs/img/deployment/https/https.drawio @@ -274,4 +274,4 @@ - \ No newline at end of file + diff --git a/docs/en/docs/img/deployment/https/https.svg b/docs/en/docs/img/deployment/https/https.svg index e63345eba..69497518a 100644 --- a/docs/en/docs/img/deployment/https/https.svg +++ b/docs/en/docs/img/deployment/https/https.svg @@ -59,4 +59,4 @@
someapp.example.com
someapp.example.com
another.example.net
another.example.net
onemore.example.org
onemore.example.org -
IP:
123.124.125.126
IP:...
Decrypted request for: someapp.example.com
Decrypted request for: someapp.example.com
Viewer does not support full SVG 1.1 \ No newline at end of file +
IP:
123.124.125.126
IP:...
Decrypted request for: someapp.example.com
Decrypted request for: someapp.example.com
Viewer does not support full SVG 1.1 diff --git a/docs/en/docs/img/deployment/https/https01.drawio b/docs/en/docs/img/deployment/https/https01.drawio index 9bc5340ce..181582f9b 100644 --- a/docs/en/docs/img/deployment/https/https01.drawio +++ b/docs/en/docs/img/deployment/https/https01.drawio @@ -75,4 +75,4 @@ - \ No newline at end of file + diff --git a/docs/en/docs/img/deployment/https/https01.svg b/docs/en/docs/img/deployment/https/https01.svg index 4fee0adfc..2edbd0623 100644 --- a/docs/en/docs/img/deployment/https/https01.svg +++ b/docs/en/docs/img/deployment/https/https01.svg @@ -54,4 +54,4 @@ src: url("https://fonts.gstatic.com/s/roboto/v29/KFOmCnqEu92Fr1Mu4mxK.woff2") format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } -
https://someapp.example.com
https://someapp.example.com
DNS Servers
DNS Servers
Who is: someapp.example.com
Who is: someapp.example.com
IP:
123.124.125.126
IP:...
Viewer does not support full SVG 1.1 \ No newline at end of file +
https://someapp.example.com
https://someapp.example.com
DNS Servers
DNS Servers
Who is: someapp.example.com
Who is: someapp.example.com
IP:
123.124.125.126
IP:...
Viewer does not support full SVG 1.1 diff --git a/docs/en/docs/img/deployment/https/https02.drawio b/docs/en/docs/img/deployment/https/https02.drawio index 0f7578d3e..650c06d1e 100644 --- a/docs/en/docs/img/deployment/https/https02.drawio +++ b/docs/en/docs/img/deployment/https/https02.drawio @@ -107,4 +107,4 @@ - \ No newline at end of file + diff --git a/docs/en/docs/img/deployment/https/https02.svg b/docs/en/docs/img/deployment/https/https02.svg index 1f37a7098..e16b7e94a 100644 --- a/docs/en/docs/img/deployment/https/https02.svg +++ b/docs/en/docs/img/deployment/https/https02.svg @@ -54,4 +54,4 @@ src: url("https://fonts.gstatic.com/s/roboto/v29/KFOmCnqEu92Fr1Mu4mxK.woff2") format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } -
Server(s)
Server(s)
https://someapp.example.com
https://someapp.example.com
DNS Servers
DNS Servers
Port 443 (HTTPS)
Port 443 (HTTPS)
IP:
123.124.125.126
IP:...
Who is: someapp.example.com
Who is: someapp.example.com
IP:
123.124.125.126
IP:...
TLS Handshake
TLS Handshake
Viewer does not support full SVG 1.1 \ No newline at end of file +
Server(s)
Server(s)
https://someapp.example.com
https://someapp.example.com
DNS Servers
DNS Servers
Port 443 (HTTPS)
Port 443 (HTTPS)
IP:
123.124.125.126
IP:...
Who is: someapp.example.com
Who is: someapp.example.com
IP:
123.124.125.126
IP:...
TLS Handshake
TLS Handshake
Viewer does not support full SVG 1.1 diff --git a/docs/en/docs/img/deployment/https/https03.drawio b/docs/en/docs/img/deployment/https/https03.drawio index c5766086c..c178fd363 100644 --- a/docs/en/docs/img/deployment/https/https03.drawio +++ b/docs/en/docs/img/deployment/https/https03.drawio @@ -128,4 +128,4 @@ - \ No newline at end of file + diff --git a/docs/en/docs/img/deployment/https/https03.svg b/docs/en/docs/img/deployment/https/https03.svg index e68e1c459..2badd1c7d 100644 --- a/docs/en/docs/img/deployment/https/https03.svg +++ b/docs/en/docs/img/deployment/https/https03.svg @@ -59,4 +59,4 @@
someapp.example.com
someapp.example.com
another.example.net
another.example.net
onemore.example.org
onemore.example.org -
IP:
123.124.125.126
IP:...
Viewer does not support full SVG 1.1 \ No newline at end of file +
IP:
123.124.125.126
IP:...
Viewer does not support full SVG 1.1 diff --git a/docs/en/docs/img/deployment/https/https04.drawio b/docs/en/docs/img/deployment/https/https04.drawio index ea357a6c1..78a6e919a 100644 --- a/docs/en/docs/img/deployment/https/https04.drawio +++ b/docs/en/docs/img/deployment/https/https04.drawio @@ -149,4 +149,4 @@ - \ No newline at end of file + diff --git a/docs/en/docs/img/deployment/https/https04.svg b/docs/en/docs/img/deployment/https/https04.svg index 4c9b7999b..4513ac76b 100644 --- a/docs/en/docs/img/deployment/https/https04.svg +++ b/docs/en/docs/img/deployment/https/https04.svg @@ -59,4 +59,4 @@
someapp.example.com
someapp.example.com
another.example.net
another.example.net
onemore.example.org
onemore.example.org -
IP:
123.124.125.126
IP:...
Viewer does not support full SVG 1.1 \ No newline at end of file +
IP:
123.124.125.126
IP:...
Viewer does not support full SVG 1.1 diff --git a/docs/en/docs/img/deployment/https/https05.drawio b/docs/en/docs/img/deployment/https/https05.drawio index 9b8b7c6f7..236ecd841 100644 --- a/docs/en/docs/img/deployment/https/https05.drawio +++ b/docs/en/docs/img/deployment/https/https05.drawio @@ -163,4 +163,4 @@ - \ No newline at end of file + diff --git a/docs/en/docs/img/deployment/https/https05.svg b/docs/en/docs/img/deployment/https/https05.svg index d11647b9b..ddcd2760a 100644 --- a/docs/en/docs/img/deployment/https/https05.svg +++ b/docs/en/docs/img/deployment/https/https05.svg @@ -59,4 +59,4 @@
someapp.example.com
someapp.example.com
another.example.net
another.example.net
onemore.example.org
onemore.example.org -
IP:
123.124.125.126
IP:...
Viewer does not support full SVG 1.1 \ No newline at end of file +
IP:
123.124.125.126
IP:...
Viewer does not support full SVG 1.1 diff --git a/docs/en/docs/img/deployment/https/https06.drawio b/docs/en/docs/img/deployment/https/https06.drawio index 5bb85813f..9dec13184 100644 --- a/docs/en/docs/img/deployment/https/https06.drawio +++ b/docs/en/docs/img/deployment/https/https06.drawio @@ -180,4 +180,4 @@ - \ No newline at end of file + diff --git a/docs/en/docs/img/deployment/https/https06.svg b/docs/en/docs/img/deployment/https/https06.svg index 10e03b7c5..3695de40c 100644 --- a/docs/en/docs/img/deployment/https/https06.svg +++ b/docs/en/docs/img/deployment/https/https06.svg @@ -59,4 +59,4 @@
someapp.example.com
someapp.example.com
another.example.net
another.example.net
onemore.example.org
onemore.example.org -
IP:
123.124.125.126
IP:...
Viewer does not support full SVG 1.1 \ No newline at end of file +
IP:
123.124.125.126
IP:...
Viewer does not support full SVG 1.1 diff --git a/docs/en/docs/img/deployment/https/https07.drawio b/docs/en/docs/img/deployment/https/https07.drawio index 1ca994b22..aa8f4d6be 100644 --- a/docs/en/docs/img/deployment/https/https07.drawio +++ b/docs/en/docs/img/deployment/https/https07.drawio @@ -200,4 +200,4 @@ - \ No newline at end of file + diff --git a/docs/en/docs/img/deployment/https/https07.svg b/docs/en/docs/img/deployment/https/https07.svg index e409d8871..551354cef 100644 --- a/docs/en/docs/img/deployment/https/https07.svg +++ b/docs/en/docs/img/deployment/https/https07.svg @@ -59,4 +59,4 @@
someapp.example.com
someapp.example.com
another.example.net
another.example.net
onemore.example.org
onemore.example.org -
IP:
123.124.125.126
IP:...
Viewer does not support full SVG 1.1 \ No newline at end of file +
IP:
123.124.125.126
IP:...
Viewer does not support full SVG 1.1 diff --git a/docs/en/docs/img/deployment/https/https08.drawio b/docs/en/docs/img/deployment/https/https08.drawio index 8a4f41056..794b192df 100644 --- a/docs/en/docs/img/deployment/https/https08.drawio +++ b/docs/en/docs/img/deployment/https/https08.drawio @@ -214,4 +214,4 @@ - \ No newline at end of file + diff --git a/docs/en/docs/img/deployment/https/https08.svg b/docs/en/docs/img/deployment/https/https08.svg index 3047dd821..2d4680dcc 100644 --- a/docs/en/docs/img/deployment/https/https08.svg +++ b/docs/en/docs/img/deployment/https/https08.svg @@ -59,4 +59,4 @@
someapp.example.com
someapp.example.com
another.example.net
another.example.net
onemore.example.org
onemore.example.org -
IP:
123.124.125.126
IP:...
Viewer does not support full SVG 1.1 \ No newline at end of file +
IP:
123.124.125.126
IP:...
Viewer does not support full SVG 1.1 diff --git a/docs/en/docs/img/tutorial/bigger-applications/package.drawio b/docs/en/docs/img/tutorial/bigger-applications/package.drawio index 48f6e76fe..cab3de2ca 100644 --- a/docs/en/docs/img/tutorial/bigger-applications/package.drawio +++ b/docs/en/docs/img/tutorial/bigger-applications/package.drawio @@ -40,4 +40,4 @@ - \ No newline at end of file + diff --git a/docs/en/docs/img/tutorial/bigger-applications/package.svg b/docs/en/docs/img/tutorial/bigger-applications/package.svg index a9cec926a..44da1dc30 100644 --- a/docs/en/docs/img/tutorial/bigger-applications/package.svg +++ b/docs/en/docs/img/tutorial/bigger-applications/package.svg @@ -1 +1 @@ -
Package app
app/__init__.py
Package app...
Module app.main
app/main.py
Module app.main...
Module app.dependencies
app/dependencies.py
Module app.dependencies...
Subpackage app.internal
app/internal/__init__.py
Subpackage app.internal...
Module app.internal.admin
app/internal/admin.py
Module app.internal.admin...
Subpackage app.routers
app/routers/__init__.py
Subpackage app.routers...
Module app.routers.items
app/routers/items.py
Module app.routers.items...
Module app.routers.users
app/routers/users.py
Module app.routers.users...
Viewer does not support full SVG 1.1
\ No newline at end of file +
Package app
app/__init__.py
Package app...
Module app.main
app/main.py
Module app.main...
Module app.dependencies
app/dependencies.py
Module app.dependencies...
Subpackage app.internal
app/internal/__init__.py
Subpackage app.internal...
Module app.internal.admin
app/internal/admin.py
Module app.internal.admin...
Subpackage app.routers
app/routers/__init__.py
Subpackage app.routers...
Module app.routers.items
app/routers/items.py
Module app.routers.items...
Module app.routers.users
app/routers/users.py
Module app.routers.users...
Viewer does not support full SVG 1.1
diff --git a/docs/en/docs/js/termynal.js b/docs/en/docs/js/termynal.js index 8b0e9339e..4ac32708a 100644 --- a/docs/en/docs/js/termynal.js +++ b/docs/en/docs/js/termynal.js @@ -72,14 +72,14 @@ class Termynal { * Initialise the widget, get lines, clear container and start animation. */ init() { - /** + /** * Calculates width and height of Termynal container. * If container is empty and lines are dynamically loaded, defaults to browser `auto` or CSS. - */ + */ const containerStyle = getComputedStyle(this.container); - this.container.style.width = containerStyle.width !== '0px' ? + this.container.style.width = containerStyle.width !== '0px' ? containerStyle.width : undefined; - this.container.style.minHeight = containerStyle.height !== '0px' ? + this.container.style.minHeight = containerStyle.height !== '0px' ? containerStyle.height : undefined; this.container.setAttribute('data-termynal', ''); @@ -138,7 +138,7 @@ class Termynal { restart.innerHTML = "restart โ†ป" return restart } - + generateFinish() { const finish = document.createElement('a') finish.onclick = (e) => { @@ -215,7 +215,7 @@ class Termynal { /** * Converts line data objects into line elements. - * + * * @param {Object[]} lineData - Dynamically loaded lines. * @param {Object} line - Line data object. * @returns {Element[]} - Array of line elements. @@ -231,7 +231,7 @@ class Termynal { /** * Helper function for generating attributes string. - * + * * @param {Object} line - Line data object. * @returns {string} - String of attributes. */ diff --git a/docs/en/docs/python-types.md b/docs/en/docs/python-types.md index fe56dadec..8486ed849 100644 --- a/docs/en/docs/python-types.md +++ b/docs/en/docs/python-types.md @@ -29,7 +29,7 @@ Calling this program outputs: John Doe ``` -The function does the following: +The function does the following: * Takes a `first_name` and `last_name`. * Converts the first letter of each one to upper case with `title()`. @@ -334,14 +334,14 @@ These types that take type parameters in square brackets are called **Generic ty === "Python 3.9 and above" You can use the same builtin types as generics (with square brakets and types inside): - + * `list` * `tuple` * `set` * `dict` And the same as with Python 3.6, from the `typing` module: - + * `Union` * `Optional` * ...and others. @@ -354,7 +354,7 @@ These types that take type parameters in square brackets are called **Generic ty * `tuple` * `set` * `dict` - + And the same as with Python 3.6, from the `typing` module: * `Union` diff --git a/docs/en/docs/tutorial/bigger-applications.md b/docs/en/docs/tutorial/bigger-applications.md index 2a2e764b5..d201953df 100644 --- a/docs/en/docs/tutorial/bigger-applications.md +++ b/docs/en/docs/tutorial/bigger-applications.md @@ -334,7 +334,7 @@ from app.routers import items, users ```Python from .routers import items, users ``` - + The second version is an "absolute import": ```Python diff --git a/docs/en/docs/tutorial/body-nested-models.md b/docs/en/docs/tutorial/body-nested-models.md index fa38cfc48..bfc948f4f 100644 --- a/docs/en/docs/tutorial/body-nested-models.md +++ b/docs/en/docs/tutorial/body-nested-models.md @@ -366,7 +366,7 @@ In this case, you would accept any `dict` as long as it has `int` keys with `flo But Pydantic has automatic data conversion. This means that, even though your API clients can only send strings as keys, as long as those strings contain pure integers, Pydantic will convert them and validate them. - + And the `dict` you receive as `weights` will actually have `int` keys and `float` values. ## Recap diff --git a/docs/en/docs/tutorial/body.md b/docs/en/docs/tutorial/body.md index 81441b41e..eb21f29a8 100644 --- a/docs/en/docs/tutorial/body.md +++ b/docs/en/docs/tutorial/body.md @@ -138,7 +138,7 @@ But you would get the same editor support with PyCharm as your editor, you can use the Pydantic PyCharm Plugin. It improves editor support for Pydantic models, with: - + * auto-completion * type checks * refactoring diff --git a/docs/en/docs/tutorial/dependencies/dependencies-with-yield.md b/docs/en/docs/tutorial/dependencies/dependencies-with-yield.md index ac2e9cb8c..a7300f0b7 100644 --- a/docs/en/docs/tutorial/dependencies/dependencies-with-yield.md +++ b/docs/en/docs/tutorial/dependencies/dependencies-with-yield.md @@ -10,7 +10,7 @@ To do this, use `yield` instead of `return`, and write the extra steps after. !!! note "Technical Details" Any function that is valid to use with: - * `@contextlib.contextmanager` or + * `@contextlib.contextmanager` or * `@contextlib.asynccontextmanager` would be valid to use as a **FastAPI** dependency. @@ -207,7 +207,7 @@ You can also use them inside of **FastAPI** dependencies with `yield` by using !!! tip Another way to create a context manager is with: - * `@contextlib.contextmanager` or + * `@contextlib.contextmanager` or * `@contextlib.asynccontextmanager` using them to decorate a function with a single `yield`. diff --git a/docs/en/docs/tutorial/request-files.md b/docs/en/docs/tutorial/request-files.md index 3ca471a91..664a1102f 100644 --- a/docs/en/docs/tutorial/request-files.md +++ b/docs/en/docs/tutorial/request-files.md @@ -106,7 +106,7 @@ The way HTML forms (`
`) sends the data to the server normally uses Data from forms is normally encoded using the "media type" `application/x-www-form-urlencoded` when it doesn't include files. But when the form includes files, it is encoded as `multipart/form-data`. If you use `File`, **FastAPI** will know it has to get the files from the correct part of the body. - + If you want to read more about these encodings and form fields, head to the MDN web docs for POST. !!! warning diff --git a/docs/en/docs/tutorial/request-forms.md b/docs/en/docs/tutorial/request-forms.md index b5495a400..2021a098f 100644 --- a/docs/en/docs/tutorial/request-forms.md +++ b/docs/en/docs/tutorial/request-forms.md @@ -45,7 +45,7 @@ The way HTML forms (`
`) sends the data to the server normally uses Data from forms is normally encoded using the "media type" `application/x-www-form-urlencoded`. But when the form includes files, it is encoded as `multipart/form-data`. You'll read about handling files in the next chapter. - + If you want to read more about these encodings and form fields, head to the MDN web docs for POST. !!! warning diff --git a/docs/en/overrides/main.html b/docs/en/overrides/main.html index cac02ca7c..eb1cb5c82 100644 --- a/docs/en/overrides/main.html +++ b/docs/en/overrides/main.html @@ -69,9 +69,9 @@ }); }); -Marshmallow -L'une des principales fonctionnalitรฉs nรฉcessaires aux systรจmes API est la "sรฉrialisation" des donnรฉes, qui consiste ร  prendre les donnรฉes du code (Python) et ร  les convertir en quelque chose qui peut รชtre envoyรฉ sur le rรฉseau. Par exemple, convertir un objet contenant des donnรฉes provenant d'une base de donnรฉes en un objet JSON. Convertir des objets `datetime` en strings, etc. @@ -147,7 +147,7 @@ Sans un systรจme de validation des donnรฉes, vous devriez effectuer toutes les v Ces fonctionnalitรฉs sont ce pourquoi Marshmallow a รฉtรฉ construit. C'est une excellente bibliothรจque, et je l'ai dรฉjร  beaucoup utilisรฉe. -Mais elle a รฉtรฉ crรฉรฉe avant que les type hints n'existent en Python. Ainsi, pour dรฉfinir chaque schรฉma, vous devez utiliser des utilitaires et des classes spรฉcifiques fournies par Marshmallow. !!! check "A inspirรฉ **FastAPI** ร " @@ -155,7 +155,7 @@ Utilisez du code pour dรฉfinir des "schรฉmas" qui fournissent automatiquement le ### Webargs -Une autre grande fonctionnalitรฉ requise par les API est le parsing des donnรฉes provenant des requรชtes entrantes. Webargs est un outil qui a รฉtรฉ crรฉรฉ pour fournir cela par-dessus plusieurs frameworks, dont Flask. diff --git a/docs/fr/docs/async.md b/docs/fr/docs/async.md index 20f4ee101..71c28b703 100644 --- a/docs/fr/docs/async.md +++ b/docs/fr/docs/async.md @@ -220,7 +220,7 @@ Et comme on peut avoir du parallรฉlisme et de l'asynchronicitรฉ en mรชme temps, Nope ! C'est รงa la morale de l'histoire. La concurrence est diffรฉrente du parallรฉlisme. C'est mieux sur des scรฉnarios **spรฉcifiques** qui impliquent beaucoup d'attente. ร€ cause de รงa, c'est gรฉnรฉralement bien meilleur que le parallรฉlisme pour le dรฉveloppement d'applications web. Mais pas pour tout. - + Donc pour รฉquilibrer tout รงa, imaginez l'histoire suivante : > Vous devez nettoyer une grande et sale maison. @@ -293,7 +293,7 @@ def get_sequential_burgers(number: int): Avec `async def`, Python sait que dans cette fonction il doit prendre en compte les expressions `await`, et qu'il peut mettre en pause โธ l'exรฉcution de la fonction pour aller faire autre chose ๐Ÿ”€ avant de revenir. -Pour appeler une fonction dรฉfinie avec `async def`, vous devez utiliser `await`. Donc ceci ne marche pas : +Pour appeler une fonction dรฉfinie avec `async def`, vous devez utiliser `await`. Donc ceci ne marche pas : ```Python # Ceci ne fonctionne pas, car get_burgers a รฉtรฉ dรฉfini avec async def @@ -375,7 +375,7 @@ Au final, dans les deux situations, il est fort probable que **FastAPI** soit to La mรชme chose s'applique aux dรฉpendances. Si une dรฉpendance est dรฉfinie avec `def` plutรดt que `async def`, elle est exรฉcutรฉe dans la threadpool externe. -### Sous-dรฉpendances +### Sous-dรฉpendances Vous pouvez avoir de multiples dรฉpendances et sous-dรฉpendances dรฉpendant les unes des autres (en tant que paramรจtres de la dรฉfinition de la *fonction de chemin*), certaines crรฉรฉes avec `async def` et d'autres avec `def`. Cela fonctionnerait aussi, et celles dรฉfinies avec un simple `def` seraient exรฉcutรฉes sur un thread externe (venant de la threadpool) plutรดt que d'รชtre "attendues". diff --git a/docs/fr/docs/deployment/docker.md b/docs/fr/docs/deployment/docker.md index e4b59afbf..d2dcae722 100644 --- a/docs/fr/docs/deployment/docker.md +++ b/docs/fr/docs/deployment/docker.md @@ -118,7 +118,7 @@ $ docker run -d --name mycontainer -p 80:80 myimage -Vous disposez maintenant d'un serveur FastAPI optimisรฉ dans un conteneur Docker. Configurรฉ automatiquement pour votre +Vous disposez maintenant d'un serveur FastAPI optimisรฉ dans un conteneur Docker. Configurรฉ automatiquement pour votre serveur actuel (et le nombre de cล“urs du CPU). ## Vรฉrifier @@ -139,7 +139,7 @@ Vous verrez la documentation interactive automatique de l'API (fournie par http://192.168.99.100/redoc ou http://127.0.0.1/redoc (ou รฉquivalent, en utilisant votre hรดte Docker). @@ -149,7 +149,7 @@ Vous verrez la documentation automatique alternative (fournie par Traefik est un reverse proxy/load balancer +Traefik est un reverse proxy/load balancer haute performance. Il peut faire office de "Proxy de terminaison TLS" (entre autres fonctionnalitรฉs). Il est intรฉgrรฉ ร  Let's Encrypt. Ainsi, il peut gรฉrer toutes les parties HTTPS, y compris l'acquisition et le renouvellement des certificats. @@ -164,7 +164,7 @@ Avec ces informations et ces outils, passez ร  la section suivante pour tout com Vous pouvez avoir un cluster en mode Docker Swarm configurรฉ en quelques minutes (environ 20 min) avec un processus Traefik principal gรฉrant HTTPS (y compris l'acquisition et le renouvellement des certificats). -En utilisant le mode Docker Swarm, vous pouvez commencer par un "cluster" d'une seule machine (il peut mรชme s'agir +En utilisant le mode Docker Swarm, vous pouvez commencer par un "cluster" d'une seule machine (il peut mรชme s'agir d'un serveur ร  5 USD/mois) et ensuite vous pouvez vous dรฉvelopper autant que vous le souhaitez en ajoutant d'autres serveurs. Pour configurer un cluster en mode Docker Swarm avec Traefik et la gestion de HTTPS, suivez ce guideย : diff --git a/docs/fr/docs/features.md b/docs/fr/docs/features.md index 4b00ecb6f..dcc0e39ed 100644 --- a/docs/fr/docs/features.md +++ b/docs/fr/docs/features.md @@ -27,7 +27,7 @@ Documentation d'API interactive et interface web d'exploration. Comme le framewo Tout est basรฉ sur la dรฉclaration de type standard de **Python 3.6** (grรขce ร  Pydantic). Pas de nouvelles syntaxes ร  apprendre. Juste du Python standard et moderne. -Si vous souhaitez un rappel de 2 minutes sur l'utilisation des types en Python (mรชme si vous ne comptez pas utiliser FastAPI), jetez un oeil au tutoriel suivant: [Python Types](python-types.md){.internal-link target=_blank}. +Si vous souhaitez un rappel de 2 minutes sur l'utilisation des types en Python (mรชme si vous ne comptez pas utiliser FastAPI), jetez un oeil au tutoriel suivant: [Python Types](python-types.md){.internal-link target=_blank}. Vous รฉcrivez du python standard avec des annotations de types: diff --git a/docs/fr/docs/index.md b/docs/fr/docs/index.md index 3922d9c77..0b537054e 100644 --- a/docs/fr/docs/index.md +++ b/docs/fr/docs/index.md @@ -321,7 +321,7 @@ And now, go to http://127.0.0.1:8000/items/foo, vous verrez comme rรฉponse : @@ -44,7 +44,7 @@ Si vous exรฉcutez cet exemple et allez sur "parsing" automatique. ## Validation de donnรฉes @@ -91,7 +91,7 @@ documentation gรฉnรฉrรฉe automatiquement et interactive : On voit bien dans la documentation que `item_id` est dรฉclarรฉ comme entier. -## Les avantages d'avoir une documentation basรฉe sur une norme, et la documentation alternative. +## Les avantages d'avoir une documentation basรฉe sur une norme, et la documentation alternative. Le schรฉma gรฉnรฉrรฉ suivant la norme OpenAPI, il existe de nombreux outils compatibles. @@ -102,7 +102,7 @@ sur De la mรชme faรงon, il existe bien d'autres outils compatibles, y compris des outils de gรฉnรฉration de code -pour de nombreux langages. +pour de nombreux langages. ## Pydantic diff --git a/docs/fr/docs/tutorial/query-params.md b/docs/fr/docs/tutorial/query-params.md index f1f2a605d..7bf3b9e79 100644 --- a/docs/fr/docs/tutorial/query-params.md +++ b/docs/fr/docs/tutorial/query-params.md @@ -6,7 +6,7 @@ Quand vous dรฉclarez des paramรจtres dans votre fonction de chemin qui ne font p {!../../../docs_src/query_params/tutorial001.py!} ``` -La partie appelรฉe requรชte (ou **query**) dans une URL est l'ensemble des paires clรฉs-valeurs placรฉes aprรจs le `?` , sรฉparรฉes par des `&`. +La partie appelรฉe requรชte (ou **query**) dans une URL est l'ensemble des paires clรฉs-valeurs placรฉes aprรจs le `?` , sรฉparรฉes par des `&`. Par exemple, dans l'URL : @@ -120,7 +120,7 @@ ou n'importe quelle autre variation de casse (tout en majuscules, uniquement la ## Multiples paramรจtres de chemin et de requรชte -Vous pouvez dรฉclarer plusieurs paramรจtres de chemin et paramรจtres de requรชte dans la mรชme fonction, **FastAPI** saura comment les gรฉrer. +Vous pouvez dรฉclarer plusieurs paramรจtres de chemin et paramรจtres de requรชte dans la mรชme fonction, **FastAPI** saura comment les gรฉrer. Et vous n'avez pas besoin de les dรฉclarer dans un ordre spรฉcifique. diff --git a/docs/id/docs/index.md b/docs/id/docs/index.md index a7af14781..0bb7b55e3 100644 --- a/docs/id/docs/index.md +++ b/docs/id/docs/index.md @@ -321,7 +321,7 @@ And now, go to https://github.com/tiangolo/full-stack * https://github.com/tiangolo/full-stack-flask-couchbase -* https://github.com/tiangolo/full-stack-flask-couchdb +* https://github.com/tiangolo/full-stack-flask-couchdb ใใ—ใฆใ€ใ“ใ‚Œใ‚‰ใฎใƒ•ใƒซใ‚นใ‚ฟใƒƒใ‚ฏใ‚ธใ‚งใƒใƒฌใƒผใ‚ฟใƒผใฏใ€[**FastAPI** Project Generators](project-generation.md){.internal-link target=_blank}ใฎๅ…ƒใจใชใฃใฆใ„ใพใ—ใŸใ€‚ @@ -295,7 +295,7 @@ OpenAPIใ‚„JSON Schemaใฎใ‚ˆใ†ใชๆจ™ๆบ–ใซๅŸบใฅใ„ใŸใ‚‚ใฎใงใฏใ‚ใ‚Šใพใ› HugใฏAPIStarใซ้ƒจๅˆ†็š„ใชใ‚คใƒณใ‚นใƒ”ใƒฌใƒผใ‚ทใƒงใƒณใ‚’ไธŽใˆใฆใŠใ‚Šใ€็งใŒ็™บ่ฆ‹ใ—ใŸไธญใงใฏAPIStarใจๅŒๆง˜ใซๆœ€ใ‚‚ๆœŸๅพ…ใฎๆŒใฆใ‚‹ใƒ„ใƒผใƒซใฎไธ€ใคใงใ—ใŸใ€‚ Hugใฏใ€**FastAPI**ใŒPythonใฎๅž‹ใƒ’ใƒณใƒˆใ‚’็”จใ„ใฆใƒ‘ใƒฉใƒกใƒผใ‚ฟใ‚’ๅฎฃ่จ€ใ—่‡ชๅ‹•็š„ใซAPIใ‚’ๅฎš็พฉใ™ใ‚‹ใ‚นใ‚ญใƒผใƒžใ‚’็”Ÿๆˆใ™ใ‚‹ใ“ใจใ‚’่งฆ็™บใ—ใพใ—ใŸใ€‚ - + Hugใฏใ€**FastAPI**ใŒใƒ˜ใƒƒใƒ€ใƒผใ‚„ใ‚ฏใƒƒใ‚ญใƒผใ‚’่จญๅฎšใ™ใ‚‹ใŸใ‚ใซ้–ขๆ•ฐใซ `response`ๅผ•ๆ•ฐใ‚’ๅฎฃ่จ€ใ™ใ‚‹ใ“ใจใซใ‚คใƒณใ‚นใƒ”ใƒฌใƒผใ‚ทใƒงใƒณใ‚’ไธŽใˆใพใ—ใŸใ€‚ ### APIStar (<= 0.5) diff --git a/docs/ja/docs/async.md b/docs/ja/docs/async.md index eff4f2f43..8fac2cb38 100644 --- a/docs/ja/docs/async.md +++ b/docs/ja/docs/async.md @@ -361,7 +361,7 @@ async def read_burgers(): ใ“ใฎ้ƒจๅˆ†ใฏ**FastAPI**ใฎไป•็ต„ใฟใซ้–ขใ™ใ‚‹้žๅธธใซๆŠ€่ก“็š„ใช่ฉณ็ดฐใงใ™ใ€‚ ใ‹ใชใ‚ŠใฎๆŠ€่ก“็Ÿฅ่ญ˜ (ใ‚ณใƒซใƒผใƒใƒณใ€ใ‚นใƒฌใƒƒใƒ‰ใ€ใƒ–ใƒญใƒƒใ‚ญใƒณใ‚ฐใชใฉ) ใŒใ‚ใ‚Šใ€FastAPIใŒ `async def` ใจ้€šๅธธใฎ `def` ใ‚’ใฉใฎใ‚ˆใ†ใซๅ‡ฆ็†ใ™ใ‚‹ใ‹็Ÿฅใ‚ŠใŸใ„ๅ ดๅˆใฏใ€ๅ…ˆใซ้€ฒใ‚“ใงใใ ใ•ใ„ใ€‚ - + ### Path operation ้–ขๆ•ฐ *path operation ้–ขๆ•ฐ*ใ‚’ `async def` ใฎไปฃใ‚ใ‚Šใซ้€šๅธธใฎ `def` ใงๅฎฃ่จ€ใ™ใ‚‹ใจใ€(ใ‚ตใƒผใƒใƒผใ‚’ใƒ–ใƒญใƒƒใ‚ฏใ™ใ‚‹ใฎใง) ็›ดๆŽฅๅ‘ผใณๅ‡บใ™ไปฃใ‚ใ‚Šใซๅค–้ƒจใ‚นใƒฌใƒƒใƒ‰ใƒ—ใƒผใƒซ (awaitใ•ใ‚Œใ‚‹) ใงๅฎŸ่กŒใ•ใ‚Œใพใ™ใ€‚ diff --git a/docs/ja/docs/deployment/index.md b/docs/ja/docs/deployment/index.md index 2ce81b551..40710a93a 100644 --- a/docs/ja/docs/deployment/index.md +++ b/docs/ja/docs/deployment/index.md @@ -4,4 +4,4 @@ ใƒฆใƒผใ‚นใ‚ฑใƒผใ‚นใ‚„ไฝฟ็”จใ—ใฆใ„ใ‚‹ใƒ„ใƒผใƒซใซใ‚ˆใฃใฆใ„ใใคใ‹ใฎๆ–นๆณ•ใซๅˆ†ใ‹ใ‚Œใพใ™ใ€‚ -ๆฌกใฎใ‚ปใ‚ฏใ‚ทใƒงใƒณใงใ‚ˆใ‚Š่ฉณใ—ใใใ‚Œใ‚‰ใฎๆ–นๆณ•ใซใคใ„ใฆ่ชฌๆ˜Žใ—ใพใ™ใ€‚ \ No newline at end of file +ๆฌกใฎใ‚ปใ‚ฏใ‚ทใƒงใƒณใงใ‚ˆใ‚Š่ฉณใ—ใใใ‚Œใ‚‰ใฎๆ–นๆณ•ใซใคใ„ใฆ่ชฌๆ˜Žใ—ใพใ™ใ€‚ diff --git a/docs/ja/docs/deployment/manually.md b/docs/ja/docs/deployment/manually.md index 3296ba76f..dd4b568bd 100644 --- a/docs/ja/docs/deployment/manually.md +++ b/docs/ja/docs/deployment/manually.md @@ -20,7 +20,7 @@ !!! tip "่ฑ†็Ÿฅ่ญ˜" `standard` ใ‚’ๅŠ ใˆใ‚‹ใ“ใจใงใ€UvicornใŒใ‚คใƒณใ‚นใƒˆใƒผใƒซใ•ใ‚Œใ€ใ„ใใคใ‹ใฎๆŽจๅฅจใ•ใ‚Œใ‚‹ไพๅญ˜้–ขไฟ‚ใ‚’ๅˆฉ็”จใ™ใ‚‹ใ‚ˆใ†ใซใชใ‚Šใพใ™ใ€‚ - + ใ“ใ‚Œใซใฏใ€`asyncio` ใฎ้ซ˜ๆ€ง่ƒฝใชๅฎŒๅ…จไบ’ๆ›ๅ“ใงใ‚ใ‚‹ `uvloop` ใŒๅซใพใ‚Œใ€ไธฆ่กŒๅ‡ฆ็†ใฎใƒ‘ใƒ•ใ‚ฉใƒผใƒžใƒณใ‚นใŒๅคงๅน…ใซๅ‘ไธŠใ—ใพใ™ใ€‚ === "Hypercorn" diff --git a/docs/ja/docs/history-design-future.md b/docs/ja/docs/history-design-future.md index 778252d4e..d0d1230c4 100644 --- a/docs/ja/docs/history-design-future.md +++ b/docs/ja/docs/history-design-future.md @@ -77,4 +77,4 @@ **FastAPI**ใซใฏๅคงใใชๆœชๆฅใŒๅพ…ใฃใฆใ„ใพใ™ใ€‚ -ใใ—ใฆใ€[ใ‚ใชใŸใฎๅŠฉใ‘](help-fastapi.md){.internal-link target=_blank}ใ‚’ๅคงใ„ใซๆญ“่ฟŽใ—ใพใ™ใ€‚ \ No newline at end of file +ใใ—ใฆใ€[ใ‚ใชใŸใฎๅŠฉใ‘](help-fastapi.md){.internal-link target=_blank}ใ‚’ๅคงใ„ใซๆญ“่ฟŽใ—ใพใ™ใ€‚ diff --git a/docs/ja/docs/tutorial/body.md b/docs/ja/docs/tutorial/body.md index 59388d904..d2559205b 100644 --- a/docs/ja/docs/tutorial/body.md +++ b/docs/ja/docs/tutorial/body.md @@ -114,7 +114,7 @@ APIใฏใปใจใ‚“ใฉใฎๅ ดๅˆ **ใƒฌใ‚นใƒใƒณใ‚น** ใƒœใƒ‡ใ‚ฃใ‚’้€ใ‚‰ใชใ‘ใ‚Œใฐ PyCharmใ‚จใƒ‡ใ‚ฃใ‚ฟใ‚’ไฝฟ็”จใ—ใฆใ„ใ‚‹ๅ ดๅˆใฏใ€Pydantic PyCharm PluginใŒไฝฟ็”จๅฏ่ƒฝใงใ™ใ€‚ ไปฅไธ‹ใฎใ‚จใƒ‡ใ‚ฃใ‚ฟใƒผใ‚ตใƒใƒผใƒˆใŒๅผทๅŒ–ใ•ใ‚Œใพใ™: - + * ่‡ชๅ‹•่ฃœๅฎŒ * ๅž‹ใƒใ‚งใƒƒใ‚ฏ * ใƒชใƒ•ใ‚กใ‚ฏใ‚ฟใƒชใƒณใ‚ฐ @@ -157,7 +157,7 @@ APIใฏใปใจใ‚“ใฉใฎๅ ดๅˆ **ใƒฌใ‚นใƒใƒณใ‚น** ใƒœใƒ‡ใ‚ฃใ‚’้€ใ‚‰ใชใ‘ใ‚Œใฐ !!! note "ๅ‚™่€ƒ" FastAPIใฏใ€`= None`ใŒใ‚ใ‚‹ใŠใ‹ใ’ใงใ€`q`ใŒใ‚ชใƒ—ใ‚ทใƒงใƒŠใƒซใ ใจใ‚ใ‹ใ‚Šใพใ™ใ€‚ - + `Optional[str]` ใฎ`Optional` ใฏFastAPIใงใฏไฝฟ็”จใ•ใ‚Œใฆใ„ใพใ›ใ‚“๏ผˆFastAPIใฏ`str`ใฎ้ƒจๅˆ†ใฎใฟไฝฟ็”จใ—ใพใ™๏ผ‰ใ€‚ใ—ใ‹ใ—ใ€`Optional[str]` ใฏใ‚จใƒ‡ใ‚ฃใ‚ฟใŒใ‚ณใƒผใƒ‰ใฎใ‚จใƒฉใƒผใ‚’่ฆ‹ใคใ‘ใ‚‹ใฎใ‚’ๅŠฉใ‘ใฆใใ‚Œใพใ™ใ€‚ ## Pydanticใ‚’ไฝฟใ‚ใชใ„ๆ–นๆณ• diff --git a/docs/ja/docs/tutorial/middleware.md b/docs/ja/docs/tutorial/middleware.md index f2a22119b..973eb2b1a 100644 --- a/docs/ja/docs/tutorial/middleware.md +++ b/docs/ja/docs/tutorial/middleware.md @@ -35,7 +35,7 @@ !!! tip "่ฑ†็Ÿฅ่ญ˜" 'X-'ใƒ—ใƒฌใƒ•ใ‚ฃใƒƒใ‚ฏใ‚นใ‚’ไฝฟ็”จใ—ใฆใ‚ซใ‚นใ‚ฟใƒ ใฎ็‹ฌ่‡ชใƒ˜ใƒƒใƒ€ใƒผใ‚’่ฟฝๅŠ ใงใใพใ™ใ€‚ - ใŸใ ใ—ใ€ใƒ–ใƒฉใ‚ฆใ‚ถใฎใ‚ฏใƒฉใ‚คใ‚ขใƒณใƒˆใซ่กจ็คบใ•ใ›ใŸใ„ใ‚ซใ‚นใ‚ฟใƒ ใƒ˜ใƒƒใƒ€ใƒผใŒใ‚ใ‚‹ๅ ดๅˆใฏใ€StarletteใฎCORSใƒ‰ใ‚ญใƒฅใƒกใƒณใƒˆใซ่จ˜่ผ‰ใ•ใ‚Œใฆใ„ใ‚‹ใƒ‘ใƒฉใƒกใƒผใ‚ฟ `expose_headers` ใ‚’ไฝฟ็”จใ—ใฆใ€ใใ‚Œใ‚‰ใ‚’CORS่จญๅฎšใซ่ฟฝๅŠ ใ™ใ‚‹ๅฟ…่ฆใŒใ‚ใ‚Šใพใ™ ([CORS (ใ‚ชใƒชใ‚ธใƒณ้–“ใƒชใ‚ฝใƒผใ‚นๅ…ฑๆœ‰)](cors.md){.internal-link target=_blank}) + ใŸใ ใ—ใ€ใƒ–ใƒฉใ‚ฆใ‚ถใฎใ‚ฏใƒฉใ‚คใ‚ขใƒณใƒˆใซ่กจ็คบใ•ใ›ใŸใ„ใ‚ซใ‚นใ‚ฟใƒ ใƒ˜ใƒƒใƒ€ใƒผใŒใ‚ใ‚‹ๅ ดๅˆใฏใ€StarletteใฎCORSใƒ‰ใ‚ญใƒฅใƒกใƒณใƒˆใซ่จ˜่ผ‰ใ•ใ‚Œใฆใ„ใ‚‹ใƒ‘ใƒฉใƒกใƒผใ‚ฟ `expose_headers` ใ‚’ไฝฟ็”จใ—ใฆใ€ใใ‚Œใ‚‰ใ‚’CORS่จญๅฎšใซ่ฟฝๅŠ ใ™ใ‚‹ๅฟ…่ฆใŒใ‚ใ‚Šใพใ™ ([CORS (ใ‚ชใƒชใ‚ธใƒณ้–“ใƒชใ‚ฝใƒผใ‚นๅ…ฑๆœ‰)](cors.md){.internal-link target=_blank}) !!! note "ๆŠ€่ก“่ฉณ็ดฐ" `from starlette.requests import Request` ใ‚’ไฝฟ็”จใ™ใ‚‹ใ“ใจใ‚‚ใงใใพใ™ใ€‚ diff --git a/docs/ja/docs/tutorial/path-params.md b/docs/ja/docs/tutorial/path-params.md index 452ca0c98..66de05afb 100644 --- a/docs/ja/docs/tutorial/path-params.md +++ b/docs/ja/docs/tutorial/path-params.md @@ -139,7 +139,7 @@ Pythonใฎformatๆ–‡ๅญ—ๅˆ—ใจๅŒๆง˜ใฎใ‚ทใƒณใ‚ฟใƒƒใ‚ฏใ‚นใงใ€Œใƒ‘ใ‚นใƒ‘ใƒฉใƒกใƒผ ### *ใƒ‘ใ‚นใƒ‘ใƒฉใƒกใƒผใ‚ฟ*ใฎๅฎฃ่จ€ -ๆฌกใซใ€ไฝœๆˆใ—ใŸenumใ‚ฏใƒฉใ‚นใงใ‚ใ‚‹`ModelName`ใ‚’ไฝฟ็”จใ—ใŸๅž‹ใ‚ขใƒŽใƒ†ใƒผใ‚ทใƒงใƒณใ‚’ใ‚‚ใค*ใƒ‘ใ‚นใƒ‘ใƒฉใƒกใƒผใ‚ฟ*ใ‚’ไฝœๆˆใ—ใพใ™: +ๆฌกใซใ€ไฝœๆˆใ—ใŸenumใ‚ฏใƒฉใ‚นใงใ‚ใ‚‹`ModelName`ใ‚’ไฝฟ็”จใ—ใŸๅž‹ใ‚ขใƒŽใƒ†ใƒผใ‚ทใƒงใƒณใ‚’ใ‚‚ใค*ใƒ‘ใ‚นใƒ‘ใƒฉใƒกใƒผใ‚ฟ*ใ‚’ไฝœๆˆใ—ใพใ™: ```Python hl_lines="16" {!../../../docs_src/path_params/tutorial005.py!} diff --git a/docs/ja/docs/tutorial/query-params.md b/docs/ja/docs/tutorial/query-params.md index 91783a53a..9f8c6ab9f 100644 --- a/docs/ja/docs/tutorial/query-params.md +++ b/docs/ja/docs/tutorial/query-params.md @@ -18,7 +18,7 @@ http://127.0.0.1:8000/items/?skip=0&limit=10 ...ใ‚ฏใ‚จใƒชใƒ‘ใƒฉใƒกใƒผใ‚ฟใฏ: * `skip`: ๅ€คใฏ `0` -* `limit`: ๅ€คใฏ `10` +* `limit`: ๅ€คใฏ `10` ใ“ใ‚Œใ‚‰ใฏURLใฎไธ€้ƒจใชใฎใงใ€ใ€Œ่‡ช็„ถใซใ€ๆ–‡ๅญ—ๅˆ—ใซใชใ‚Šใพใ™ใ€‚ @@ -75,7 +75,7 @@ http://127.0.0.1:8000/items/?skip=20 !!! note "ๅ‚™่€ƒ" FastAPIใฏใ€`= None`ใŒใ‚ใ‚‹ใŠใ‹ใ’ใงใ€`q`ใŒใ‚ชใƒ—ใ‚ทใƒงใƒŠใƒซใ ใจใ‚ใ‹ใ‚Šใพใ™ใ€‚ - + `Optional[str]` ใฎ`Optional` ใฏFastAPIใงใฏไฝฟ็”จใ•ใ‚Œใฆใ„ใพใ›ใ‚“๏ผˆFastAPIใฏ`str`ใฎ้ƒจๅˆ†ใฎใฟไฝฟ็”จใ—ใพใ™๏ผ‰ใ€‚ใ—ใ‹ใ—ใ€`Optional[str]` ใฏใ‚จใƒ‡ใ‚ฃใ‚ฟใŒใ‚ณใƒผใƒ‰ใฎใ‚จใƒฉใƒผใ‚’่ฆ‹ใคใ‘ใ‚‹ใฎใ‚’ๅŠฉใ‘ใฆใใ‚Œใพใ™ใ€‚ ## ใ‚ฏใ‚จใƒชใƒ‘ใƒฉใƒกใƒผใ‚ฟใฎๅž‹ๅค‰ๆ› @@ -116,7 +116,7 @@ http://127.0.0.1:8000/items/foo?short=on http://127.0.0.1:8000/items/foo?short=yes ``` -ใ‚‚ใ—ใใฏใ€ไป–ใฎๅคงๆ–‡ๅญ—ๅฐๆ–‡ๅญ—ใฎใƒใƒชใ‚จใƒผใ‚ทใƒงใƒณ (ใ‚ขใƒƒใƒ‘ใƒผใ‚ฑใƒผใ‚นใ€ๆœ€ๅˆใฎๆ–‡ๅญ—ใ ใ‘ใ‚ขใƒƒใƒ‘ใƒผใ‚ฑใƒผใ‚นใ€ใชใฉ)ใงใ€้–ขๆ•ฐใฏ `short` ใƒ‘ใƒฉใƒกใƒผใ‚ฟใ‚’ `True` ใช `bool` ๅ€คใจใ—ใฆๆ‰ฑใ„ใพใ™ใ€‚ใใ‚Œไปฅๅค–ใฏ `False` ใซใชใ‚Šใพใ™ใ€‚ +ใ‚‚ใ—ใใฏใ€ไป–ใฎๅคงๆ–‡ๅญ—ๅฐๆ–‡ๅญ—ใฎใƒใƒชใ‚จใƒผใ‚ทใƒงใƒณ (ใ‚ขใƒƒใƒ‘ใƒผใ‚ฑใƒผใ‚นใ€ๆœ€ๅˆใฎๆ–‡ๅญ—ใ ใ‘ใ‚ขใƒƒใƒ‘ใƒผใ‚ฑใƒผใ‚นใ€ใชใฉ)ใงใ€้–ขๆ•ฐใฏ `short` ใƒ‘ใƒฉใƒกใƒผใ‚ฟใ‚’ `True` ใช `bool` ๅ€คใจใ—ใฆๆ‰ฑใ„ใพใ™ใ€‚ใใ‚Œไปฅๅค–ใฏ `False` ใซใชใ‚Šใพใ™ใ€‚ ## ่ค‡ๆ•ฐใฎใƒ‘ใ‚นใƒ‘ใƒฉใƒกใƒผใ‚ฟใจใ‚ฏใ‚จใƒชใƒ‘ใƒฉใƒกใƒผใ‚ฟ diff --git a/docs/ja/docs/tutorial/request-forms.md b/docs/ja/docs/tutorial/request-forms.md index 06105c9ef..bce6e8d9a 100644 --- a/docs/ja/docs/tutorial/request-forms.md +++ b/docs/ja/docs/tutorial/request-forms.md @@ -45,7 +45,7 @@ HTMLใƒ•ใ‚ฉใƒผใƒ ๏ผˆ`
`๏ผ‰ใŒใ‚ตใƒผใƒใซใƒ‡ใƒผใ‚ฟใ‚’้€ไฟกใ™ใ‚‹ๆ–น ใƒ•ใ‚ฉใƒผใƒ ใ‹ใ‚‰ใฎใƒ‡ใƒผใ‚ฟใฏ้€šๅธธใ€`application/x-www-form-urlencoded`ใฎใ€Œmedia typeใ€ใ‚’ไฝฟ็”จใ—ใฆใ‚จใƒณใ‚ณใƒผใƒ‰ใ•ใ‚Œใพใ™ใ€‚ ใ—ใ‹ใ—ใ€ใƒ•ใ‚ฉใƒผใƒ ใŒใƒ•ใ‚กใ‚คใƒซใ‚’ๅซใ‚€ๅ ดๅˆใฏใ€`multipart/form-data`ใจใ—ใฆใ‚จใƒณใ‚ณใƒผใƒ‰ใ•ใ‚Œใพใ™ใ€‚ใƒ•ใ‚กใ‚คใƒซใฎๆ‰ฑใ„ใซใคใ„ใฆใฏๆฌกใฎ็ซ ใง่ชฌๆ˜Žใ—ใพใ™ใ€‚ - + ใ“ใ‚Œใ‚‰ใฎใ‚จใƒณใ‚ณใƒผใƒ‡ใ‚ฃใƒณใ‚ฐใ‚„ใƒ•ใ‚ฉใƒผใƒ ใƒ•ใ‚ฃใƒผใƒซใƒ‰ใฎ่ฉณ็ดฐใซใคใ„ใฆใฏใ€MDNใฎPOSTใฎใ‚ฆใ‚งใƒ–ใƒ‰ใ‚ญใƒฅใƒกใƒณใƒˆใ‚’ๅ‚็…งใ—ใฆใใ ใ•ใ„ใ€‚ !!! warning "ๆณจๆ„" diff --git a/docs/ja/docs/tutorial/testing.md b/docs/ja/docs/tutorial/testing.md index 3db493294..03b0e1dee 100644 --- a/docs/ja/docs/tutorial/testing.md +++ b/docs/ja/docs/tutorial/testing.md @@ -36,7 +36,7 @@ !!! tip "่ฑ†็Ÿฅ่ญ˜" FastAPIใ‚ขใƒ—ใƒชใ‚ฑใƒผใ‚ทใƒงใƒณใธใฎใƒชใ‚ฏใ‚จใ‚นใƒˆใฎ้€ไฟกใจใฏๅˆฅใซใ€ใƒ†ใ‚นใƒˆใง `async` ้–ขๆ•ฐ (้žๅŒๆœŸใƒ‡ใƒผใ‚ฟใƒ™ใƒผใ‚น้–ขๆ•ฐใชใฉ) ใ‚’ๅ‘ผใณๅ‡บใ—ใŸใ„ๅ ดๅˆใฏใ€้ซ˜ๅบฆใชใƒใƒฅใƒผใƒˆใƒชใ‚ขใƒซใฎ[Async Tests](../advanced/async-tests.md){.internal-link target=_blank} ใ‚’ๅ‚็…งใ—ใฆใใ ใ•ใ„ใ€‚ - + ## ใƒ†ใ‚นใƒˆใฎๅˆ†้›ข ๅฎŸ้š›ใฎใ‚ขใƒ—ใƒชใ‚ฑใƒผใ‚ทใƒงใƒณใงใฏใ€ใŠใใ‚‰ใใƒ†ใ‚นใƒˆใ‚’ๅˆฅใฎใƒ•ใ‚กใ‚คใƒซใซไฟๅญ˜ใ—ใพใ™ใ€‚ @@ -112,7 +112,7 @@ `TestClient` ใฏใ€Pydanticใƒขใƒ‡ใƒซใงใฏใชใใ€JSONใซๅค‰ๆ›ใงใใ‚‹ใƒ‡ใƒผใ‚ฟใ‚’ๅ—ใ‘ๅ–ใ‚‹ใ“ใจใซๆณจๆ„ใ—ใฆใใ ใ•ใ„ใ€‚ ใƒ†ใ‚นใƒˆใซPydanticใƒขใƒ‡ใƒซใŒใ‚ใ‚Šใ€ใƒ†ใ‚นใƒˆไธญใซใใฎใƒ‡ใƒผใ‚ฟใ‚’ใ‚ขใƒ—ใƒชใ‚ฑใƒผใ‚ทใƒงใƒณใซ้€ไฟกใ—ใŸใ„ๅ ดๅˆใฏใ€[JSONไบ’ๆ›ใ‚จใƒณใ‚ณใƒผใƒ€](encoder.md){.internal-link target=_blank} ใง่ชฌๆ˜Žใ•ใ‚Œใฆใ„ใ‚‹ `jsonable_encoder` ใŒๅˆฉ็”จใงใใพใ™ใ€‚ - + ## ๅฎŸ่กŒ ๅพŒใฏใ€`pytest` ใ‚’ใ‚คใƒณใ‚นใƒˆใƒผใƒซใ™ใ‚‹ใ ใ‘ใงใ™: diff --git a/docs/ko/docs/deployment/versions.md b/docs/ko/docs/deployment/versions.md index 4c1bcdc2e..074c15158 100644 --- a/docs/ko/docs/deployment/versions.md +++ b/docs/ko/docs/deployment/versions.md @@ -6,7 +6,7 @@ ์ด๊ฒƒ์ด ์•„์ง๋„ ์ตœ์‹  ๋ฒ„์ „์ด `0.x.x`์ธ ์ด์œ ์ž…๋‹ˆ๋‹ค. ์ด๊ฒƒ์€ ๊ฐ๊ฐ์˜ ๋ฒ„์ „๋“ค์ด ์ž ์žฌ์ ์œผ๋กœ ๋ณ€ํ•  ์ˆ˜ ์žˆ๋‹ค๋Š” ๊ฒƒ์„ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค. ์ด๋Š” ์œ ์˜์  ๋ฒ„์ „ ๊ด€์Šต์„ ๋”ฐ๋ฆ…๋‹ˆ๋‹ค. -์ง€๊ธˆ ๋ฐ”๋กœ **FastAPI**๋กœ ์‘์šฉ ํ”„๋กœ๊ทธ๋žจ์„ ๋งŒ๋“ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋•Œ (์•„๋งˆ ์ง€๊ธˆ๊นŒ์ง€ ๊ทธ๋ž˜ ์™”๋˜ ๊ฒƒ์ฒ˜๋Ÿผ), ์‚ฌ์šฉํ•˜๋Š” ๋ฒ„์ „์ด ์ฝ”๋“œ์™€ ์ž˜ ๋งž๋Š”์ง€ ํ™•์ธํ•ด์•ผํ•ฉ๋‹ˆ๋‹ค. +์ง€๊ธˆ ๋ฐ”๋กœ **FastAPI**๋กœ ์‘์šฉ ํ”„๋กœ๊ทธ๋žจ์„ ๋งŒ๋“ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋•Œ (์•„๋งˆ ์ง€๊ธˆ๊นŒ์ง€ ๊ทธ๋ž˜ ์™”๋˜ ๊ฒƒ์ฒ˜๋Ÿผ), ์‚ฌ์šฉํ•˜๋Š” ๋ฒ„์ „์ด ์ฝ”๋“œ์™€ ์ž˜ ๋งž๋Š”์ง€ ํ™•์ธํ•ด์•ผํ•ฉ๋‹ˆ๋‹ค. ## `fastapi` ๋ฒ„์ „์„ ํ‘œ์‹œ @@ -46,7 +46,7 @@ FastAPI๋Š” ์˜ค๋ฅ˜๋ฅผ ์ˆ˜์ •ํ•˜๊ณ , ์ผ๋ฐ˜์ ์ธ ๋ณ€๊ฒฝ์‚ฌํ•ญ์„ ์œ„ํ•ด "ํŒจ์น˜" !!! tip "ํŒ" ์—ฌ๊ธฐ์„œ ๋งํ•˜๋Š” "ํŒจ์น˜"๋ž€ ๋ฒ„์ „์˜ ๋งˆ์ง€๋ง‰ ์ˆซ์ž๋กœ, ์˜ˆ๋ฅผ ๋“ค์–ด `0.2.3` ๋ฒ„์ „์—์„œ "ํŒจ์น˜"๋Š” `3`์„ ์˜๋ฏธํ•ฉ๋‹ˆ๋‹ค. -๋”ฐ๋ผ์„œ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ๋ฒ„์ „์„ ํ‘œ์‹œํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค: +๋”ฐ๋ผ์„œ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ๋ฒ„์ „์„ ํ‘œ์‹œํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค: ```txt fastapi>=0.45.0,<0.46.0 @@ -71,7 +71,7 @@ fastapi>=0.45.0,<0.46.0 `starlette`์˜ ๋ฒ„์ „์€ ํ‘œ์‹œํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. -์„œ๋กœ๋‹ค๋ฅธ ๋ฒ„์ „์˜ **FastAPI**๊ฐ€ ๊ตฌ์ฒด์ ์ด๊ณ  ์ƒˆ๋กœ์šด ๋ฒ„์ „์˜ Starlette์„ ์‚ฌ์šฉํ•  ๊ฒƒ์ž…๋‹ˆ๋‹ค. +์„œ๋กœ๋‹ค๋ฅธ ๋ฒ„์ „์˜ **FastAPI**๊ฐ€ ๊ตฌ์ฒด์ ์ด๊ณ  ์ƒˆ๋กœ์šด ๋ฒ„์ „์˜ Starlette์„ ์‚ฌ์šฉํ•  ๊ฒƒ์ž…๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ๋ฏ€๋กœ **FastAPI**๊ฐ€ ์•Œ๋งž์€ Starlette ๋ฒ„์ „์„ ์‚ฌ์šฉํ•˜๋„๋ก ํ•˜์‹ญ์‹œ์˜ค. diff --git a/docs/ko/docs/tutorial/header-params.md b/docs/ko/docs/tutorial/header-params.md index 1c46b32ba..484554e97 100644 --- a/docs/ko/docs/tutorial/header-params.md +++ b/docs/ko/docs/tutorial/header-params.md @@ -57,7 +57,7 @@ ํƒ€์ž… ์ •์˜์—์„œ ๋ฆฌ์ŠคํŠธ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ด๋Ÿฌํ•œ ์ผ€์ด์Šค๋ฅผ ์ •์˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. -์ค‘๋ณต ํ—ค๋”์˜ ๋ชจ๋“  ๊ฐ’์„ ํŒŒ์ด์ฌ `list`๋กœ ์ˆ˜์‹ ํ•ฉ๋‹ˆ๋‹ค. +์ค‘๋ณต ํ—ค๋”์˜ ๋ชจ๋“  ๊ฐ’์„ ํŒŒ์ด์ฌ `list`๋กœ ์ˆ˜์‹ ํ•ฉ๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด, ๋‘ ๋ฒˆ ์ด์ƒ ๋‚˜ํƒ€๋‚  ์ˆ˜ ์žˆ๋Š” `X-Token`ํ—ค๋”๋ฅผ ์„ ์–ธํ•˜๋ ค๋ฉด, ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ž‘์„ฑํ•ฉ๋‹ˆ๋‹ค: diff --git a/docs/ko/docs/tutorial/path-params.md b/docs/ko/docs/tutorial/path-params.md index ede63f69d..5cf397e7a 100644 --- a/docs/ko/docs/tutorial/path-params.md +++ b/docs/ko/docs/tutorial/path-params.md @@ -241,4 +241,4 @@ Starlette์—์„œ ์ง์ ‘ ์˜ต์…˜์„ ์‚ฌ์šฉํ•˜๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์€ URL์„ ์‚ฌ์šฉํ•˜ ์œ„ ์‚ฌํ•ญ๋“ค์„ ๊ทธ์ € ํ•œ๋ฒˆ์— ์„ ์–ธํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค. -์ด๋Š” (์›๋ž˜ ์„ฑ๋Šฅ๊ณผ๋Š” ๋ณ„๊ฐœ๋กœ) ๋Œ€์ฒด ํ”„๋ ˆ์ž„์›Œํฌ์™€ ๋น„๊ตํ–ˆ์„ ๋•Œ **FastAPI**์˜ ์ฃผ์š” ๊ฐ€์‹œ์  ์žฅ์ ์ผ ๊ฒƒ์ž…๋‹ˆ๋‹ค. \ No newline at end of file +์ด๋Š” (์›๋ž˜ ์„ฑ๋Šฅ๊ณผ๋Š” ๋ณ„๊ฐœ๋กœ) ๋Œ€์ฒด ํ”„๋ ˆ์ž„์›Œํฌ์™€ ๋น„๊ตํ–ˆ์„ ๋•Œ **FastAPI**์˜ ์ฃผ์š” ๊ฐ€์‹œ์  ์žฅ์ ์ผ ๊ฒƒ์ž…๋‹ˆ๋‹ค. diff --git a/docs/ko/docs/tutorial/request-files.md b/docs/ko/docs/tutorial/request-files.md index 769a676cd..decefe981 100644 --- a/docs/ko/docs/tutorial/request-files.md +++ b/docs/ko/docs/tutorial/request-files.md @@ -13,7 +13,7 @@ `fastapi` ์—์„œ `File` ๊ณผ `UploadFile` ์„ ์ž„ํฌํŠธ ํ•ฉ๋‹ˆ๋‹ค: -```Python hl_lines="1" +```Python hl_lines="1" {!../../../docs_src/request_files/tutorial001.py!} ``` @@ -21,7 +21,7 @@ `Body` ๋ฐ `Form` ๊ณผ ๋™์ผํ•œ ๋ฐฉ์‹์œผ๋กœ ํŒŒ์ผ์˜ ๋งค๊ฐœ๋ณ€์ˆ˜๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค: -```Python hl_lines="7" +```Python hl_lines="7" {!../../../docs_src/request_files/tutorial001.py!} ``` @@ -45,7 +45,7 @@ `File` ๋งค๊ฐœ๋ณ€์ˆ˜๋ฅผ `UploadFile` ํƒ€์ž…์œผ๋กœ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค: -```Python hl_lines="12" +```Python hl_lines="12" {!../../../docs_src/request_files/tutorial001.py!} ``` @@ -97,7 +97,7 @@ contents = myfile.file.read() ## "ํผ ๋ฐ์ดํ„ฐ"๋ž€ -HTML์˜ ํผ๋“ค(`
`)์ด ์„œ๋ฒ„์— ๋ฐ์ดํ„ฐ๋ฅผ ์ „์†กํ•˜๋Š” ๋ฐฉ์‹์€ ๋Œ€๊ฐœ ๋ฐ์ดํ„ฐ์— JSON๊ณผ๋Š” ๋‹ค๋ฅธ "ํŠน๋ณ„ํ•œ" ์ธ์ฝ”๋”ฉ์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. +HTML์˜ ํผ๋“ค(`
`)์ด ์„œ๋ฒ„์— ๋ฐ์ดํ„ฐ๋ฅผ ์ „์†กํ•˜๋Š” ๋ฐฉ์‹์€ ๋Œ€๊ฐœ ๋ฐ์ดํ„ฐ์— JSON๊ณผ๋Š” ๋‹ค๋ฅธ "ํŠน๋ณ„ํ•œ" ์ธ์ฝ”๋”ฉ์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. **FastAPI**๋Š” JSON ๋Œ€์‹  ์˜ฌ๋ฐ”๋ฅธ ์œ„์น˜์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ์ฝ์„ ์ˆ˜ ์žˆ๋„๋ก ํ•ฉ๋‹ˆ๋‹ค. @@ -121,7 +121,7 @@ HTML์˜ ํผ๋“ค(`
`)์ด ์„œ๋ฒ„์— ๋ฐ์ดํ„ฐ๋ฅผ ์ „์†กํ•˜๋Š” ๋ฐฉ์‹์€ ์ด ๊ธฐ๋Šฅ์„ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด , `bytes` ์˜ `List` ๋˜๋Š” `UploadFile` ๋ฅผ ์„ ์–ธํ•˜๊ธฐ ๋ฐ”๋ž๋‹ˆ๋‹ค: -```Python hl_lines="10 15" +```Python hl_lines="10 15" {!../../../docs_src/request_files/tutorial002.py!} ``` diff --git a/docs/ko/docs/tutorial/request-forms-and-files.md b/docs/ko/docs/tutorial/request-forms-and-files.md index 6750c7b23..ddf232e7f 100644 --- a/docs/ko/docs/tutorial/request-forms-and-files.md +++ b/docs/ko/docs/tutorial/request-forms-and-files.md @@ -9,7 +9,7 @@ ## `File` ๋ฐ `Form` ์—…๋กœ๋“œ -```Python hl_lines="1" +```Python hl_lines="1" {!../../../docs_src/request_forms_and_files/tutorial001.py!} ``` @@ -17,7 +17,7 @@ `Body` ๋ฐ `Query`์™€ ๋™์ผํ•œ ๋ฐฉ์‹์œผ๋กœ ํŒŒ์ผ๊ณผ ํผ์˜ ๋งค๊ฐœ๋ณ€์ˆ˜๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค: -```Python hl_lines="8" +```Python hl_lines="8" {!../../../docs_src/request_forms_and_files/tutorial001.py!} ``` diff --git a/docs/ko/docs/tutorial/response-status-code.md b/docs/ko/docs/tutorial/response-status-code.md index d201867a1..f92c057be 100644 --- a/docs/ko/docs/tutorial/response-status-code.md +++ b/docs/ko/docs/tutorial/response-status-code.md @@ -8,11 +8,11 @@ * `@app.delete()` * ๊ธฐํƒ€ -```Python hl_lines="6" +```Python hl_lines="6" {!../../../docs_src/response_status_code/tutorial001.py!} ``` -!!! note "์ฐธ๊ณ " +!!! note "์ฐธ๊ณ " `status_code` ๋Š” "๋ฐ์ฝ”๋ ˆ์ดํ„ฐ" ๋ฉ”์†Œ๋“œ(`get`, `post` ๋“ฑ)์˜ ๋งค๊ฐœ๋ณ€์ˆ˜์ž…๋‹ˆ๋‹ค. ๋ชจ๋“  ๋งค๊ฐœ๋ณ€์ˆ˜๋“ค๊ณผ ๋ณธ๋ฌธ์ฒ˜๋Ÿผ *๊ฒฝ๋กœ ์ž‘๋™ ํ•จ์ˆ˜*๊ฐ€ ์•„๋‹™๋‹ˆ๋‹ค. `status_code` ๋งค๊ฐœ๋ณ€์ˆ˜๋Š” HTTP ์ƒํƒœ ์ฝ”๋“œ๋ฅผ ์ˆซ์ž๋กœ ์ž…๋ ฅ๋ฐ›์Šต๋‹ˆ๋‹ค. @@ -27,7 +27,7 @@ -!!! note "์ฐธ๊ณ " +!!! note "์ฐธ๊ณ " ์–ด๋–ค ์‘๋‹ต ์ฝ”๋“œ๋“ค์€ ํ•ด๋‹น ์‘๋‹ต์— ๋ณธ๋ฌธ์ด ์—†๋‹ค๋Š” ๊ฒƒ์„ ์˜๋ฏธํ•˜๊ธฐ๋„ ํ•ฉ๋‹ˆ๋‹ค (๋‹ค์Œ ํ•ญ๋ชฉ ์ฐธ๊ณ ). ์ด์— ๋”ฐ๋ผ FastAPI๋Š” ์‘๋‹ต ๋ณธ๋ฌธ์ด ์—†์Œ์„ ๋ช…์‹œํ•˜๋Š” OpenAPI๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค. @@ -61,7 +61,7 @@ HTTP๋Š” ์„ธ์ž๋ฆฌ์˜ ์ˆซ์ž ์ƒํƒœ ์ฝ”๋“œ๋ฅผ ์‘๋‹ต์˜ ์ผ๋ถ€๋กœ ์ „์†กํ•ฉ๋‹ˆ๋‹ค ์ƒ๊ธฐ ์˜ˆ์‹œ ์ฐธ๊ณ : -```Python hl_lines="6" +```Python hl_lines="6" {!../../../docs_src/response_status_code/tutorial001.py!} ``` @@ -71,7 +71,7 @@ HTTP๋Š” ์„ธ์ž๋ฆฌ์˜ ์ˆซ์ž ์ƒํƒœ ์ฝ”๋“œ๋ฅผ ์‘๋‹ต์˜ ์ผ๋ถ€๋กœ ์ „์†กํ•ฉ๋‹ˆ๋‹ค `fastapi.status` ์˜ ํŽธ์˜ ๋ณ€์ˆ˜๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. -```Python hl_lines="1 6" +```Python hl_lines="1 6" {!../../../docs_src/response_status_code/tutorial002.py!} ``` diff --git a/docs/pl/docs/tutorial/index.md b/docs/pl/docs/tutorial/index.md index 1a97214af..ed8752a95 100644 --- a/docs/pl/docs/tutorial/index.md +++ b/docs/pl/docs/tutorial/index.md @@ -78,4 +78,3 @@ Jest teลผ **Zaawansowany poradnik**, ktรณry moลผesz przeczytaฤ‡ po lekturze tego Najpierw jednak powinieneล› przeczytaฤ‡ **Samouczek** (czytasz go teraz). Ten rozdziaล‚ jest zaprojektowany tak, ลผe moลผesz stworzyฤ‡ kompletnฤ… aplikacjฤ™ uลผywajฤ…c tylko informacji tutaj zawartych, a nastฤ™pnie rozszerzaฤ‡ jฤ… na rรณลผne sposoby, w zaleลผnoล›ci od potrzeb, uลผywajฤ…c kilku dodatkowych pomysล‚รณw z **Zaawansowanego poradnika**. - diff --git a/docs/pt/docs/alternatives.md b/docs/pt/docs/alternatives.md index 6559b7398..61ee4f900 100644 --- a/docs/pt/docs/alternatives.md +++ b/docs/pt/docs/alternatives.md @@ -331,7 +331,7 @@ Agora APIStar รฉ um conjunto de ferramentas para validar especificaรงรตes OpenAP Existir. A idรฉia de declarar mรบltiplas coisas (validaรงรฃo de dados, serializaรงรฃo e documentaรงรฃo) com os mesmos tipos Python, que ao mesmo tempo fornecesse grande suporte ao editor, era algo que eu considerava uma brilhante idรฉia. - + E apรณs procurar por um logo tempo por um framework similar e testar muitas alternativas diferentes, APIStar foi a melhor opรงรฃo disponรญvel. Entรฃo APIStar parou de existir como um servidor e Starlette foi criado, e foi uma nova melhor fundaรงรฃo para tal sistema. Essa foi a inspiraรงรฃo final para construir **FastAPI**. @@ -390,7 +390,7 @@ Essa รฉ uma das principais coisas que **FastAPI** adiciona no topo, tudo baseado Controlar todas as partes web centrais. Adiciona recursos no topo. A classe `FastAPI` em si herda `Starlette`. - + Entรฃo, qualquer coisa que vocรช faz com Starlette, vocรช pode fazer diretamente com **FastAPI**, pois ele รฉ basicamente um Starlette com esterรณides. ### Uvicorn diff --git a/docs/pt/docs/async.md b/docs/pt/docs/async.md index 44f4b5148..be1278a1b 100644 --- a/docs/pt/docs/async.md +++ b/docs/pt/docs/async.md @@ -94,7 +94,7 @@ Para "sรญncrono" (contrรกrio de "assรญncrono") tambรฉm รฉ utilizado o termo "seq Essa idรฉia de cรณdigo **assรญncrono** descrito acima รฉ algo ร s vezes chamado de **"concorrรชncia"**. E รฉ diferente de **"paralelismo"**. -**Concorrรชncia** e **paralelismo** ambos sรฃo relacionados a "diferentes coisas acontecendo mais ou menos ao mesmo tempo". +**Concorrรชncia** e **paralelismo** ambos sรฃo relacionados a "diferentes coisas acontecendo mais ou menos ao mesmo tempo". Mas os detalhes entre *concorrรชncia* e *paralelismo* sรฃo bem diferentes. @@ -134,7 +134,7 @@ Mas entรฃo, embora vocรช ainda nรฃo tenha os hambรบrgueres, seu trabalho no caix Mas enquanto vocรช se afasta do balcรฃo e senta na mesa com o nรบmero da sua chamada, vocรช pode trocar sua atenรงรฃo para seu _crush_ :heart_eyes:, e "trabalhar" nisso. Entรฃo vocรช estรก novamente fazendo algo muito "produtivo", como flertar com seu _crush_ :heart_eyes:. -Entรฃo o caixa diz que "seus hambรบrgueres estรฃo prontos" colocando seu nรบmero no balcรฃo, mas vocรช nรฃo corre que nem um maluco imediatamente quando o nรบmero exibido รฉ o seu. Vocรช sabe que ninguรฉm irรก roubar seus hambรบrgueres porquรช vocรช tem o nรบmero de chamada, e os outros tem os nรบmeros deles. +Entรฃo o caixa diz que "seus hambรบrgueres estรฃo prontos" colocando seu nรบmero no balcรฃo, mas vocรช nรฃo corre que nem um maluco imediatamente quando o nรบmero exibido รฉ o seu. Vocรช sabe que ninguรฉm irรก roubar seus hambรบrgueres porquรช vocรช tem o nรบmero de chamada, e os outros tem os nรบmeros deles. Entรฃo vocรช espera que seu _crush_ :heart_eyes: termine a histรณria que estava contando (terminar o trabalho atual / tarefa sendo processada), sorri gentilmente e diz que vocรช estรก indo buscar os hambรบrgueres. @@ -358,9 +358,9 @@ Tudo isso รฉ o que deixa o FastAPI poderoso (atravรฉs do Starlette) e que o faz !!! warning Vocรช pode provavelmente pular isso. - + Esses sรฃo detalhes muito tรฉcnicos de como **FastAPI** funciona por baixo do capรด. - + Se vocรช tem algum conhecimento tรฉcnico (corrotinas, threads, blocking etc) e estรก curioso sobre como o FastAPI controla o `async def` vs normal `def`, vรก em frente. ### Funรงรตes de operaรงรฃo de rota diff --git a/docs/pt/docs/benchmarks.md b/docs/pt/docs/benchmarks.md index 7f7c95ba1..07461ce46 100644 --- a/docs/pt/docs/benchmarks.md +++ b/docs/pt/docs/benchmarks.md @@ -2,7 +2,7 @@ As comparaรงรตes independentes da TechEmpower mostram as aplicaรงรตes **FastAPI** rodando com Uvicorn como um dos _frameworks_ Python mais rรกpidos disponรญveis, somente atrรกs dos prรณprios Starlette e Uvicorn (utilizados internamente pelo FastAPI). (*) -Mas quando se checa _benchmarks_ e comparaรงรตes vocรช deveria ter o seguinte em mente. +Mas quando se checa _benchmarks_ e comparaรงรตes vocรช deveria ter o seguinte em mente. ## Comparaรงรตes e velocidade diff --git a/docs/pt/docs/help-fastapi.md b/docs/pt/docs/help-fastapi.md index 086273a1d..d82ce3414 100644 --- a/docs/pt/docs/help-fastapi.md +++ b/docs/pt/docs/help-fastapi.md @@ -36,7 +36,7 @@ Vocรช pode "acompanhar" (watch) o FastAPI no GitHub (clicando no botรฃo com um " Podendo selecionar apenas "Novos Updates". -Fazendo isto, serรฃo enviadas notificaรงรตes (em seu email) sempre que tiver novos updates (uma nova versรฃo) com correรงรตes de bugs e novos recursos no **FastAPI** +Fazendo isto, serรฃo enviadas notificaรงรตes (em seu email) sempre que tiver novos updates (uma nova versรฃo) com correรงรตes de bugs e novos recursos no **FastAPI** ## Conect-se com o autor diff --git a/docs/pt/docs/index.md b/docs/pt/docs/index.md index 97044dd90..c1a0dbf0d 100644 --- a/docs/pt/docs/index.md +++ b/docs/pt/docs/index.md @@ -365,7 +365,7 @@ Voltando ao cรณdigo do exemplo anterior, **FastAPI** irรก: * Como o parรขmetro `q` รฉ declarado com `= None`, ele รฉ opcional. * Sem o `None` ele poderia ser obrigatรณrio (como o corpo no caso de `PUT`). * Para requisiรงรตes `PUT` para `/items/{item_id}`, lerรก o corpo como JSON e: - * Verifica que tem um atributo obrigatรณrio `name` que deve ser `str`. + * Verifica que tem um atributo obrigatรณrio `name` que deve ser `str`. * Verifica que tem um atributo obrigatรณrio `price` que deve ser `float`. * Verifica que tem an atributo opcional `is_offer`, que deve ser `bool`, se presente. * Tudo isso tambรฉm funciona para objetos JSON profundamente aninhados. diff --git a/docs/pt/docs/python-types.md b/docs/pt/docs/python-types.md index df70afd40..9f12211c7 100644 --- a/docs/pt/docs/python-types.md +++ b/docs/pt/docs/python-types.md @@ -313,4 +313,3 @@ O importante รฉ que, usando tipos padrรฃo de Python, em um รบnico local (em vez !!! info "Informaรงรฃo" Se vocรช jรก passou por todo o tutorial e voltou para ver mais sobre os tipos, um bom recurso รฉ a "cheat sheet" do `mypy` . - diff --git a/docs/pt/docs/tutorial/body.md b/docs/pt/docs/tutorial/body.md index 5891185f3..5abc91177 100644 --- a/docs/pt/docs/tutorial/body.md +++ b/docs/pt/docs/tutorial/body.md @@ -114,7 +114,7 @@ Mas vocรช terรก o mesmo suporte do editor no PyCharm como editor, vocรช pode utilizar o Plugin do Pydantic para o PyCharm . Melhora o suporte do editor para seus modelos Pydantic com:: - + * completaรงรฃo automรกtica * verificaรงรฃo de tipos * refatoraรงรฃo diff --git a/docs/ru/docs/async.md b/docs/ru/docs/async.md index fc5e44471..4c44fc22d 100644 --- a/docs/ru/docs/async.md +++ b/docs/ru/docs/async.md @@ -228,7 +228,7 @@ def results(): ะ˜ ั‚ะพ ะถะต ัะฐะผะพะต ั ะฑะพะปัŒัˆะธะฝัั‚ะฒะพะผ ะฒะตะฑ-ะฟั€ะธะปะพะถะตะฝะธะน. -ะŸะพะปัŒะทะพะฒะฐั‚ะตะปะตะน ะพั‡ะตะฝัŒ ะผะฝะพะณะพ, ะฝะพ ะฒะฐัˆ ัะตั€ะฒะตั€ ะฒัั‘ ั€ะฐะฒะฝะพ ะฒั‹ะฝัƒะถะดะตะฝ ะถะดะฐั‚ัŒ ๐Ÿ•™ ะทะฐะฟั€ะพัั‹ ะฟะพ ะธั… ัะปะฐะฑะพะผัƒ ะธะฝั‚ะตั€ะฝะตั‚-ัะพะตะดะธะฝะตะฝะธัŽ. +ะŸะพะปัŒะทะพะฒะฐั‚ะตะปะตะน ะพั‡ะตะฝัŒ ะผะฝะพะณะพ, ะฝะพ ะฒะฐัˆ ัะตั€ะฒะตั€ ะฒัั‘ ั€ะฐะฒะฝะพ ะฒั‹ะฝัƒะถะดะตะฝ ะถะดะฐั‚ัŒ ๐Ÿ•™ ะทะฐะฟั€ะพัั‹ ะฟะพ ะธั… ัะปะฐะฑะพะผัƒ ะธะฝั‚ะตั€ะฝะตั‚-ัะพะตะดะธะฝะตะฝะธัŽ. ะŸะพั‚ะพะผ ัะฝะพะฒะฐ ะถะดะฐั‚ัŒ ๐Ÿ•™, ะฟะพะบะฐ ะฒะตั€ะฝั‘ั‚ัั ะพั‚ะฒะตั‚. @@ -379,7 +379,7 @@ async def read_burgers(): burgers = await get_burgers(2) return burgers ``` - + ### ะขะตั…ะฝะธั‡ะตัะบะธะต ะฟะพะดั€ะพะฑะฝะพัั‚ะธ ะšะฐะบ ะฒั‹ ะผะพะณะปะธ ะทะฐะผะตั‚ะธั‚ัŒ, `await` ะผะพะถะตั‚ ะฟั€ะธะผะตะฝัั‚ัŒัั ั‚ะพะปัŒะบะพ ะฒ ั„ัƒะฝะบั†ะธัั…, ะพะฑัŠัะฒะปะตะฝะฝั‹ั… ั ะธัะฟะพะปัŒะทะพะฒะฐะฝะธะตะผ `async def`. diff --git a/docs/ru/docs/index.md b/docs/ru/docs/index.md index c0a958c3d..a1d302276 100644 --- a/docs/ru/docs/index.md +++ b/docs/ru/docs/index.md @@ -321,7 +321,7 @@ And now, go to ั‚ะธะฟ ะฟะตั€ะตะผะตะฝะฝะพะน. diff --git a/docs/sq/docs/index.md b/docs/sq/docs/index.md index a7af14781..0bb7b55e3 100644 --- a/docs/sq/docs/index.md +++ b/docs/sq/docs/index.md @@ -321,7 +321,7 @@ And now, go to OpenAPI buna path operasyonlarฤฑ parametreleri, body talebi, gรผvenlik gibi ลŸeyler dahil olmak รผzere deklare bunlarฤฑn deklare edilmesi. +* API oluลŸturma iลŸlemlerinde OpenAPI buna path operasyonlarฤฑ parametreleri, body talebi, gรผvenlik gibi ลŸeyler dahil olmak รผzere deklare bunlarฤฑn deklare edilmesi. * Otomatik olarak data modelinin JSON Schema ile beraber dokรผmante edilmesi (OpenAPI'n kendisi zaten JSON Schema'ya dayanฤฑyor). * Titiz bir รงalฤฑลŸmanฤฑn sonucunda yukarฤฑdaki standartlara uygun bir framework oluลŸturduk. Standartlarฤฑ pastanฤฑn รผzerine sonradan eklenmiลŸ bir รงilek olarak gรถrmedik. * Ayrฤฑca bu bir รงok dilde kullanฤฑlabilecek **client code generator** kullanฤฑmฤฑna da izin veriyor. @@ -74,7 +74,7 @@ my_second_user: User = User(**second_user_data) ### Editor desteฤŸi -Bรผtรผn framework kullanฤฑlmasฤฑ kolay ve sezgileri gรผรงlรผ olmasฤฑ iรงin tasarlandฤฑ, verilen bรผtรผn kararlar geliลŸtiricilere en iyi geliลŸtirme deneyimini yaลŸatmak รผzere, bir รงok editรถr รผzerinde test edildi. +Bรผtรผn framework kullanฤฑlmasฤฑ kolay ve sezgileri gรผรงlรผ olmasฤฑ iรงin tasarlandฤฑ, verilen bรผtรผn kararlar geliลŸtiricilere en iyi geliลŸtirme deneyimini yaลŸatmak รผzere, bir รงok editรถr รผzerinde test edildi. Son yapฤฑlan Python geliลŸtiricileri anketinde, aรงฤฑk ara en รงok kullanฤฑlan รถzellik "oto-tamamlama" idi.. @@ -135,7 +135,7 @@ Bรผtรผn gรผvenlik ลŸemalarฤฑ OpenAPI'da tanฤฑmlanmฤฑลŸ durumda, kapsadฤฑklarฤฑ: Bรผtรผn gรผvenlik รถzellikleri Starlette'den geliyor (**session cookies'de** dahil olmak รผzere). -Bรผtรผn hepsi tekrardan kullanฤฑlabilir aletler ve bileลŸenler olarak, kolayca sistemlerinize, data depolarฤฑnฤฑza, iliลŸkisel ve NoSQL databaselerinize entegre edebileceฤŸiniz ลŸekilde yapฤฑldฤฑ. +Bรผtรผn hepsi tekrardan kullanฤฑlabilir aletler ve bileลŸenler olarak, kolayca sistemlerinize, data depolarฤฑnฤฑza, iliลŸkisel ve NoSQL databaselerinize entegre edebileceฤŸiniz ลŸekilde yapฤฑldฤฑ. ### Dependency injection @@ -206,4 +206,3 @@ Aynฤฑ ลŸekilde, databaseden gelen objeyi de **direkt olarak isteฤŸe** de tamamiy * **GeniลŸletilebilir**: * Pydantic รถzelleลŸtirilmiลŸ data tiplerinin tanฤฑmlanmasฤฑnฤฑn yapฤฑlmasฤฑna izin veriyor ayrฤฑca validator decoratorรผ ile senin doฤŸrulamalarฤฑ geniลŸletip, kendi doฤŸrulayฤฑcฤฑlarฤฑnฤฑ yazmana izin veriyor. * 100% test kapsayฤฑcฤฑlฤฑฤŸฤฑ. - diff --git a/docs/tr/docs/index.md b/docs/tr/docs/index.md index 19f46fb4c..3195cd440 100644 --- a/docs/tr/docs/index.md +++ b/docs/tr/docs/index.md @@ -28,7 +28,7 @@ --- -FastAPI, Python 3.6+'nฤฑn standart type hintlerine dayanan modern ve hฤฑzlฤฑ (yรผksek performanslฤฑ) API'lar oluลŸturmak iรงin kullanฤฑlabilecek web framework'รผ. +FastAPI, Python 3.6+'nฤฑn standart type hintlerine dayanan modern ve hฤฑzlฤฑ (yรผksek performanslฤฑ) API'lar oluลŸturmak iรงin kullanฤฑlabilecek web framework'รผ. Ana รถzellikleri: @@ -315,7 +315,7 @@ Server otomatik olarak yeniden baลŸlamalฤฑ (รงรผnkรผ yukarฤฑda `uvicorn`'u รงal ![Swagger UI interaction](https://fastapi.tiangolo.com/img/index/index-04-swagger-03.png) -* ลžimdi "Execute" butonuna tฤฑkla, kullanฤฑcฤฑ arayรผzรผ otomatik olarak API'ฤฑn ile baฤŸlantฤฑ kurarak ona bu parametreleri gรถnderecek ve sonucu karลŸฤฑna getirecek. +* ลžimdi "Execute" butonuna tฤฑkla, kullanฤฑcฤฑ arayรผzรผ otomatik olarak API'ฤฑn ile baฤŸlantฤฑ kurarak ona bu parametreleri gรถnderecek ve sonucu karลŸฤฑna getirecek. ![Swagger UI interaction](https://fastapi.tiangolo.com/img/index/index-05-swagger-04.png) @@ -329,7 +329,7 @@ Server otomatik olarak yeniden baลŸlamalฤฑ (รงรผnkรผ yukarฤฑda `uvicorn`'u รงal ### ร–zet -ร–zetleyecek olursak, URL, sorgu veya request body'deki parametrelerini fonksiyon parametresi olarak kullanฤฑyorsun. Bu parametrelerin veri tiplerini bir kere belirtmen yeterli. +ร–zetleyecek olursak, URL, sorgu veya request body'deki parametrelerini fonksiyon parametresi olarak kullanฤฑyorsun. Bu parametrelerin veri tiplerini bir kere belirtmen yeterli. Type-hinting iลŸlemini Python dilindeki standart veri tipleri ile yapabilirsin @@ -381,14 +381,14 @@ Az รถnceki kod รถrneฤŸine geri dรถnelim, **FastAPI**'ฤฑn yapacaklarฤฑna bir bak * `item_id`'nin `GET` ve `PUT` talepleri iรงinde olup olmadฤฑฤŸฤฑnฤฑn doฤŸruluฤŸunu kontol edecek. * `item_id`'nin tipinin `int` olduฤŸunu `GET` ve `PUT` talepleri iรงinde olup olmadฤฑฤŸฤฑnฤฑn doฤŸruluฤŸunu kontol edecek. - * EฤŸer `GET` ve `PUT` iรงinde yok ise ve `int` deฤŸil ise, sebebini belirten bir hata mesajฤฑ gรถsterecek + * EฤŸer `GET` ve `PUT` iรงinde yok ise ve `int` deฤŸil ise, sebebini belirten bir hata mesajฤฑ gรถsterecek * Opsiyonel bir `q` parametresinin `GET` talebi iรงin (`http://127.0.0.1:8000/items/foo?q=somequery` iรงinde) olup olmadฤฑฤŸฤฑnฤฑ kontrol edecek * `q` parametresini `= None` ile oluลŸturduฤŸumuz iรงin, opsiyonel bir parametre olacak. * EฤŸer `None` olmasa zorunlu bir parametre olacak idi (bu yรผzden body'de `PUT` parametresi var). * `PUT` talebi iรงin `/items/{item_id}`'nin body'sini, JSON olarak okuyor: - * `name` adฤฑnda bir parametetre olup olmadฤฑฤŸฤฑnฤฑ ve var ise onun `str` olup olmadฤฑฤŸฤฑnฤฑ kontol ediyor. - * `price` adฤฑnda bir parametetre olup olmadฤฑฤŸฤฑnฤฑ ve var ise onun `float` olup olmadฤฑฤŸฤฑnฤฑ kontol ediyor. - * `is_offer` adฤฑnda bir parametetre olup olmadฤฑฤŸฤฑnฤฑ ve var ise onun `bool` olup olmadฤฑฤŸฤฑnฤฑ kontol ediyor. + * `name` adฤฑnda bir parametetre olup olmadฤฑฤŸฤฑnฤฑ ve var ise onun `str` olup olmadฤฑฤŸฤฑnฤฑ kontol ediyor. + * `price` adฤฑnda bir parametetre olup olmadฤฑฤŸฤฑnฤฑ ve var ise onun `float` olup olmadฤฑฤŸฤฑnฤฑ kontol ediyor. + * `is_offer` adฤฑnda bir parametetre olup olmadฤฑฤŸฤฑnฤฑ ve var ise onun `bool` olup olmadฤฑฤŸฤฑnฤฑ kontol ediyor. * Bunlarฤฑn hepsini en derin JSON modellerinde bile yapacaktฤฑr. * Bรผtรผn veri tiplerini otomatik olarak JSON'a รงeviriyor veya tam tersi. * Her ลŸeyi dokรผmanlayฤฑp, รงeลŸitli yerlerde: diff --git a/docs/tr/docs/python-types.md b/docs/tr/docs/python-types.md index 7e46bd031..3b9ab9050 100644 --- a/docs/tr/docs/python-types.md +++ b/docs/tr/docs/python-types.md @@ -29,7 +29,7 @@ Programฤฑn รงฤฑktฤฑsฤฑ: John Doe ``` -Fonksiyon sฤฑrayla ลŸunlarฤฑ yapar: +Fonksiyon sฤฑrayla ลŸunlarฤฑ yapar: * `first_name` ve `last_name` deฤŸerlerini alฤฑr. * `title()` ile deฤŸiลŸkenlerin ilk karakterlerini bรผyรผtรผr. diff --git a/docs/uk/docs/index.md b/docs/uk/docs/index.md index a7af14781..0bb7b55e3 100644 --- a/docs/uk/docs/index.md +++ b/docs/uk/docs/index.md @@ -321,7 +321,7 @@ And now, go to -่ฏฅๅ‘ฝไปค็”Ÿๆˆไบ†ไธ€ไธช `./htmlcov/` ็›ฎๅฝ•๏ผŒๅฆ‚ๆžœไฝ ๅœจๆต่งˆๅ™จไธญๆ‰“ๅผ€ `./htmlcov/index.html` ๆ–‡ไปถ๏ผŒไฝ ๅฏไปฅไบคไบ’ๅผๅœฐๆต่งˆ่ขซๆต‹่ฏ•ๆ‰€่ฆ†็›–็š„ไปฃ็ ๅŒบๅ—๏ผŒๅนถๆณจๆ„ๆ˜ฏๅฆ็ผบๅฐ‘ไบ†ไปปไฝ•ๅŒบๅ—ใ€‚ +่ฏฅๅ‘ฝไปค็”Ÿๆˆไบ†ไธ€ไธช `./htmlcov/` ็›ฎๅฝ•๏ผŒๅฆ‚ๆžœไฝ ๅœจๆต่งˆๅ™จไธญๆ‰“ๅผ€ `./htmlcov/index.html` ๆ–‡ไปถ๏ผŒไฝ ๅฏไปฅไบคไบ’ๅผๅœฐๆต่งˆ่ขซๆต‹่ฏ•ๆ‰€่ฆ†็›–็š„ไปฃ็ ๅŒบๅ—๏ผŒๅนถๆณจๆ„ๆ˜ฏๅฆ็ผบๅฐ‘ไบ†ไปปไฝ•ๅŒบๅ—ใ€‚ diff --git a/docs/zh/docs/features.md b/docs/zh/docs/features.md index 2d5ba2982..fefe4b197 100644 --- a/docs/zh/docs/features.md +++ b/docs/zh/docs/features.md @@ -193,7 +193,7 @@ FastAPI ๆœ‰ไธ€ไธชไฝฟ็”จ้žๅธธ็ฎ€ๅ•๏ผŒไฝ†ๆ˜ฏ้žๅธธๅผบๅคง็š„`Enum`. diff --git a/docs_src/path_params/tutorial003b.py b/docs_src/path_params/tutorial003b.py new file mode 100644 index 000000000..822d37369 --- /dev/null +++ b/docs_src/path_params/tutorial003b.py @@ -0,0 +1,13 @@ +from fastapi import FastAPI + +app = FastAPI() + + +@app.get("/users") +async def read_users(): + return ["Rick", "Morty"] + + +@app.get("/users") +async def read_users2(): + return ["Bean", "Elfo"] From 16f1d073db0a8672f85769227f47b47c22d156e0 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 12 May 2022 16:16:56 +0000 Subject: [PATCH 102/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index b438112e2..2e596e03b 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐Ÿ“ Add documentation for redefined path operations. PR [#4864](https://github.com/tiangolo/fastapi/pull/4864) by [@madkinsz](https://github.com/madkinsz). * ๐Ÿ”ฅ Remove un-used old pending tests, already covered in other places. PR [#4891](https://github.com/tiangolo/fastapi/pull/4891) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ”ง Add Python formatting hooks to pre-commit. PR [#4890](https://github.com/tiangolo/fastapi/pull/4890) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ”ง Add pre-commit with first config and first formatting pass. PR [#4888](https://github.com/tiangolo/fastapi/pull/4888) by [@tiangolo](https://github.com/tiangolo). From 29df6b3e830ba3f8f1e57f85e26860445534db68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Thu, 12 May 2022 11:42:47 -0500 Subject: [PATCH 103/168] =?UTF-8?q?=F0=9F=91=B7=20Add=20pre-commit=20GitHu?= =?UTF-8?q?b=20Action=20workflow=20(#4895)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: pre-commit --- .github/workflows/autoformat.yml | 43 ++++++++++++++++++++++++ docs/en/docs/img/sponsors/testdriven.svg | 2 +- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/autoformat.yml diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml new file mode 100644 index 000000000..2bd58008d --- /dev/null +++ b/.github/workflows/autoformat.yml @@ -0,0 +1,43 @@ +name: Auto Format + +on: + pull_request: + types: [opened, synchronize] + +jobs: + autoformat: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + ref: ${{ github.head_ref }} + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.10' + - uses: actions/cache@v2 + id: cache + with: + path: ${{ env.pythonLocation }} + key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-v01 + - name: Install Flit + if: steps.cache.outputs.cache-hit != 'true' + run: pip install flit + - name: Install Dependencies + if: steps.cache.outputs.cache-hit != 'true' + run: flit install --symlink + - uses: actions/cache@v2 + id: pre-commit-hooks-cache + with: + path: ~/.cache/pre-commit + key: ${{ runner.os }}-pre-commit-hooks-${{ hashFiles('.pre-commit-config.yaml') }}-v01 + - name: Run pre-commit + run: pre-commit run --all-files + - name: Commit pre-commit changes + if: failure() + run: | + git config --global user.name "pre-commit" + git config --global user.email github-actions@github.com + git add --update + git commit -m "๐ŸŽจ Format code with pre-commit" + git push diff --git a/docs/en/docs/img/sponsors/testdriven.svg b/docs/en/docs/img/sponsors/testdriven.svg index 97741b9e0..6ba2daa3b 100644 --- a/docs/en/docs/img/sponsors/testdriven.svg +++ b/docs/en/docs/img/sponsors/testdriven.svg @@ -1 +1 @@ - \ No newline at end of file + From bcabbf8b37db3fbc020560e94ad2f90e64d1510a Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 12 May 2022 16:43:22 +0000 Subject: [PATCH 104/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 2e596e03b..681d7f183 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐Ÿ‘ท Add pre-commit GitHub Action workflow. PR [#4895](https://github.com/tiangolo/fastapi/pull/4895) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ“ Add documentation for redefined path operations. PR [#4864](https://github.com/tiangolo/fastapi/pull/4864) by [@madkinsz](https://github.com/madkinsz). * ๐Ÿ”ฅ Remove un-used old pending tests, already covered in other places. PR [#4891](https://github.com/tiangolo/fastapi/pull/4891) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ”ง Add Python formatting hooks to pre-commit. PR [#4890](https://github.com/tiangolo/fastapi/pull/4890) by [@tiangolo](https://github.com/tiangolo). From f204e8010a190ac28149c969f496acfc548895ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Thu, 12 May 2022 12:15:13 -0500 Subject: [PATCH 105/168] =?UTF-8?q?=F0=9F=91=B7=20Add=20pre-commit=20CI=20?= =?UTF-8?q?instead=20of=20custom=20GitHub=20Action=20(#4896)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/autoformat.yml | 43 -------------------------------- .pre-commit-config.yaml | 3 +++ 2 files changed, 3 insertions(+), 43 deletions(-) delete mode 100644 .github/workflows/autoformat.yml diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml deleted file mode 100644 index 2bd58008d..000000000 --- a/.github/workflows/autoformat.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Auto Format - -on: - pull_request: - types: [opened, synchronize] - -jobs: - autoformat: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - ref: ${{ github.head_ref }} - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.10' - - uses: actions/cache@v2 - id: cache - with: - path: ${{ env.pythonLocation }} - key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-v01 - - name: Install Flit - if: steps.cache.outputs.cache-hit != 'true' - run: pip install flit - - name: Install Dependencies - if: steps.cache.outputs.cache-hit != 'true' - run: flit install --symlink - - uses: actions/cache@v2 - id: pre-commit-hooks-cache - with: - path: ~/.cache/pre-commit - key: ${{ runner.os }}-pre-commit-hooks-${{ hashFiles('.pre-commit-config.yaml') }}-v01 - - name: Run pre-commit - run: pre-commit run --all-files - - name: Commit pre-commit changes - if: failure() - run: | - git config --global user.name "pre-commit" - git config --global user.email github-actions@github.com - git add --update - git commit -m "๐ŸŽจ Format code with pre-commit" - git push diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f6a0b251c..5c278571e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -46,3 +46,6 @@ repos: rev: 22.3.0 hooks: - id: black +ci: + autofix_commit_msg: ๐ŸŽจ [pre-commit.ci] Auto format from pre-commit.com hooks + autoupdate_commit_msg: โฌ† [pre-commit.ci] pre-commit autoupdate From d75c69e01f010642b45b723177dd7c5ebf973f46 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 12 May 2022 17:15:56 +0000 Subject: [PATCH 106/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 681d7f183..5efa5b818 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐Ÿ‘ท Add pre-commit CI instead of custom GitHub Action. PR [#4896](https://github.com/tiangolo/fastapi/pull/4896) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ‘ท Add pre-commit GitHub Action workflow. PR [#4895](https://github.com/tiangolo/fastapi/pull/4895) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ“ Add documentation for redefined path operations. PR [#4864](https://github.com/tiangolo/fastapi/pull/4864) by [@madkinsz](https://github.com/madkinsz). * ๐Ÿ”ฅ Remove un-used old pending tests, already covered in other places. PR [#4891](https://github.com/tiangolo/fastapi/pull/4891) by [@tiangolo](https://github.com/tiangolo). From f31ad41dda3e01c9f65b5454c17fc30918d2079b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Thu, 12 May 2022 13:10:57 -0500 Subject: [PATCH 107/168] =?UTF-8?q?=F0=9F=91=B7=20Fix=20installing=20Mater?= =?UTF-8?q?ial=20for=20MkDocs=20Insiders=20in=20CI=20(#4897)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index bdef6ea8a..505d66f9f 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -22,7 +22,7 @@ jobs: id: cache with: path: ${{ env.pythonLocation }} - key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-docs-v2 + key: ${{ runner.os }}-python-docs-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-v03 - name: Install Flit if: steps.cache.outputs.cache-hit != 'true' run: python3.7 -m pip install flit @@ -30,7 +30,7 @@ jobs: if: steps.cache.outputs.cache-hit != 'true' run: python3.7 -m flit install --deps production --extras doc - name: Install Material for MkDocs Insiders - if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false && steps.cache.outputs.cache-hit != 'true' + if: ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false ) && steps.cache.outputs.cache-hit != 'true' run: pip install git+https://${{ secrets.ACTIONS_TOKEN }}@github.com/squidfunk/mkdocs-material-insiders.git - name: Build Docs run: python3.7 ./scripts/docs.py build-all From 497e5a2422f672daec7e8f4b4ee42b6e8bfd2df0 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 12 May 2022 18:11:39 +0000 Subject: [PATCH 108/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 5efa5b818..71c0be532 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐Ÿ‘ท Fix installing Material for MkDocs Insiders in CI. PR [#4897](https://github.com/tiangolo/fastapi/pull/4897) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ‘ท Add pre-commit CI instead of custom GitHub Action. PR [#4896](https://github.com/tiangolo/fastapi/pull/4896) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ‘ท Add pre-commit GitHub Action workflow. PR [#4895](https://github.com/tiangolo/fastapi/pull/4895) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ“ Add documentation for redefined path operations. PR [#4864](https://github.com/tiangolo/fastapi/pull/4864) by [@madkinsz](https://github.com/madkinsz). From 82775f7cd01f93ca10ed7dcf0081d5c746e62068 Mon Sep 17 00:00:00 2001 From: Shahriyar Rzayev Date: Fri, 13 May 2022 00:38:30 +0400 Subject: [PATCH 109/168] =?UTF-8?q?=E2=99=BB=20Refactor=20dict=20value=20e?= =?UTF-8?q?xtraction=20to=20minimize=20key=20lookups=20`fastapi/utils.py`?= =?UTF-8?q?=20(#3139)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastiรกn Ramรญrez --- fastapi/utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fastapi/utils.py b/fastapi/utils.py index b9301499a..9d720feb3 100644 --- a/fastapi/utils.py +++ b/fastapi/utils.py @@ -147,15 +147,15 @@ def generate_unique_id(route: "APIRoute") -> str: def deep_dict_update(main_dict: Dict[Any, Any], update_dict: Dict[Any, Any]) -> None: - for key in update_dict: + for key, value in update_dict.items(): if ( key in main_dict and isinstance(main_dict[key], dict) - and isinstance(update_dict[key], dict) + and isinstance(value, dict) ): - deep_dict_update(main_dict[key], update_dict[key]) + deep_dict_update(main_dict[key], value) else: - main_dict[key] = update_dict[key] + main_dict[key] = value def get_value_or_default( From 975d859ac49e72b7346c52e3660f08de55c20e60 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 12 May 2022 20:39:14 +0000 Subject: [PATCH 110/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 71c0be532..4ad301c6a 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* โ™ป Refactor dict value extraction to minimize key lookups `fastapi/utils.py`. PR [#3139](https://github.com/tiangolo/fastapi/pull/3139) by [@ShahriyarR](https://github.com/ShahriyarR). * ๐Ÿ‘ท Fix installing Material for MkDocs Insiders in CI. PR [#4897](https://github.com/tiangolo/fastapi/pull/4897) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ‘ท Add pre-commit CI instead of custom GitHub Action. PR [#4896](https://github.com/tiangolo/fastapi/pull/4896) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ‘ท Add pre-commit GitHub Action workflow. PR [#4895](https://github.com/tiangolo/fastapi/pull/4895) by [@tiangolo](https://github.com/tiangolo). From 8b66b9ca3ef8b1cdb0ca2089781a04fe0e021c65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Thu, 12 May 2022 15:47:31 -0500 Subject: [PATCH 111/168] =?UTF-8?q?=F0=9F=8E=A8=20Fix=20default=20value=20?= =?UTF-8?q?as=20set=20in=20tutorial=20for=20Path=20Operations=20Advanced?= =?UTF-8?q?=20Configurations=20(#4899)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs_src/path_operation_advanced_configuration/tutorial004.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs_src/path_operation_advanced_configuration/tutorial004.py b/docs_src/path_operation_advanced_configuration/tutorial004.py index fa867e794..da678aed3 100644 --- a/docs_src/path_operation_advanced_configuration/tutorial004.py +++ b/docs_src/path_operation_advanced_configuration/tutorial004.py @@ -11,7 +11,7 @@ class Item(BaseModel): description: Optional[str] = None price: float tax: Optional[float] = None - tags: Set[str] = [] + tags: Set[str] = set() @app.post("/items/", response_model=Item, summary="Create an item") From 31690dda2c1e8557fe96bc30b7d8a170ff4a90a5 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 12 May 2022 20:48:12 +0000 Subject: [PATCH 112/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 4ad301c6a..5c73818fe 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐ŸŽจ Fix default value as set in tutorial for Path Operations Advanced Configurations. PR [#4899](https://github.com/tiangolo/fastapi/pull/4899) by [@tiangolo](https://github.com/tiangolo). * โ™ป Refactor dict value extraction to minimize key lookups `fastapi/utils.py`. PR [#3139](https://github.com/tiangolo/fastapi/pull/3139) by [@ShahriyarR](https://github.com/ShahriyarR). * ๐Ÿ‘ท Fix installing Material for MkDocs Insiders in CI. PR [#4897](https://github.com/tiangolo/fastapi/pull/4897) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ‘ท Add pre-commit CI instead of custom GitHub Action. PR [#4896](https://github.com/tiangolo/fastapi/pull/4896) by [@tiangolo](https://github.com/tiangolo). From 9262fa836283a3fcd05ba7f7fb6f3aa14b377f49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Fri, 13 May 2022 18:38:22 -0500 Subject: [PATCH 113/168] =?UTF-8?q?=E2=9C=A8=20Add=20support=20for=20not?= =?UTF-8?q?=20needing=20`...`=20as=20default=20value=20in=20required=20Que?= =?UTF-8?q?ry(),=20Path(),=20Header(),=20etc.=20(#4906)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * โœจ Do not require default value in Query(), Path(), Header(), etc * ๐Ÿ“ Update source examples for docs with default and required values * โœ… Update tests with new default values and not required Ellipsis * ๐Ÿ“ Update docs for Query params and update info about default value, required, Ellipsis --- .../tutorial/query-params-str-validations.md | 78 ++++++++++++++----- .../additional_status_codes/tutorial001.py | 6 +- docs_src/app_testing/app_b/main.py | 8 +- docs_src/app_testing/app_b_py310/main.py | 4 +- .../bigger_applications/app/dependencies.py | 2 +- docs_src/body_fields/tutorial001.py | 12 +-- docs_src/body_fields/tutorial001_py310.py | 6 +- docs_src/body_multiple_params/tutorial001.py | 12 +-- .../body_multiple_params/tutorial001_py310.py | 2 +- docs_src/body_multiple_params/tutorial003.py | 12 ++- .../body_multiple_params/tutorial003_py310.py | 4 +- docs_src/body_multiple_params/tutorial004.py | 12 +-- .../body_multiple_params/tutorial004_py310.py | 2 +- docs_src/body_multiple_params/tutorial005.py | 8 +- .../body_multiple_params/tutorial005_py310.py | 2 +- docs_src/cookie_params/tutorial001.py | 4 +- docs_src/cookie_params/tutorial001_py310.py | 2 +- .../custom_request_and_route/tutorial001.py | 2 +- .../custom_request_and_route/tutorial002.py | 2 +- docs_src/dependencies/tutorial005.py | 2 +- docs_src/dependencies/tutorial005_py310.py | 2 +- docs_src/dependencies/tutorial006.py | 4 +- docs_src/dependencies/tutorial012.py | 4 +- docs_src/extra_data_types/tutorial001.py | 8 +- .../extra_data_types/tutorial001_py310.py | 8 +- docs_src/header_params/tutorial001.py | 2 +- docs_src/header_params/tutorial001_py310.py | 2 +- docs_src/header_params/tutorial002.py | 2 +- docs_src/header_params/tutorial002_py310.py | 2 +- docs_src/header_params/tutorial003.py | 2 +- docs_src/header_params/tutorial003_py310.py | 2 +- docs_src/header_params/tutorial003_py39.py | 2 +- .../tutorial001.py | 6 +- .../tutorial001_py310.py | 4 +- .../tutorial002.py | 4 +- .../tutorial003.py | 4 +- .../tutorial004.py | 2 +- .../tutorial005.py | 2 +- .../tutorial006.py | 4 +- .../tutorial002.py | 4 +- .../tutorial002_py310.py | 2 +- .../tutorial003.py | 6 +- .../tutorial003_py310.py | 2 +- .../tutorial004.py | 6 +- .../tutorial004_py310.py | 3 +- .../tutorial005.py | 2 +- .../tutorial006.py | 2 +- .../tutorial006b.py | 11 +++ .../tutorial006c.py | 13 ++++ .../tutorial006c_py310.py | 11 +++ .../tutorial006d.py | 12 +++ .../tutorial007.py | 4 +- .../tutorial007_py310.py | 4 +- .../tutorial008.py | 6 +- .../tutorial008_py310.py | 2 +- .../tutorial009.py | 4 +- .../tutorial009_py310.py | 2 +- .../tutorial010.py | 6 +- .../tutorial010_py310.py | 2 +- .../tutorial011.py | 4 +- .../tutorial011_py310.py | 2 +- .../tutorial011_py39.py | 4 +- .../tutorial012.py | 2 +- .../tutorial012_py39.py | 2 +- .../tutorial013.py | 2 +- .../tutorial014.py | 4 +- .../tutorial014_py310.py | 4 +- docs_src/request_files/tutorial001.py | 2 +- docs_src/request_files/tutorial001_02.py | 2 +- .../request_files/tutorial001_02_py310.py | 2 +- docs_src/request_files/tutorial001_03.py | 4 +- docs_src/request_files/tutorial002.py | 2 +- docs_src/request_files/tutorial002_py39.py | 2 +- docs_src/request_files/tutorial003.py | 4 +- docs_src/request_files/tutorial003_py39.py | 4 +- docs_src/request_forms/tutorial001.py | 2 +- .../request_forms_and_files/tutorial001.py | 2 +- docs_src/schema_extra_example/tutorial002.py | 8 +- .../schema_extra_example/tutorial002_py310.py | 8 +- docs_src/schema_extra_example/tutorial003.py | 1 - .../schema_extra_example/tutorial003_py310.py | 1 - docs_src/schema_extra_example/tutorial004.py | 1 - .../schema_extra_example/tutorial004_py310.py | 1 - docs_src/websockets/tutorial002.py | 4 +- fastapi/dependencies/utils.py | 17 ++-- fastapi/openapi/models.py | 30 +++---- fastapi/param_functions.py | 26 +++---- fastapi/params.py | 28 +++---- fastapi/security/oauth2.py | 24 +++--- fastapi/utils.py | 2 +- tests/main.py | 44 +++++------ tests/test_dependency_normal_exceptions.py | 4 +- tests/test_forms_from_non_typing_sequences.py | 6 +- tests/test_invalid_sequence_param.py | 8 +- tests/test_jsonable_encoder.py | 2 +- tests/test_modules_same_name_body/app/a.py | 2 +- tests/test_modules_same_name_body/app/b.py | 2 +- tests/test_multi_query_errors.py | 2 +- tests/test_multipart_installation.py | 20 ++--- tests/test_param_class.py | 2 +- tests/test_param_include_in_schema.py | 8 +- tests/test_repeated_dependency_schema.py | 2 +- ...test_request_body_parameters_media_type.py | 6 +- tests/test_schema_extra_examples.py | 47 ++++++----- tests/test_serialize_response_model.py | 2 +- tests/test_starlette_urlconvertors.py | 6 +- tests/test_tuples.py | 2 +- 107 files changed, 404 insertions(+), 314 deletions(-) create mode 100644 docs_src/query_params_str_validations/tutorial006b.py create mode 100644 docs_src/query_params_str_validations/tutorial006c.py create mode 100644 docs_src/query_params_str_validations/tutorial006c_py310.py create mode 100644 docs_src/query_params_str_validations/tutorial006d.py diff --git a/docs/en/docs/tutorial/query-params-str-validations.md b/docs/en/docs/tutorial/query-params-str-validations.md index ee62b9718..c5fc35b88 100644 --- a/docs/en/docs/tutorial/query-params-str-validations.md +++ b/docs/en/docs/tutorial/query-params-str-validations.md @@ -16,12 +16,12 @@ Let's take this application as example: {!> ../../../docs_src/query_params_str_validations/tutorial001_py310.py!} ``` -The query parameter `q` is of type `Optional[str]` (or `str | None` in Python 3.10), that means that it's of type `str` but could also be `None`, and indeed, the default value is `None`, so FastAPI will know it's not required. +The query parameter `q` is of type `Union[str, None]` (or `str | None` in Python 3.10), that means that it's of type `str` but could also be `None`, and indeed, the default value is `None`, so FastAPI will know it's not required. !!! note FastAPI will know that the value of `q` is not required because of the default value `= None`. - The `Optional` in `Optional[str]` is not used by FastAPI, but will allow your editor to give you better support and detect errors. + The `Union` in `Union[str, None]` will allow your editor to give you better support and detect errors. ## Additional validation @@ -59,24 +59,24 @@ And now use it as the default value of your parameter, setting the parameter `ma {!> ../../../docs_src/query_params_str_validations/tutorial002_py310.py!} ``` -As we have to replace the default value `None` with `Query(None)`, the first parameter to `Query` serves the same purpose of defining that default value. +As we have to replace the default value `None` in the function with `Query()`, we can now set the default value with the parameter `Query(default=None)`, it serves the same purpose of defining that default value. So: ```Python -q: Optional[str] = Query(None) +q: Union[str, None] = Query(default=None) ``` ...makes the parameter optional, the same as: ```Python -q: Optional[str] = None +q: Union[str, None] = None ``` And in Python 3.10 and above: ```Python -q: str | None = Query(None) +q: str | None = Query(default=None) ``` ...makes the parameter optional, the same as: @@ -97,17 +97,17 @@ But it declares it explicitly as being a query parameter. or the: ```Python - = Query(None) + = Query(default=None) ``` as it will use that `None` as the default value, and that way make the parameter **not required**. - The `Optional` part allows your editor to provide better support, but it is not what tells FastAPI that this parameter is not required. + The `Union[str, None]` part allows your editor to provide better support, but it is not what tells FastAPI that this parameter is not required. Then, we can pass more parameters to `Query`. In this case, the `max_length` parameter that applies to strings: ```Python -q: str = Query(None, max_length=50) +q: Union[str, None] = Query(default=None, max_length=50) ``` This will validate the data, show a clear error when the data is not valid, and document the parameter in the OpenAPI schema *path operation*. @@ -118,7 +118,7 @@ You can also add a parameter `min_length`: === "Python 3.6 and above" - ```Python hl_lines="9" + ```Python hl_lines="10" {!> ../../../docs_src/query_params_str_validations/tutorial003.py!} ``` @@ -134,13 +134,13 @@ You can define a ../../../docs_src/query_params_str_validations/tutorial004.py!} ``` === "Python 3.10 and above" - ```Python hl_lines="8" + ```Python hl_lines="9" {!> ../../../docs_src/query_params_str_validations/tutorial004_py310.py!} ``` @@ -156,7 +156,7 @@ But whenever you need them and go and learn them, know that you can already use ## Default values -The same way that you can pass `None` as the first argument to be used as the default value, you can pass other values. +The same way that you can pass `None` as the value for the `default` parameter, you can pass other values. Let's say that you want to declare the `q` query parameter to have a `min_length` of `3`, and to have a default value of `"fixedquery"`: @@ -178,26 +178,68 @@ q: str instead of: ```Python -q: Optional[str] = None +q: Union[str, None] = None ``` But we are now declaring it with `Query`, for example like: ```Python -q: Optional[str] = Query(None, min_length=3) +q: Union[str, None] = Query(default=None, min_length=3) ``` -So, when you need to declare a value as required while using `Query`, you can use `...` as the first argument: +So, when you need to declare a value as required while using `Query`, you can simply not declare a default value: ```Python hl_lines="7" {!../../../docs_src/query_params_str_validations/tutorial006.py!} ``` +### Required with Ellipsis (`...`) + +There's an alternative way to explicitly declare that a value is required. You can set the `default` parameter to the literal value `...`: + +```Python hl_lines="7" +{!../../../docs_src/query_params_str_validations/tutorial006b.py!} +``` + !!! info If you hadn't seen that `...` before: it is a special single value, it is part of Python and is called "Ellipsis". + It is used by Pydantic and FastAPI to explicitly declare that a value is required. + This will let **FastAPI** know that this parameter is required. +### Required with `None` + +You can declare that a parameter can accept `None`, but that it's still required. This would force clients to send a value, even if the value is `None`. + +To do that, you can declare that `None` is a valid type but still use `default=...`: + +=== "Python 3.6 and above" + + ```Python hl_lines="8" + {!> ../../../docs_src/query_params_str_validations/tutorial006c.py!} + ``` + +=== "Python 3.10 and above" + + ```Python hl_lines="7" + {!> ../../../docs_src/query_params_str_validations/tutorial006c_py310.py!} + ``` + +!!! tip + Pydantic, which is what powers all the data validation and serialization in FastAPI, has a special behavior when you use `Optional` or `Union[Something, None]` without a default value, you can read more about it in the Pydantic docs about Required Optional fields. + +### Use Pydantic's `Required` instead of Ellipsis (`...`) + +If you feel uncomfortable using `...`, you can also import and use `Required` from Pydantic: + +```Python hl_lines="2 8" +{!../../../docs_src/query_params_str_validations/tutorial006d.py!} +``` + +!!! tip + Remember that in most of the cases, when something is required, you can simply omit the `default` parameter, so you normally don't have to use `...` nor `Required`. + ## Query parameter list / multiple values When you define a query parameter explicitly with `Query` you can also declare it to receive a list of values, or said in other way, to receive multiple values. @@ -315,7 +357,7 @@ You can add a `title`: === "Python 3.10 and above" - ```Python hl_lines="7" + ```Python hl_lines="8" {!> ../../../docs_src/query_params_str_validations/tutorial007_py310.py!} ``` @@ -399,7 +441,7 @@ To exclude a query parameter from the generated OpenAPI schema (and thus, from t === "Python 3.10 and above" - ```Python hl_lines="7" + ```Python hl_lines="8" {!> ../../../docs_src/query_params_str_validations/tutorial014_py310.py!} ``` diff --git a/docs_src/additional_status_codes/tutorial001.py b/docs_src/additional_status_codes/tutorial001.py index ae101e0a0..74a986a6a 100644 --- a/docs_src/additional_status_codes/tutorial001.py +++ b/docs_src/additional_status_codes/tutorial001.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import Body, FastAPI, status from fastapi.responses import JSONResponse @@ -10,7 +10,9 @@ items = {"foo": {"name": "Fighters", "size": 6}, "bar": {"name": "Tenders", "siz @app.put("/items/{item_id}") async def upsert_item( - item_id: str, name: Optional[str] = Body(None), size: Optional[int] = Body(None) + item_id: str, + name: Union[str, None] = Body(default=None), + size: Union[int, None] = Body(default=None), ): if item_id in items: item = items[item_id] diff --git a/docs_src/app_testing/app_b/main.py b/docs_src/app_testing/app_b/main.py index df43db806..11558b8e8 100644 --- a/docs_src/app_testing/app_b/main.py +++ b/docs_src/app_testing/app_b/main.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI, Header, HTTPException from pydantic import BaseModel @@ -16,11 +16,11 @@ app = FastAPI() class Item(BaseModel): id: str title: str - description: Optional[str] = None + description: Union[str, None] = None @app.get("/items/{item_id}", response_model=Item) -async def read_main(item_id: str, x_token: str = Header(...)): +async def read_main(item_id: str, x_token: str = Header()): if x_token != fake_secret_token: raise HTTPException(status_code=400, detail="Invalid X-Token header") if item_id not in fake_db: @@ -29,7 +29,7 @@ async def read_main(item_id: str, x_token: str = Header(...)): @app.post("/items/", response_model=Item) -async def create_item(item: Item, x_token: str = Header(...)): +async def create_item(item: Item, x_token: str = Header()): if x_token != fake_secret_token: raise HTTPException(status_code=400, detail="Invalid X-Token header") if item.id in fake_db: diff --git a/docs_src/app_testing/app_b_py310/main.py b/docs_src/app_testing/app_b_py310/main.py index d44ab9e7c..b4c72de5c 100644 --- a/docs_src/app_testing/app_b_py310/main.py +++ b/docs_src/app_testing/app_b_py310/main.py @@ -18,7 +18,7 @@ class Item(BaseModel): @app.get("/items/{item_id}", response_model=Item) -async def read_main(item_id: str, x_token: str = Header(...)): +async def read_main(item_id: str, x_token: str = Header()): if x_token != fake_secret_token: raise HTTPException(status_code=400, detail="Invalid X-Token header") if item_id not in fake_db: @@ -27,7 +27,7 @@ async def read_main(item_id: str, x_token: str = Header(...)): @app.post("/items/", response_model=Item) -async def create_item(item: Item, x_token: str = Header(...)): +async def create_item(item: Item, x_token: str = Header()): if x_token != fake_secret_token: raise HTTPException(status_code=400, detail="Invalid X-Token header") if item.id in fake_db: diff --git a/docs_src/bigger_applications/app/dependencies.py b/docs_src/bigger_applications/app/dependencies.py index 267b0d3a8..8e45f004b 100644 --- a/docs_src/bigger_applications/app/dependencies.py +++ b/docs_src/bigger_applications/app/dependencies.py @@ -1,7 +1,7 @@ from fastapi import Header, HTTPException -async def get_token_header(x_token: str = Header(...)): +async def get_token_header(x_token: str = Header()): if x_token != "fake-super-secret-token": raise HTTPException(status_code=400, detail="X-Token header invalid") diff --git a/docs_src/body_fields/tutorial001.py b/docs_src/body_fields/tutorial001.py index dabc48a0f..cbeebd614 100644 --- a/docs_src/body_fields/tutorial001.py +++ b/docs_src/body_fields/tutorial001.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import Body, FastAPI from pydantic import BaseModel, Field @@ -8,14 +8,14 @@ app = FastAPI() class Item(BaseModel): name: str - description: Optional[str] = Field( - None, title="The description of the item", max_length=300 + description: Union[str, None] = Field( + default=None, title="The description of the item", max_length=300 ) - price: float = Field(..., gt=0, description="The price must be greater than zero") - tax: Optional[float] = None + price: float = Field(gt=0, description="The price must be greater than zero") + tax: Union[float, None] = None @app.put("/items/{item_id}") -async def update_item(item_id: int, item: Item = Body(..., embed=True)): +async def update_item(item_id: int, item: Item = Body(embed=True)): results = {"item_id": item_id, "item": item} return results diff --git a/docs_src/body_fields/tutorial001_py310.py b/docs_src/body_fields/tutorial001_py310.py index 01e02a050..4437327f3 100644 --- a/docs_src/body_fields/tutorial001_py310.py +++ b/docs_src/body_fields/tutorial001_py310.py @@ -7,13 +7,13 @@ app = FastAPI() class Item(BaseModel): name: str description: str | None = Field( - None, title="The description of the item", max_length=300 + default=None, title="The description of the item", max_length=300 ) - price: float = Field(..., gt=0, description="The price must be greater than zero") + price: float = Field(gt=0, description="The price must be greater than zero") tax: float | None = None @app.put("/items/{item_id}") -async def update_item(item_id: int, item: Item = Body(..., embed=True)): +async def update_item(item_id: int, item: Item = Body(embed=True)): results = {"item_id": item_id, "item": item} return results diff --git a/docs_src/body_multiple_params/tutorial001.py b/docs_src/body_multiple_params/tutorial001.py index 7ce0ae6f2..a73975b3a 100644 --- a/docs_src/body_multiple_params/tutorial001.py +++ b/docs_src/body_multiple_params/tutorial001.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI, Path from pydantic import BaseModel @@ -8,17 +8,17 @@ app = FastAPI() class Item(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float - tax: Optional[float] = None + tax: Union[float, None] = None @app.put("/items/{item_id}") async def update_item( *, - item_id: int = Path(..., title="The ID of the item to get", ge=0, le=1000), - q: Optional[str] = None, - item: Optional[Item] = None, + item_id: int = Path(title="The ID of the item to get", ge=0, le=1000), + q: Union[str, None] = None, + item: Union[Item, None] = None, ): results = {"item_id": item_id} if q: diff --git a/docs_src/body_multiple_params/tutorial001_py310.py b/docs_src/body_multiple_params/tutorial001_py310.py index b08d397b3..be0eba2ae 100644 --- a/docs_src/body_multiple_params/tutorial001_py310.py +++ b/docs_src/body_multiple_params/tutorial001_py310.py @@ -14,7 +14,7 @@ class Item(BaseModel): @app.put("/items/{item_id}") async def update_item( *, - item_id: int = Path(..., title="The ID of the item to get", ge=0, le=1000), + item_id: int = Path(title="The ID of the item to get", ge=0, le=1000), q: str | None = None, item: Item | None = None, ): diff --git a/docs_src/body_multiple_params/tutorial003.py b/docs_src/body_multiple_params/tutorial003.py index 7e9e24374..cf344e6c5 100644 --- a/docs_src/body_multiple_params/tutorial003.py +++ b/docs_src/body_multiple_params/tutorial003.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import Body, FastAPI from pydantic import BaseModel @@ -8,19 +8,17 @@ app = FastAPI() class Item(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float - tax: Optional[float] = None + tax: Union[float, None] = None class User(BaseModel): username: str - full_name: Optional[str] = None + full_name: Union[str, None] = None @app.put("/items/{item_id}") -async def update_item( - item_id: int, item: Item, user: User, importance: int = Body(...) -): +async def update_item(item_id: int, item: Item, user: User, importance: int = Body()): results = {"item_id": item_id, "item": item, "user": user, "importance": importance} return results diff --git a/docs_src/body_multiple_params/tutorial003_py310.py b/docs_src/body_multiple_params/tutorial003_py310.py index 9ddbda3f7..a1a75fe8e 100644 --- a/docs_src/body_multiple_params/tutorial003_py310.py +++ b/docs_src/body_multiple_params/tutorial003_py310.py @@ -17,8 +17,6 @@ class User(BaseModel): @app.put("/items/{item_id}") -async def update_item( - item_id: int, item: Item, user: User, importance: int = Body(...) -): +async def update_item(item_id: int, item: Item, user: User, importance: int = Body()): results = {"item_id": item_id, "item": item, "user": user, "importance": importance} return results diff --git a/docs_src/body_multiple_params/tutorial004.py b/docs_src/body_multiple_params/tutorial004.py index 8dc0d374d..beea7d1e3 100644 --- a/docs_src/body_multiple_params/tutorial004.py +++ b/docs_src/body_multiple_params/tutorial004.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import Body, FastAPI from pydantic import BaseModel @@ -8,14 +8,14 @@ app = FastAPI() class Item(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float - tax: Optional[float] = None + tax: Union[float, None] = None class User(BaseModel): username: str - full_name: Optional[str] = None + full_name: Union[str, None] = None @app.put("/items/{item_id}") @@ -24,8 +24,8 @@ async def update_item( item_id: int, item: Item, user: User, - importance: int = Body(..., gt=0), - q: Optional[str] = None + importance: int = Body(gt=0), + q: Union[str, None] = None ): results = {"item_id": item_id, "item": item, "user": user, "importance": importance} if q: diff --git a/docs_src/body_multiple_params/tutorial004_py310.py b/docs_src/body_multiple_params/tutorial004_py310.py index 77321300e..6d495d408 100644 --- a/docs_src/body_multiple_params/tutorial004_py310.py +++ b/docs_src/body_multiple_params/tutorial004_py310.py @@ -22,7 +22,7 @@ async def update_item( item_id: int, item: Item, user: User, - importance: int = Body(..., gt=0), + importance: int = Body(gt=0), q: str | None = None ): results = {"item_id": item_id, "item": item, "user": user, "importance": importance} diff --git a/docs_src/body_multiple_params/tutorial005.py b/docs_src/body_multiple_params/tutorial005.py index 4657b4144..29e6e14b7 100644 --- a/docs_src/body_multiple_params/tutorial005.py +++ b/docs_src/body_multiple_params/tutorial005.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import Body, FastAPI from pydantic import BaseModel @@ -8,12 +8,12 @@ app = FastAPI() class Item(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float - tax: Optional[float] = None + tax: Union[float, None] = None @app.put("/items/{item_id}") -async def update_item(item_id: int, item: Item = Body(..., embed=True)): +async def update_item(item_id: int, item: Item = Body(embed=True)): results = {"item_id": item_id, "item": item} return results diff --git a/docs_src/body_multiple_params/tutorial005_py310.py b/docs_src/body_multiple_params/tutorial005_py310.py index 97b213b16..06744507b 100644 --- a/docs_src/body_multiple_params/tutorial005_py310.py +++ b/docs_src/body_multiple_params/tutorial005_py310.py @@ -12,6 +12,6 @@ class Item(BaseModel): @app.put("/items/{item_id}") -async def update_item(item_id: int, item: Item = Body(..., embed=True)): +async def update_item(item_id: int, item: Item = Body(embed=True)): results = {"item_id": item_id, "item": item} return results diff --git a/docs_src/cookie_params/tutorial001.py b/docs_src/cookie_params/tutorial001.py index 67d03b133..c4a497fda 100644 --- a/docs_src/cookie_params/tutorial001.py +++ b/docs_src/cookie_params/tutorial001.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import Cookie, FastAPI @@ -6,5 +6,5 @@ app = FastAPI() @app.get("/items/") -async def read_items(ads_id: Optional[str] = Cookie(None)): +async def read_items(ads_id: Union[str, None] = Cookie(default=None)): return {"ads_id": ads_id} diff --git a/docs_src/cookie_params/tutorial001_py310.py b/docs_src/cookie_params/tutorial001_py310.py index d0b004631..6c9d5f9a1 100644 --- a/docs_src/cookie_params/tutorial001_py310.py +++ b/docs_src/cookie_params/tutorial001_py310.py @@ -4,5 +4,5 @@ app = FastAPI() @app.get("/items/") -async def read_items(ads_id: str | None = Cookie(None)): +async def read_items(ads_id: str | None = Cookie(default=None)): return {"ads_id": ads_id} diff --git a/docs_src/custom_request_and_route/tutorial001.py b/docs_src/custom_request_and_route/tutorial001.py index 2e64ad45d..268ce9019 100644 --- a/docs_src/custom_request_and_route/tutorial001.py +++ b/docs_src/custom_request_and_route/tutorial001.py @@ -31,5 +31,5 @@ app.router.route_class = GzipRoute @app.post("/sum") -async def sum_numbers(numbers: List[int] = Body(...)): +async def sum_numbers(numbers: List[int] = Body()): return {"sum": sum(numbers)} diff --git a/docs_src/custom_request_and_route/tutorial002.py b/docs_src/custom_request_and_route/tutorial002.py index f4c093ac9..cee4a95f0 100644 --- a/docs_src/custom_request_and_route/tutorial002.py +++ b/docs_src/custom_request_and_route/tutorial002.py @@ -25,5 +25,5 @@ app.router.route_class = ValidationErrorLoggingRoute @app.post("/") -async def sum_numbers(numbers: List[int] = Body(...)): +async def sum_numbers(numbers: List[int] = Body()): return sum(numbers) diff --git a/docs_src/dependencies/tutorial005.py b/docs_src/dependencies/tutorial005.py index c8923d143..24f73c617 100644 --- a/docs_src/dependencies/tutorial005.py +++ b/docs_src/dependencies/tutorial005.py @@ -10,7 +10,7 @@ def query_extractor(q: Optional[str] = None): def query_or_cookie_extractor( - q: str = Depends(query_extractor), last_query: Optional[str] = Cookie(None) + q: str = Depends(query_extractor), last_query: Optional[str] = Cookie(default=None) ): if not q: return last_query diff --git a/docs_src/dependencies/tutorial005_py310.py b/docs_src/dependencies/tutorial005_py310.py index 5e1d7e0ef..247cdabe2 100644 --- a/docs_src/dependencies/tutorial005_py310.py +++ b/docs_src/dependencies/tutorial005_py310.py @@ -8,7 +8,7 @@ def query_extractor(q: str | None = None): def query_or_cookie_extractor( - q: str = Depends(query_extractor), last_query: str | None = Cookie(None) + q: str = Depends(query_extractor), last_query: str | None = Cookie(default=None) ): if not q: return last_query diff --git a/docs_src/dependencies/tutorial006.py b/docs_src/dependencies/tutorial006.py index a71d7cce6..9aff4154f 100644 --- a/docs_src/dependencies/tutorial006.py +++ b/docs_src/dependencies/tutorial006.py @@ -3,12 +3,12 @@ from fastapi import Depends, FastAPI, Header, HTTPException app = FastAPI() -async def verify_token(x_token: str = Header(...)): +async def verify_token(x_token: str = Header()): if x_token != "fake-super-secret-token": raise HTTPException(status_code=400, detail="X-Token header invalid") -async def verify_key(x_key: str = Header(...)): +async def verify_key(x_key: str = Header()): if x_key != "fake-super-secret-key": raise HTTPException(status_code=400, detail="X-Key header invalid") return x_key diff --git a/docs_src/dependencies/tutorial012.py b/docs_src/dependencies/tutorial012.py index 8f8868a55..36ce6c711 100644 --- a/docs_src/dependencies/tutorial012.py +++ b/docs_src/dependencies/tutorial012.py @@ -1,12 +1,12 @@ from fastapi import Depends, FastAPI, Header, HTTPException -async def verify_token(x_token: str = Header(...)): +async def verify_token(x_token: str = Header()): if x_token != "fake-super-secret-token": raise HTTPException(status_code=400, detail="X-Token header invalid") -async def verify_key(x_key: str = Header(...)): +async def verify_key(x_key: str = Header()): if x_key != "fake-super-secret-key": raise HTTPException(status_code=400, detail="X-Key header invalid") return x_key diff --git a/docs_src/extra_data_types/tutorial001.py b/docs_src/extra_data_types/tutorial001.py index e8d7e1ea3..9f5e911bf 100644 --- a/docs_src/extra_data_types/tutorial001.py +++ b/docs_src/extra_data_types/tutorial001.py @@ -10,10 +10,10 @@ app = FastAPI() @app.put("/items/{item_id}") async def read_items( item_id: UUID, - start_datetime: Optional[datetime] = Body(None), - end_datetime: Optional[datetime] = Body(None), - repeat_at: Optional[time] = Body(None), - process_after: Optional[timedelta] = Body(None), + start_datetime: Optional[datetime] = Body(default=None), + end_datetime: Optional[datetime] = Body(default=None), + repeat_at: Optional[time] = Body(default=None), + process_after: Optional[timedelta] = Body(default=None), ): start_process = start_datetime + process_after duration = end_datetime - start_process diff --git a/docs_src/extra_data_types/tutorial001_py310.py b/docs_src/extra_data_types/tutorial001_py310.py index 4a33481b7..d22f81888 100644 --- a/docs_src/extra_data_types/tutorial001_py310.py +++ b/docs_src/extra_data_types/tutorial001_py310.py @@ -9,10 +9,10 @@ app = FastAPI() @app.put("/items/{item_id}") async def read_items( item_id: UUID, - start_datetime: datetime | None = Body(None), - end_datetime: datetime | None = Body(None), - repeat_at: time | None = Body(None), - process_after: timedelta | None = Body(None), + start_datetime: datetime | None = Body(default=None), + end_datetime: datetime | None = Body(default=None), + repeat_at: time | None = Body(default=None), + process_after: timedelta | None = Body(default=None), ): start_process = start_datetime + process_after duration = end_datetime - start_process diff --git a/docs_src/header_params/tutorial001.py b/docs_src/header_params/tutorial001.py index 7d69b027e..1df561a12 100644 --- a/docs_src/header_params/tutorial001.py +++ b/docs_src/header_params/tutorial001.py @@ -6,5 +6,5 @@ app = FastAPI() @app.get("/items/") -async def read_items(user_agent: Optional[str] = Header(None)): +async def read_items(user_agent: Optional[str] = Header(default=None)): return {"User-Agent": user_agent} diff --git a/docs_src/header_params/tutorial001_py310.py b/docs_src/header_params/tutorial001_py310.py index b28463346..2203ed1b8 100644 --- a/docs_src/header_params/tutorial001_py310.py +++ b/docs_src/header_params/tutorial001_py310.py @@ -4,5 +4,5 @@ app = FastAPI() @app.get("/items/") -async def read_items(user_agent: str | None = Header(None)): +async def read_items(user_agent: str | None = Header(default=None)): return {"User-Agent": user_agent} diff --git a/docs_src/header_params/tutorial002.py b/docs_src/header_params/tutorial002.py index 2de3dddd7..2250727f6 100644 --- a/docs_src/header_params/tutorial002.py +++ b/docs_src/header_params/tutorial002.py @@ -7,6 +7,6 @@ app = FastAPI() @app.get("/items/") async def read_items( - strange_header: Optional[str] = Header(None, convert_underscores=False) + strange_header: Optional[str] = Header(default=None, convert_underscores=False) ): return {"strange_header": strange_header} diff --git a/docs_src/header_params/tutorial002_py310.py b/docs_src/header_params/tutorial002_py310.py index 98ab5a807..b7979b542 100644 --- a/docs_src/header_params/tutorial002_py310.py +++ b/docs_src/header_params/tutorial002_py310.py @@ -5,6 +5,6 @@ app = FastAPI() @app.get("/items/") async def read_items( - strange_header: str | None = Header(None, convert_underscores=False) + strange_header: str | None = Header(default=None, convert_underscores=False) ): return {"strange_header": strange_header} diff --git a/docs_src/header_params/tutorial003.py b/docs_src/header_params/tutorial003.py index 6d0eefdd2..1ef131cee 100644 --- a/docs_src/header_params/tutorial003.py +++ b/docs_src/header_params/tutorial003.py @@ -6,5 +6,5 @@ app = FastAPI() @app.get("/items/") -async def read_items(x_token: Optional[List[str]] = Header(None)): +async def read_items(x_token: Optional[List[str]] = Header(default=None)): return {"X-Token values": x_token} diff --git a/docs_src/header_params/tutorial003_py310.py b/docs_src/header_params/tutorial003_py310.py index 2dac2c13c..435c67574 100644 --- a/docs_src/header_params/tutorial003_py310.py +++ b/docs_src/header_params/tutorial003_py310.py @@ -4,5 +4,5 @@ app = FastAPI() @app.get("/items/") -async def read_items(x_token: list[str] | None = Header(None)): +async def read_items(x_token: list[str] | None = Header(default=None)): return {"X-Token values": x_token} diff --git a/docs_src/header_params/tutorial003_py39.py b/docs_src/header_params/tutorial003_py39.py index 359766527..78dda58da 100644 --- a/docs_src/header_params/tutorial003_py39.py +++ b/docs_src/header_params/tutorial003_py39.py @@ -6,5 +6,5 @@ app = FastAPI() @app.get("/items/") -async def read_items(x_token: Optional[list[str]] = Header(None)): +async def read_items(x_token: Optional[list[str]] = Header(default=None)): return {"X-Token values": x_token} diff --git a/docs_src/path_params_numeric_validations/tutorial001.py b/docs_src/path_params_numeric_validations/tutorial001.py index 11777bba7..530147028 100644 --- a/docs_src/path_params_numeric_validations/tutorial001.py +++ b/docs_src/path_params_numeric_validations/tutorial001.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI, Path, Query @@ -7,8 +7,8 @@ app = FastAPI() @app.get("/items/{item_id}") async def read_items( - item_id: int = Path(..., title="The ID of the item to get"), - q: Optional[str] = Query(None, alias="item-query"), + item_id: int = Path(title="The ID of the item to get"), + q: Union[str, None] = Query(default=None, alias="item-query"), ): results = {"item_id": item_id} if q: diff --git a/docs_src/path_params_numeric_validations/tutorial001_py310.py b/docs_src/path_params_numeric_validations/tutorial001_py310.py index b940a0949..b1a77cc9d 100644 --- a/docs_src/path_params_numeric_validations/tutorial001_py310.py +++ b/docs_src/path_params_numeric_validations/tutorial001_py310.py @@ -5,8 +5,8 @@ app = FastAPI() @app.get("/items/{item_id}") async def read_items( - item_id: int = Path(..., title="The ID of the item to get"), - q: str | None = Query(None, alias="item-query"), + item_id: int = Path(title="The ID of the item to get"), + q: str | None = Query(default=None, alias="item-query"), ): results = {"item_id": item_id} if q: diff --git a/docs_src/path_params_numeric_validations/tutorial002.py b/docs_src/path_params_numeric_validations/tutorial002.py index 57ca50ece..63ac691a8 100644 --- a/docs_src/path_params_numeric_validations/tutorial002.py +++ b/docs_src/path_params_numeric_validations/tutorial002.py @@ -4,9 +4,7 @@ app = FastAPI() @app.get("/items/{item_id}") -async def read_items( - q: str, item_id: int = Path(..., title="The ID of the item to get") -): +async def read_items(q: str, item_id: int = Path(title="The ID of the item to get")): results = {"item_id": item_id} if q: results.update({"q": q}) diff --git a/docs_src/path_params_numeric_validations/tutorial003.py b/docs_src/path_params_numeric_validations/tutorial003.py index b6b5a1986..8df0ffc62 100644 --- a/docs_src/path_params_numeric_validations/tutorial003.py +++ b/docs_src/path_params_numeric_validations/tutorial003.py @@ -4,9 +4,7 @@ app = FastAPI() @app.get("/items/{item_id}") -async def read_items( - *, item_id: int = Path(..., title="The ID of the item to get"), q: str -): +async def read_items(*, item_id: int = Path(title="The ID of the item to get"), q: str): results = {"item_id": item_id} if q: results.update({"q": q}) diff --git a/docs_src/path_params_numeric_validations/tutorial004.py b/docs_src/path_params_numeric_validations/tutorial004.py index 2ec708280..86651d47c 100644 --- a/docs_src/path_params_numeric_validations/tutorial004.py +++ b/docs_src/path_params_numeric_validations/tutorial004.py @@ -5,7 +5,7 @@ app = FastAPI() @app.get("/items/{item_id}") async def read_items( - *, item_id: int = Path(..., title="The ID of the item to get", ge=1), q: str + *, item_id: int = Path(title="The ID of the item to get", ge=1), q: str ): results = {"item_id": item_id} if q: diff --git a/docs_src/path_params_numeric_validations/tutorial005.py b/docs_src/path_params_numeric_validations/tutorial005.py index 2809f37b2..8f12f2da0 100644 --- a/docs_src/path_params_numeric_validations/tutorial005.py +++ b/docs_src/path_params_numeric_validations/tutorial005.py @@ -6,7 +6,7 @@ app = FastAPI() @app.get("/items/{item_id}") async def read_items( *, - item_id: int = Path(..., title="The ID of the item to get", gt=0, le=1000), + item_id: int = Path(title="The ID of the item to get", gt=0, le=1000), q: str, ): results = {"item_id": item_id} diff --git a/docs_src/path_params_numeric_validations/tutorial006.py b/docs_src/path_params_numeric_validations/tutorial006.py index 0c19579f5..85bd6e8b4 100644 --- a/docs_src/path_params_numeric_validations/tutorial006.py +++ b/docs_src/path_params_numeric_validations/tutorial006.py @@ -6,9 +6,9 @@ app = FastAPI() @app.get("/items/{item_id}") async def read_items( *, - item_id: int = Path(..., title="The ID of the item to get", ge=0, le=1000), + item_id: int = Path(title="The ID of the item to get", ge=0, le=1000), q: str, - size: float = Query(..., gt=0, lt=10.5) + size: float = Query(gt=0, lt=10.5) ): results = {"item_id": item_id} if q: diff --git a/docs_src/query_params_str_validations/tutorial002.py b/docs_src/query_params_str_validations/tutorial002.py index 68ea58206..17e017b7e 100644 --- a/docs_src/query_params_str_validations/tutorial002.py +++ b/docs_src/query_params_str_validations/tutorial002.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI, Query @@ -6,7 +6,7 @@ app = FastAPI() @app.get("/items/") -async def read_items(q: Optional[str] = Query(None, max_length=50)): +async def read_items(q: Union[str, None] = Query(default=None, max_length=50)): results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} if q: results.update({"q": q}) diff --git a/docs_src/query_params_str_validations/tutorial002_py310.py b/docs_src/query_params_str_validations/tutorial002_py310.py index fa3139d5a..f15351d29 100644 --- a/docs_src/query_params_str_validations/tutorial002_py310.py +++ b/docs_src/query_params_str_validations/tutorial002_py310.py @@ -4,7 +4,7 @@ app = FastAPI() @app.get("/items/") -async def read_items(q: str | None = Query(None, max_length=50)): +async def read_items(q: str | None = Query(default=None, max_length=50)): results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} if q: results.update({"q": q}) diff --git a/docs_src/query_params_str_validations/tutorial003.py b/docs_src/query_params_str_validations/tutorial003.py index e52acc72f..73d2e08c8 100644 --- a/docs_src/query_params_str_validations/tutorial003.py +++ b/docs_src/query_params_str_validations/tutorial003.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI, Query @@ -6,7 +6,9 @@ app = FastAPI() @app.get("/items/") -async def read_items(q: Optional[str] = Query(None, min_length=3, max_length=50)): +async def read_items( + q: Union[str, None] = Query(default=None, min_length=3, max_length=50) +): results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} if q: results.update({"q": q}) diff --git a/docs_src/query_params_str_validations/tutorial003_py310.py b/docs_src/query_params_str_validations/tutorial003_py310.py index 335858a40..dc60ecb39 100644 --- a/docs_src/query_params_str_validations/tutorial003_py310.py +++ b/docs_src/query_params_str_validations/tutorial003_py310.py @@ -4,7 +4,7 @@ app = FastAPI() @app.get("/items/") -async def read_items(q: str | None = Query(None, min_length=3, max_length=50)): +async def read_items(q: str | None = Query(default=None, min_length=3, max_length=50)): results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} if q: results.update({"q": q}) diff --git a/docs_src/query_params_str_validations/tutorial004.py b/docs_src/query_params_str_validations/tutorial004.py index d2c30331f..5a7129816 100644 --- a/docs_src/query_params_str_validations/tutorial004.py +++ b/docs_src/query_params_str_validations/tutorial004.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI, Query @@ -7,7 +7,9 @@ app = FastAPI() @app.get("/items/") async def read_items( - q: Optional[str] = Query(None, min_length=3, max_length=50, regex="^fixedquery$") + q: Union[str, None] = Query( + default=None, min_length=3, max_length=50, regex="^fixedquery$" + ) ): results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} if q: diff --git a/docs_src/query_params_str_validations/tutorial004_py310.py b/docs_src/query_params_str_validations/tutorial004_py310.py index 518b779f7..180a2e511 100644 --- a/docs_src/query_params_str_validations/tutorial004_py310.py +++ b/docs_src/query_params_str_validations/tutorial004_py310.py @@ -5,7 +5,8 @@ app = FastAPI() @app.get("/items/") async def read_items( - q: str | None = Query(None, min_length=3, max_length=50, regex="^fixedquery$") + q: str + | None = Query(default=None, min_length=3, max_length=50, regex="^fixedquery$") ): results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} if q: diff --git a/docs_src/query_params_str_validations/tutorial005.py b/docs_src/query_params_str_validations/tutorial005.py index 22eb3acba..8ab42869e 100644 --- a/docs_src/query_params_str_validations/tutorial005.py +++ b/docs_src/query_params_str_validations/tutorial005.py @@ -4,7 +4,7 @@ app = FastAPI() @app.get("/items/") -async def read_items(q: str = Query("fixedquery", min_length=3)): +async def read_items(q: str = Query(default="fixedquery", min_length=3)): results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} if q: results.update({"q": q}) diff --git a/docs_src/query_params_str_validations/tutorial006.py b/docs_src/query_params_str_validations/tutorial006.py index 720bf07f1..9a90eb64e 100644 --- a/docs_src/query_params_str_validations/tutorial006.py +++ b/docs_src/query_params_str_validations/tutorial006.py @@ -4,7 +4,7 @@ app = FastAPI() @app.get("/items/") -async def read_items(q: str = Query(..., min_length=3)): +async def read_items(q: str = Query(min_length=3)): results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} if q: results.update({"q": q}) diff --git a/docs_src/query_params_str_validations/tutorial006b.py b/docs_src/query_params_str_validations/tutorial006b.py new file mode 100644 index 000000000..a8d69c889 --- /dev/null +++ b/docs_src/query_params_str_validations/tutorial006b.py @@ -0,0 +1,11 @@ +from fastapi import FastAPI, Query + +app = FastAPI() + + +@app.get("/items/") +async def read_items(q: str = Query(default=..., min_length=3)): + results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} + if q: + results.update({"q": q}) + return results diff --git a/docs_src/query_params_str_validations/tutorial006c.py b/docs_src/query_params_str_validations/tutorial006c.py new file mode 100644 index 000000000..2ac148c94 --- /dev/null +++ b/docs_src/query_params_str_validations/tutorial006c.py @@ -0,0 +1,13 @@ +from typing import Union + +from fastapi import FastAPI, Query + +app = FastAPI() + + +@app.get("/items/") +async def read_items(q: Union[str, None] = Query(default=..., min_length=3)): + results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} + if q: + results.update({"q": q}) + return results diff --git a/docs_src/query_params_str_validations/tutorial006c_py310.py b/docs_src/query_params_str_validations/tutorial006c_py310.py new file mode 100644 index 000000000..82dd9e5d7 --- /dev/null +++ b/docs_src/query_params_str_validations/tutorial006c_py310.py @@ -0,0 +1,11 @@ +from fastapi import FastAPI, Query + +app = FastAPI() + + +@app.get("/items/") +async def read_items(q: str | None = Query(default=..., min_length=3)): + results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} + if q: + results.update({"q": q}) + return results diff --git a/docs_src/query_params_str_validations/tutorial006d.py b/docs_src/query_params_str_validations/tutorial006d.py new file mode 100644 index 000000000..42c5bf4eb --- /dev/null +++ b/docs_src/query_params_str_validations/tutorial006d.py @@ -0,0 +1,12 @@ +from fastapi import FastAPI, Query +from pydantic import Required + +app = FastAPI() + + +@app.get("/items/") +async def read_items(q: str = Query(default=Required, min_length=3)): + results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} + if q: + results.update({"q": q}) + return results diff --git a/docs_src/query_params_str_validations/tutorial007.py b/docs_src/query_params_str_validations/tutorial007.py index e360feda9..cb836569e 100644 --- a/docs_src/query_params_str_validations/tutorial007.py +++ b/docs_src/query_params_str_validations/tutorial007.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI, Query @@ -7,7 +7,7 @@ app = FastAPI() @app.get("/items/") async def read_items( - q: Optional[str] = Query(None, title="Query string", min_length=3) + q: Union[str, None] = Query(default=None, title="Query string", min_length=3) ): results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} if q: diff --git a/docs_src/query_params_str_validations/tutorial007_py310.py b/docs_src/query_params_str_validations/tutorial007_py310.py index 14ef4cb69..e3e1ef2e0 100644 --- a/docs_src/query_params_str_validations/tutorial007_py310.py +++ b/docs_src/query_params_str_validations/tutorial007_py310.py @@ -4,7 +4,9 @@ app = FastAPI() @app.get("/items/") -async def read_items(q: str | None = Query(None, title="Query string", min_length=3)): +async def read_items( + q: str | None = Query(default=None, title="Query string", min_length=3) +): results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} if q: results.update({"q": q}) diff --git a/docs_src/query_params_str_validations/tutorial008.py b/docs_src/query_params_str_validations/tutorial008.py index 238add471..d112a9ab8 100644 --- a/docs_src/query_params_str_validations/tutorial008.py +++ b/docs_src/query_params_str_validations/tutorial008.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI, Query @@ -7,8 +7,8 @@ app = FastAPI() @app.get("/items/") async def read_items( - q: Optional[str] = Query( - None, + q: Union[str, None] = Query( + default=None, title="Query string", description="Query string for the items to search in the database that have a good match", min_length=3, diff --git a/docs_src/query_params_str_validations/tutorial008_py310.py b/docs_src/query_params_str_validations/tutorial008_py310.py index 06bb02442..489f631d5 100644 --- a/docs_src/query_params_str_validations/tutorial008_py310.py +++ b/docs_src/query_params_str_validations/tutorial008_py310.py @@ -7,7 +7,7 @@ app = FastAPI() async def read_items( q: str | None = Query( - None, + default=None, title="Query string", description="Query string for the items to search in the database that have a good match", min_length=3, diff --git a/docs_src/query_params_str_validations/tutorial009.py b/docs_src/query_params_str_validations/tutorial009.py index 7e5c0b81a..8a6bfe2d9 100644 --- a/docs_src/query_params_str_validations/tutorial009.py +++ b/docs_src/query_params_str_validations/tutorial009.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI, Query @@ -6,7 +6,7 @@ app = FastAPI() @app.get("/items/") -async def read_items(q: Optional[str] = Query(None, alias="item-query")): +async def read_items(q: Union[str, None] = Query(default=None, alias="item-query")): results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} if q: results.update({"q": q}) diff --git a/docs_src/query_params_str_validations/tutorial009_py310.py b/docs_src/query_params_str_validations/tutorial009_py310.py index e84c116f1..a38d32cbb 100644 --- a/docs_src/query_params_str_validations/tutorial009_py310.py +++ b/docs_src/query_params_str_validations/tutorial009_py310.py @@ -4,7 +4,7 @@ app = FastAPI() @app.get("/items/") -async def read_items(q: str | None = Query(None, alias="item-query")): +async def read_items(q: str | None = Query(default=None, alias="item-query")): results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} if q: results.update({"q": q}) diff --git a/docs_src/query_params_str_validations/tutorial010.py b/docs_src/query_params_str_validations/tutorial010.py index 7921506b6..35443d194 100644 --- a/docs_src/query_params_str_validations/tutorial010.py +++ b/docs_src/query_params_str_validations/tutorial010.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI, Query @@ -7,8 +7,8 @@ app = FastAPI() @app.get("/items/") async def read_items( - q: Optional[str] = Query( - None, + q: Union[str, None] = Query( + default=None, alias="item-query", title="Query string", description="Query string for the items to search in the database that have a good match", diff --git a/docs_src/query_params_str_validations/tutorial010_py310.py b/docs_src/query_params_str_validations/tutorial010_py310.py index c35800858..f2839516e 100644 --- a/docs_src/query_params_str_validations/tutorial010_py310.py +++ b/docs_src/query_params_str_validations/tutorial010_py310.py @@ -7,7 +7,7 @@ app = FastAPI() async def read_items( q: str | None = Query( - None, + default=None, alias="item-query", title="Query string", description="Query string for the items to search in the database that have a good match", diff --git a/docs_src/query_params_str_validations/tutorial011.py b/docs_src/query_params_str_validations/tutorial011.py index 7fda267ed..65bbce781 100644 --- a/docs_src/query_params_str_validations/tutorial011.py +++ b/docs_src/query_params_str_validations/tutorial011.py @@ -1,4 +1,4 @@ -from typing import List, Optional +from typing import List, Union from fastapi import FastAPI, Query @@ -6,6 +6,6 @@ app = FastAPI() @app.get("/items/") -async def read_items(q: Optional[List[str]] = Query(None)): +async def read_items(q: Union[List[str], None] = Query(default=None)): query_items = {"q": q} return query_items diff --git a/docs_src/query_params_str_validations/tutorial011_py310.py b/docs_src/query_params_str_validations/tutorial011_py310.py index c3d992e62..70155de7c 100644 --- a/docs_src/query_params_str_validations/tutorial011_py310.py +++ b/docs_src/query_params_str_validations/tutorial011_py310.py @@ -4,6 +4,6 @@ app = FastAPI() @app.get("/items/") -async def read_items(q: list[str] | None = Query(None)): +async def read_items(q: list[str] | None = Query(default=None)): query_items = {"q": q} return query_items diff --git a/docs_src/query_params_str_validations/tutorial011_py39.py b/docs_src/query_params_str_validations/tutorial011_py39.py index 38ba764d6..878f95c79 100644 --- a/docs_src/query_params_str_validations/tutorial011_py39.py +++ b/docs_src/query_params_str_validations/tutorial011_py39.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI, Query @@ -6,6 +6,6 @@ app = FastAPI() @app.get("/items/") -async def read_items(q: Optional[list[str]] = Query(None)): +async def read_items(q: Union[list[str], None] = Query(default=None)): query_items = {"q": q} return query_items diff --git a/docs_src/query_params_str_validations/tutorial012.py b/docs_src/query_params_str_validations/tutorial012.py index 7ea9f017d..e77d56974 100644 --- a/docs_src/query_params_str_validations/tutorial012.py +++ b/docs_src/query_params_str_validations/tutorial012.py @@ -6,6 +6,6 @@ app = FastAPI() @app.get("/items/") -async def read_items(q: List[str] = Query(["foo", "bar"])): +async def read_items(q: List[str] = Query(default=["foo", "bar"])): query_items = {"q": q} return query_items diff --git a/docs_src/query_params_str_validations/tutorial012_py39.py b/docs_src/query_params_str_validations/tutorial012_py39.py index 1900133d9..070d0b04b 100644 --- a/docs_src/query_params_str_validations/tutorial012_py39.py +++ b/docs_src/query_params_str_validations/tutorial012_py39.py @@ -4,6 +4,6 @@ app = FastAPI() @app.get("/items/") -async def read_items(q: list[str] = Query(["foo", "bar"])): +async def read_items(q: list[str] = Query(default=["foo", "bar"])): query_items = {"q": q} return query_items diff --git a/docs_src/query_params_str_validations/tutorial013.py b/docs_src/query_params_str_validations/tutorial013.py index 95dd6999d..0b0f44869 100644 --- a/docs_src/query_params_str_validations/tutorial013.py +++ b/docs_src/query_params_str_validations/tutorial013.py @@ -4,6 +4,6 @@ app = FastAPI() @app.get("/items/") -async def read_items(q: list = Query([])): +async def read_items(q: list = Query(default=[])): query_items = {"q": q} return query_items diff --git a/docs_src/query_params_str_validations/tutorial014.py b/docs_src/query_params_str_validations/tutorial014.py index fb50bc27b..50e0a6c2b 100644 --- a/docs_src/query_params_str_validations/tutorial014.py +++ b/docs_src/query_params_str_validations/tutorial014.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI, Query @@ -7,7 +7,7 @@ app = FastAPI() @app.get("/items/") async def read_items( - hidden_query: Optional[str] = Query(None, include_in_schema=False) + hidden_query: Union[str, None] = Query(default=None, include_in_schema=False) ): if hidden_query: return {"hidden_query": hidden_query} diff --git a/docs_src/query_params_str_validations/tutorial014_py310.py b/docs_src/query_params_str_validations/tutorial014_py310.py index 7ae39c7f9..1b617efdd 100644 --- a/docs_src/query_params_str_validations/tutorial014_py310.py +++ b/docs_src/query_params_str_validations/tutorial014_py310.py @@ -4,7 +4,9 @@ app = FastAPI() @app.get("/items/") -async def read_items(hidden_query: str | None = Query(None, include_in_schema=False)): +async def read_items( + hidden_query: str | None = Query(default=None, include_in_schema=False) +): if hidden_query: return {"hidden_query": hidden_query} else: diff --git a/docs_src/request_files/tutorial001.py b/docs_src/request_files/tutorial001.py index 0fb1dd571..2e0ea6391 100644 --- a/docs_src/request_files/tutorial001.py +++ b/docs_src/request_files/tutorial001.py @@ -4,7 +4,7 @@ app = FastAPI() @app.post("/files/") -async def create_file(file: bytes = File(...)): +async def create_file(file: bytes = File()): return {"file_size": len(file)} diff --git a/docs_src/request_files/tutorial001_02.py b/docs_src/request_files/tutorial001_02.py index 26a4c9cbf..3f311c4b8 100644 --- a/docs_src/request_files/tutorial001_02.py +++ b/docs_src/request_files/tutorial001_02.py @@ -6,7 +6,7 @@ app = FastAPI() @app.post("/files/") -async def create_file(file: Optional[bytes] = File(None)): +async def create_file(file: Optional[bytes] = File(default=None)): if not file: return {"message": "No file sent"} else: diff --git a/docs_src/request_files/tutorial001_02_py310.py b/docs_src/request_files/tutorial001_02_py310.py index 0e576251b..298c9974f 100644 --- a/docs_src/request_files/tutorial001_02_py310.py +++ b/docs_src/request_files/tutorial001_02_py310.py @@ -4,7 +4,7 @@ app = FastAPI() @app.post("/files/") -async def create_file(file: bytes | None = File(None)): +async def create_file(file: bytes | None = File(default=None)): if not file: return {"message": "No file sent"} else: diff --git a/docs_src/request_files/tutorial001_03.py b/docs_src/request_files/tutorial001_03.py index abcac9e4c..d8005cc7d 100644 --- a/docs_src/request_files/tutorial001_03.py +++ b/docs_src/request_files/tutorial001_03.py @@ -4,12 +4,12 @@ app = FastAPI() @app.post("/files/") -async def create_file(file: bytes = File(..., description="A file read as bytes")): +async def create_file(file: bytes = File(description="A file read as bytes")): return {"file_size": len(file)} @app.post("/uploadfile/") async def create_upload_file( - file: UploadFile = File(..., description="A file read as UploadFile") + file: UploadFile = File(description="A file read as UploadFile"), ): return {"filename": file.filename} diff --git a/docs_src/request_files/tutorial002.py b/docs_src/request_files/tutorial002.py index 94abb7c6c..b4d0acc68 100644 --- a/docs_src/request_files/tutorial002.py +++ b/docs_src/request_files/tutorial002.py @@ -7,7 +7,7 @@ app = FastAPI() @app.post("/files/") -async def create_files(files: List[bytes] = File(...)): +async def create_files(files: List[bytes] = File()): return {"file_sizes": [len(file) for file in files]} diff --git a/docs_src/request_files/tutorial002_py39.py b/docs_src/request_files/tutorial002_py39.py index 2779618bd..b64cf5598 100644 --- a/docs_src/request_files/tutorial002_py39.py +++ b/docs_src/request_files/tutorial002_py39.py @@ -5,7 +5,7 @@ app = FastAPI() @app.post("/files/") -async def create_files(files: list[bytes] = File(...)): +async def create_files(files: list[bytes] = File()): return {"file_sizes": [len(file) for file in files]} diff --git a/docs_src/request_files/tutorial003.py b/docs_src/request_files/tutorial003.py index 4a91b7a8b..e3f805f60 100644 --- a/docs_src/request_files/tutorial003.py +++ b/docs_src/request_files/tutorial003.py @@ -8,14 +8,14 @@ app = FastAPI() @app.post("/files/") async def create_files( - files: List[bytes] = File(..., description="Multiple files as bytes") + files: List[bytes] = File(description="Multiple files as bytes"), ): return {"file_sizes": [len(file) for file in files]} @app.post("/uploadfiles/") async def create_upload_files( - files: List[UploadFile] = File(..., description="Multiple files as UploadFile") + files: List[UploadFile] = File(description="Multiple files as UploadFile"), ): return {"filenames": [file.filename for file in files]} diff --git a/docs_src/request_files/tutorial003_py39.py b/docs_src/request_files/tutorial003_py39.py index d853f48d1..96f5e8742 100644 --- a/docs_src/request_files/tutorial003_py39.py +++ b/docs_src/request_files/tutorial003_py39.py @@ -6,14 +6,14 @@ app = FastAPI() @app.post("/files/") async def create_files( - files: list[bytes] = File(..., description="Multiple files as bytes") + files: list[bytes] = File(description="Multiple files as bytes"), ): return {"file_sizes": [len(file) for file in files]} @app.post("/uploadfiles/") async def create_upload_files( - files: list[UploadFile] = File(..., description="Multiple files as UploadFile") + files: list[UploadFile] = File(description="Multiple files as UploadFile"), ): return {"filenames": [file.filename for file in files]} diff --git a/docs_src/request_forms/tutorial001.py b/docs_src/request_forms/tutorial001.py index c07e22945..a53770001 100644 --- a/docs_src/request_forms/tutorial001.py +++ b/docs_src/request_forms/tutorial001.py @@ -4,5 +4,5 @@ app = FastAPI() @app.post("/login/") -async def login(username: str = Form(...), password: str = Form(...)): +async def login(username: str = Form(), password: str = Form()): return {"username": username} diff --git a/docs_src/request_forms_and_files/tutorial001.py b/docs_src/request_forms_and_files/tutorial001.py index 5bf3a5bc0..7b5224ce5 100644 --- a/docs_src/request_forms_and_files/tutorial001.py +++ b/docs_src/request_forms_and_files/tutorial001.py @@ -5,7 +5,7 @@ app = FastAPI() @app.post("/files/") async def create_file( - file: bytes = File(...), fileb: UploadFile = File(...), token: str = Form(...) + file: bytes = File(), fileb: UploadFile = File(), token: str = Form() ): return { "file_size": len(file), diff --git a/docs_src/schema_extra_example/tutorial002.py b/docs_src/schema_extra_example/tutorial002.py index df3df8854..a2aec46f5 100644 --- a/docs_src/schema_extra_example/tutorial002.py +++ b/docs_src/schema_extra_example/tutorial002.py @@ -7,10 +7,10 @@ app = FastAPI() class Item(BaseModel): - name: str = Field(..., example="Foo") - description: Optional[str] = Field(None, example="A very nice Item") - price: float = Field(..., example=35.4) - tax: Optional[float] = Field(None, example=3.2) + name: str = Field(example="Foo") + description: Optional[str] = Field(default=None, example="A very nice Item") + price: float = Field(example=35.4) + tax: Optional[float] = Field(default=None, example=3.2) @app.put("/items/{item_id}") diff --git a/docs_src/schema_extra_example/tutorial002_py310.py b/docs_src/schema_extra_example/tutorial002_py310.py index 4f8f8304e..e84928bb1 100644 --- a/docs_src/schema_extra_example/tutorial002_py310.py +++ b/docs_src/schema_extra_example/tutorial002_py310.py @@ -5,10 +5,10 @@ app = FastAPI() class Item(BaseModel): - name: str = Field(..., example="Foo") - description: str | None = Field(None, example="A very nice Item") - price: float = Field(..., example=35.4) - tax: float | None = Field(None, example=3.2) + name: str = Field(example="Foo") + description: str | None = Field(default=None, example="A very nice Item") + price: float = Field(example=35.4) + tax: float | None = Field(default=None, example=3.2) @app.put("/items/{item_id}") diff --git a/docs_src/schema_extra_example/tutorial003.py b/docs_src/schema_extra_example/tutorial003.py index 58c79f554..43d46b81b 100644 --- a/docs_src/schema_extra_example/tutorial003.py +++ b/docs_src/schema_extra_example/tutorial003.py @@ -17,7 +17,6 @@ class Item(BaseModel): async def update_item( item_id: int, item: Item = Body( - ..., example={ "name": "Foo", "description": "A very nice Item", diff --git a/docs_src/schema_extra_example/tutorial003_py310.py b/docs_src/schema_extra_example/tutorial003_py310.py index cf4c99dc0..1e137101d 100644 --- a/docs_src/schema_extra_example/tutorial003_py310.py +++ b/docs_src/schema_extra_example/tutorial003_py310.py @@ -15,7 +15,6 @@ class Item(BaseModel): async def update_item( item_id: int, item: Item = Body( - ..., example={ "name": "Foo", "description": "A very nice Item", diff --git a/docs_src/schema_extra_example/tutorial004.py b/docs_src/schema_extra_example/tutorial004.py index 9f0e8b437..42d7a04a3 100644 --- a/docs_src/schema_extra_example/tutorial004.py +++ b/docs_src/schema_extra_example/tutorial004.py @@ -18,7 +18,6 @@ async def update_item( *, item_id: int, item: Item = Body( - ..., examples={ "normal": { "summary": "A normal example", diff --git a/docs_src/schema_extra_example/tutorial004_py310.py b/docs_src/schema_extra_example/tutorial004_py310.py index 6f29c1a5c..100a30860 100644 --- a/docs_src/schema_extra_example/tutorial004_py310.py +++ b/docs_src/schema_extra_example/tutorial004_py310.py @@ -16,7 +16,6 @@ async def update_item( *, item_id: int, item: Item = Body( - ..., examples={ "normal": { "summary": "A normal example", diff --git a/docs_src/websockets/tutorial002.py b/docs_src/websockets/tutorial002.py index 53cdb41ff..b01008530 100644 --- a/docs_src/websockets/tutorial002.py +++ b/docs_src/websockets/tutorial002.py @@ -57,8 +57,8 @@ async def get(): async def get_cookie_or_token( websocket: WebSocket, - session: Optional[str] = Cookie(None), - token: Optional[str] = Query(None), + session: Optional[str] = Cookie(default=None), + token: Optional[str] = Query(default=None), ): if session is None and token is None: await websocket.close(code=status.WS_1008_POLICY_VIOLATION) diff --git a/fastapi/dependencies/utils.py b/fastapi/dependencies/utils.py index 9dccd354e..f397e333c 100644 --- a/fastapi/dependencies/utils.py +++ b/fastapi/dependencies/utils.py @@ -43,6 +43,7 @@ from pydantic.fields import ( FieldInfo, ModelField, Required, + Undefined, ) from pydantic.schema import get_annotation_from_field_info from pydantic.typing import ForwardRef, evaluate_forwardref @@ -316,7 +317,7 @@ def get_dependant( field_info = param_field.field_info assert isinstance( field_info, params.Body - ), f"Param: {param_field.name} can only be a request body, using Body(...)" + ), f"Param: {param_field.name} can only be a request body, using Body()" dependant.body_params.append(param_field) return dependant @@ -353,7 +354,7 @@ def get_param_field( force_type: Optional[params.ParamTypes] = None, ignore_default: bool = False, ) -> ModelField: - default_value = Required + default_value: Any = Undefined had_schema = False if not param.default == param.empty and ignore_default is False: default_value = param.default @@ -369,8 +370,13 @@ def get_param_field( if force_type: field_info.in_ = force_type # type: ignore else: - field_info = default_field_info(default_value) - required = default_value == Required + field_info = default_field_info(default=default_value) + required = True + if default_value is Required or ignore_default: + required = True + default_value = None + elif default_value is not Undefined: + required = False annotation: Any = Any if not param.annotation == param.empty: annotation = param.annotation @@ -382,12 +388,11 @@ def get_param_field( field = create_response_field( name=param.name, type_=annotation, - default=None if required else default_value, + default=default_value, alias=alias, required=required, field_info=field_info, ) - field.required = required if not had_schema and not is_scalar_field(field=field): field.field_info = params.Body(field_info.default) if not had_schema and lenient_issubclass(field.type_, UploadFile): diff --git a/fastapi/openapi/models.py b/fastapi/openapi/models.py index 9c6598d2d..35aa1672b 100644 --- a/fastapi/openapi/models.py +++ b/fastapi/openapi/models.py @@ -73,7 +73,7 @@ class Server(BaseModel): class Reference(BaseModel): - ref: str = Field(..., alias="$ref") + ref: str = Field(alias="$ref") class Discriminator(BaseModel): @@ -101,28 +101,28 @@ class ExternalDocumentation(BaseModel): class Schema(BaseModel): - ref: Optional[str] = Field(None, alias="$ref") + ref: Optional[str] = Field(default=None, alias="$ref") title: Optional[str] = None multipleOf: Optional[float] = None maximum: Optional[float] = None exclusiveMaximum: Optional[float] = None minimum: Optional[float] = None exclusiveMinimum: Optional[float] = None - maxLength: Optional[int] = Field(None, gte=0) - minLength: Optional[int] = Field(None, gte=0) + maxLength: Optional[int] = Field(default=None, gte=0) + minLength: Optional[int] = Field(default=None, gte=0) pattern: Optional[str] = None - maxItems: Optional[int] = Field(None, gte=0) - minItems: Optional[int] = Field(None, gte=0) + maxItems: Optional[int] = Field(default=None, gte=0) + minItems: Optional[int] = Field(default=None, gte=0) uniqueItems: Optional[bool] = None - maxProperties: Optional[int] = Field(None, gte=0) - minProperties: Optional[int] = Field(None, gte=0) + maxProperties: Optional[int] = Field(default=None, gte=0) + minProperties: Optional[int] = Field(default=None, gte=0) required: Optional[List[str]] = None enum: Optional[List[Any]] = None type: Optional[str] = None allOf: Optional[List["Schema"]] = None oneOf: Optional[List["Schema"]] = None anyOf: Optional[List["Schema"]] = None - not_: Optional["Schema"] = Field(None, alias="not") + not_: Optional["Schema"] = Field(default=None, alias="not") items: Optional[Union["Schema", List["Schema"]]] = None properties: Optional[Dict[str, "Schema"]] = None additionalProperties: Optional[Union["Schema", Reference, bool]] = None @@ -171,7 +171,7 @@ class Encoding(BaseModel): class MediaType(BaseModel): - schema_: Optional[Union[Schema, Reference]] = Field(None, alias="schema") + schema_: Optional[Union[Schema, Reference]] = Field(default=None, alias="schema") example: Optional[Any] = None examples: Optional[Dict[str, Union[Example, Reference]]] = None encoding: Optional[Dict[str, Encoding]] = None @@ -188,7 +188,7 @@ class ParameterBase(BaseModel): style: Optional[str] = None explode: Optional[bool] = None allowReserved: Optional[bool] = None - schema_: Optional[Union[Schema, Reference]] = Field(None, alias="schema") + schema_: Optional[Union[Schema, Reference]] = Field(default=None, alias="schema") example: Optional[Any] = None examples: Optional[Dict[str, Union[Example, Reference]]] = None # Serialization rules for more complex scenarios @@ -200,7 +200,7 @@ class ParameterBase(BaseModel): class Parameter(ParameterBase): name: str - in_: ParameterInType = Field(..., alias="in") + in_: ParameterInType = Field(alias="in") class Header(ParameterBase): @@ -258,7 +258,7 @@ class Operation(BaseModel): class PathItem(BaseModel): - ref: Optional[str] = Field(None, alias="$ref") + ref: Optional[str] = Field(default=None, alias="$ref") summary: Optional[str] = None description: Optional[str] = None get: Optional[Operation] = None @@ -284,7 +284,7 @@ class SecuritySchemeType(Enum): class SecurityBase(BaseModel): - type_: SecuritySchemeType = Field(..., alias="type") + type_: SecuritySchemeType = Field(alias="type") description: Optional[str] = None class Config: @@ -299,7 +299,7 @@ class APIKeyIn(Enum): class APIKey(SecurityBase): type_ = Field(SecuritySchemeType.apiKey, alias="type") - in_: APIKeyIn = Field(..., alias="in") + in_: APIKeyIn = Field(alias="in") name: str diff --git a/fastapi/param_functions.py b/fastapi/param_functions.py index a553a1461..1932ef065 100644 --- a/fastapi/param_functions.py +++ b/fastapi/param_functions.py @@ -5,7 +5,7 @@ from pydantic.fields import Undefined def Path( # noqa: N802 - default: Any, + default: Any = Undefined, *, alias: Optional[str] = None, title: Optional[str] = None, @@ -44,7 +44,7 @@ def Path( # noqa: N802 def Query( # noqa: N802 - default: Any, + default: Any = Undefined, *, alias: Optional[str] = None, title: Optional[str] = None, @@ -63,7 +63,7 @@ def Query( # noqa: N802 **extra: Any, ) -> Any: return params.Query( - default, + default=default, alias=alias, title=title, description=description, @@ -83,7 +83,7 @@ def Query( # noqa: N802 def Header( # noqa: N802 - default: Any, + default: Any = Undefined, *, alias: Optional[str] = None, convert_underscores: bool = True, @@ -103,7 +103,7 @@ def Header( # noqa: N802 **extra: Any, ) -> Any: return params.Header( - default, + default=default, alias=alias, convert_underscores=convert_underscores, title=title, @@ -124,7 +124,7 @@ def Header( # noqa: N802 def Cookie( # noqa: N802 - default: Any, + default: Any = Undefined, *, alias: Optional[str] = None, title: Optional[str] = None, @@ -143,7 +143,7 @@ def Cookie( # noqa: N802 **extra: Any, ) -> Any: return params.Cookie( - default, + default=default, alias=alias, title=title, description=description, @@ -163,7 +163,7 @@ def Cookie( # noqa: N802 def Body( # noqa: N802 - default: Any, + default: Any = Undefined, *, embed: bool = False, media_type: str = "application/json", @@ -182,7 +182,7 @@ def Body( # noqa: N802 **extra: Any, ) -> Any: return params.Body( - default, + default=default, embed=embed, media_type=media_type, alias=alias, @@ -202,7 +202,7 @@ def Body( # noqa: N802 def Form( # noqa: N802 - default: Any, + default: Any = Undefined, *, media_type: str = "application/x-www-form-urlencoded", alias: Optional[str] = None, @@ -220,7 +220,7 @@ def Form( # noqa: N802 **extra: Any, ) -> Any: return params.Form( - default, + default=default, media_type=media_type, alias=alias, title=title, @@ -239,7 +239,7 @@ def Form( # noqa: N802 def File( # noqa: N802 - default: Any, + default: Any = Undefined, *, media_type: str = "multipart/form-data", alias: Optional[str] = None, @@ -257,7 +257,7 @@ def File( # noqa: N802 **extra: Any, ) -> Any: return params.File( - default, + default=default, media_type=media_type, alias=alias, title=title, diff --git a/fastapi/params.py b/fastapi/params.py index 042bbd42f..5395b98a3 100644 --- a/fastapi/params.py +++ b/fastapi/params.py @@ -16,7 +16,7 @@ class Param(FieldInfo): def __init__( self, - default: Any, + default: Any = Undefined, *, alias: Optional[str] = None, title: Optional[str] = None, @@ -39,7 +39,7 @@ class Param(FieldInfo): self.examples = examples self.include_in_schema = include_in_schema super().__init__( - default, + default=default, alias=alias, title=title, description=description, @@ -62,7 +62,7 @@ class Path(Param): def __init__( self, - default: Any, + default: Any = Undefined, *, alias: Optional[str] = None, title: Optional[str] = None, @@ -82,7 +82,7 @@ class Path(Param): ): self.in_ = self.in_ super().__init__( - ..., + default=..., alias=alias, title=title, description=description, @@ -106,7 +106,7 @@ class Query(Param): def __init__( self, - default: Any, + default: Any = Undefined, *, alias: Optional[str] = None, title: Optional[str] = None, @@ -125,7 +125,7 @@ class Query(Param): **extra: Any, ): super().__init__( - default, + default=default, alias=alias, title=title, description=description, @@ -149,7 +149,7 @@ class Header(Param): def __init__( self, - default: Any, + default: Any = Undefined, *, alias: Optional[str] = None, convert_underscores: bool = True, @@ -170,7 +170,7 @@ class Header(Param): ): self.convert_underscores = convert_underscores super().__init__( - default, + default=default, alias=alias, title=title, description=description, @@ -194,7 +194,7 @@ class Cookie(Param): def __init__( self, - default: Any, + default: Any = Undefined, *, alias: Optional[str] = None, title: Optional[str] = None, @@ -213,7 +213,7 @@ class Cookie(Param): **extra: Any, ): super().__init__( - default, + default=default, alias=alias, title=title, description=description, @@ -235,7 +235,7 @@ class Cookie(Param): class Body(FieldInfo): def __init__( self, - default: Any, + default: Any = Undefined, *, embed: bool = False, media_type: str = "application/json", @@ -258,7 +258,7 @@ class Body(FieldInfo): self.example = example self.examples = examples super().__init__( - default, + default=default, alias=alias, title=title, description=description, @@ -297,7 +297,7 @@ class Form(Body): **extra: Any, ): super().__init__( - default, + default=default, embed=True, media_type=media_type, alias=alias, @@ -337,7 +337,7 @@ class File(Form): **extra: Any, ): super().__init__( - default, + default=default, media_type=media_type, alias=alias, title=title, diff --git a/fastapi/security/oauth2.py b/fastapi/security/oauth2.py index bdc6e2ea9..888208c15 100644 --- a/fastapi/security/oauth2.py +++ b/fastapi/security/oauth2.py @@ -45,12 +45,12 @@ class OAuth2PasswordRequestForm: def __init__( self, - grant_type: str = Form(None, regex="password"), - username: str = Form(...), - password: str = Form(...), - scope: str = Form(""), - client_id: Optional[str] = Form(None), - client_secret: Optional[str] = Form(None), + grant_type: str = Form(default=None, regex="password"), + username: str = Form(), + password: str = Form(), + scope: str = Form(default=""), + client_id: Optional[str] = Form(default=None), + client_secret: Optional[str] = Form(default=None), ): self.grant_type = grant_type self.username = username @@ -95,12 +95,12 @@ class OAuth2PasswordRequestFormStrict(OAuth2PasswordRequestForm): def __init__( self, - grant_type: str = Form(..., regex="password"), - username: str = Form(...), - password: str = Form(...), - scope: str = Form(""), - client_id: Optional[str] = Form(None), - client_secret: Optional[str] = Form(None), + grant_type: str = Form(regex="password"), + username: str = Form(), + password: str = Form(), + scope: str = Form(default=""), + client_id: Optional[str] = Form(default=None), + client_secret: Optional[str] = Form(default=None), ): super().__init__( grant_type=grant_type, diff --git a/fastapi/utils.py b/fastapi/utils.py index 9d720feb3..a7e135bca 100644 --- a/fastapi/utils.py +++ b/fastapi/utils.py @@ -52,7 +52,7 @@ def create_response_field( Create a new response field. Raises if type_ is invalid. """ class_validators = class_validators or {} - field_info = field_info or FieldInfo(None) + field_info = field_info or FieldInfo() response_field = functools.partial( ModelField, diff --git a/tests/main.py b/tests/main.py index d5603d0e6..f70496db8 100644 --- a/tests/main.py +++ b/tests/main.py @@ -49,97 +49,97 @@ def get_bool_id(item_id: bool): @app.get("/path/param/{item_id}") -def get_path_param_id(item_id: Optional[str] = Path(None)): +def get_path_param_id(item_id: str = Path()): return item_id @app.get("/path/param-required/{item_id}") -def get_path_param_required_id(item_id: str = Path(...)): +def get_path_param_required_id(item_id: str = Path()): return item_id @app.get("/path/param-minlength/{item_id}") -def get_path_param_min_length(item_id: str = Path(..., min_length=3)): +def get_path_param_min_length(item_id: str = Path(min_length=3)): return item_id @app.get("/path/param-maxlength/{item_id}") -def get_path_param_max_length(item_id: str = Path(..., max_length=3)): +def get_path_param_max_length(item_id: str = Path(max_length=3)): return item_id @app.get("/path/param-min_maxlength/{item_id}") -def get_path_param_min_max_length(item_id: str = Path(..., max_length=3, min_length=2)): +def get_path_param_min_max_length(item_id: str = Path(max_length=3, min_length=2)): return item_id @app.get("/path/param-gt/{item_id}") -def get_path_param_gt(item_id: float = Path(..., gt=3)): +def get_path_param_gt(item_id: float = Path(gt=3)): return item_id @app.get("/path/param-gt0/{item_id}") -def get_path_param_gt0(item_id: float = Path(..., gt=0)): +def get_path_param_gt0(item_id: float = Path(gt=0)): return item_id @app.get("/path/param-ge/{item_id}") -def get_path_param_ge(item_id: float = Path(..., ge=3)): +def get_path_param_ge(item_id: float = Path(ge=3)): return item_id @app.get("/path/param-lt/{item_id}") -def get_path_param_lt(item_id: float = Path(..., lt=3)): +def get_path_param_lt(item_id: float = Path(lt=3)): return item_id @app.get("/path/param-lt0/{item_id}") -def get_path_param_lt0(item_id: float = Path(..., lt=0)): +def get_path_param_lt0(item_id: float = Path(lt=0)): return item_id @app.get("/path/param-le/{item_id}") -def get_path_param_le(item_id: float = Path(..., le=3)): +def get_path_param_le(item_id: float = Path(le=3)): return item_id @app.get("/path/param-lt-gt/{item_id}") -def get_path_param_lt_gt(item_id: float = Path(..., lt=3, gt=1)): +def get_path_param_lt_gt(item_id: float = Path(lt=3, gt=1)): return item_id @app.get("/path/param-le-ge/{item_id}") -def get_path_param_le_ge(item_id: float = Path(..., le=3, ge=1)): +def get_path_param_le_ge(item_id: float = Path(le=3, ge=1)): return item_id @app.get("/path/param-lt-int/{item_id}") -def get_path_param_lt_int(item_id: int = Path(..., lt=3)): +def get_path_param_lt_int(item_id: int = Path(lt=3)): return item_id @app.get("/path/param-gt-int/{item_id}") -def get_path_param_gt_int(item_id: int = Path(..., gt=3)): +def get_path_param_gt_int(item_id: int = Path(gt=3)): return item_id @app.get("/path/param-le-int/{item_id}") -def get_path_param_le_int(item_id: int = Path(..., le=3)): +def get_path_param_le_int(item_id: int = Path(le=3)): return item_id @app.get("/path/param-ge-int/{item_id}") -def get_path_param_ge_int(item_id: int = Path(..., ge=3)): +def get_path_param_ge_int(item_id: int = Path(ge=3)): return item_id @app.get("/path/param-lt-gt-int/{item_id}") -def get_path_param_lt_gt_int(item_id: int = Path(..., lt=3, gt=1)): +def get_path_param_lt_gt_int(item_id: int = Path(lt=3, gt=1)): return item_id @app.get("/path/param-le-ge-int/{item_id}") -def get_path_param_le_ge_int(item_id: int = Path(..., le=3, ge=1)): +def get_path_param_le_ge_int(item_id: int = Path(le=3, ge=1)): return item_id @@ -173,19 +173,19 @@ def get_query_type_int_default(query: int = 10): @app.get("/query/param") -def get_query_param(query=Query(None)): +def get_query_param(query=Query(default=None)): if query is None: return "foo bar" return f"foo bar {query}" @app.get("/query/param-required") -def get_query_param_required(query=Query(...)): +def get_query_param_required(query=Query()): return f"foo bar {query}" @app.get("/query/param-required/int") -def get_query_param_required_type(query: int = Query(...)): +def get_query_param_required_type(query: int = Query()): return f"foo bar {query}" diff --git a/tests/test_dependency_normal_exceptions.py b/tests/test_dependency_normal_exceptions.py index 49a19f460..23c366d5d 100644 --- a/tests/test_dependency_normal_exceptions.py +++ b/tests/test_dependency_normal_exceptions.py @@ -26,14 +26,14 @@ async def get_database(): @app.put("/invalid-user/{user_id}") def put_invalid_user( - user_id: str, name: str = Body(...), db: dict = Depends(get_database) + user_id: str, name: str = Body(), db: dict = Depends(get_database) ): db[user_id] = name raise HTTPException(status_code=400, detail="Invalid user") @app.put("/user/{user_id}") -def put_user(user_id: str, name: str = Body(...), db: dict = Depends(get_database)): +def put_user(user_id: str, name: str = Body(), db: dict = Depends(get_database)): db[user_id] = name return {"message": "OK"} diff --git a/tests/test_forms_from_non_typing_sequences.py b/tests/test_forms_from_non_typing_sequences.py index be917eab7..52ce24753 100644 --- a/tests/test_forms_from_non_typing_sequences.py +++ b/tests/test_forms_from_non_typing_sequences.py @@ -5,17 +5,17 @@ app = FastAPI() @app.post("/form/python-list") -def post_form_param_list(items: list = Form(...)): +def post_form_param_list(items: list = Form()): return items @app.post("/form/python-set") -def post_form_param_set(items: set = Form(...)): +def post_form_param_set(items: set = Form()): return items @app.post("/form/python-tuple") -def post_form_param_tuple(items: tuple = Form(...)): +def post_form_param_tuple(items: tuple = Form()): return items diff --git a/tests/test_invalid_sequence_param.py b/tests/test_invalid_sequence_param.py index f00dd7b93..475786adb 100644 --- a/tests/test_invalid_sequence_param.py +++ b/tests/test_invalid_sequence_param.py @@ -13,7 +13,7 @@ def test_invalid_sequence(): title: str @app.get("/items/") - def read_items(q: List[Item] = Query(None)): + def read_items(q: List[Item] = Query(default=None)): pass # pragma: no cover @@ -25,7 +25,7 @@ def test_invalid_tuple(): title: str @app.get("/items/") - def read_items(q: Tuple[Item, Item] = Query(None)): + def read_items(q: Tuple[Item, Item] = Query(default=None)): pass # pragma: no cover @@ -37,7 +37,7 @@ def test_invalid_dict(): title: str @app.get("/items/") - def read_items(q: Dict[str, Item] = Query(None)): + def read_items(q: Dict[str, Item] = Query(default=None)): pass # pragma: no cover @@ -49,5 +49,5 @@ def test_invalid_simple_dict(): title: str @app.get("/items/") - def read_items(q: Optional[dict] = Query(None)): + def read_items(q: Optional[dict] = Query(default=None)): pass # pragma: no cover diff --git a/tests/test_jsonable_encoder.py b/tests/test_jsonable_encoder.py index fa82b5ea8..ed35fd32e 100644 --- a/tests/test_jsonable_encoder.py +++ b/tests/test_jsonable_encoder.py @@ -67,7 +67,7 @@ class ModelWithConfig(BaseModel): class ModelWithAlias(BaseModel): - foo: str = Field(..., alias="Foo") + foo: str = Field(alias="Foo") class ModelWithDefault(BaseModel): diff --git a/tests/test_modules_same_name_body/app/a.py b/tests/test_modules_same_name_body/app/a.py index 3c86c1865..377236890 100644 --- a/tests/test_modules_same_name_body/app/a.py +++ b/tests/test_modules_same_name_body/app/a.py @@ -4,5 +4,5 @@ router = APIRouter() @router.post("/compute") -def compute(a: int = Body(...), b: str = Body(...)): +def compute(a: int = Body(), b: str = Body()): return {"a": a, "b": b} diff --git a/tests/test_modules_same_name_body/app/b.py b/tests/test_modules_same_name_body/app/b.py index f7c7fdfc6..b62118f84 100644 --- a/tests/test_modules_same_name_body/app/b.py +++ b/tests/test_modules_same_name_body/app/b.py @@ -4,5 +4,5 @@ router = APIRouter() @router.post("/compute/") -def compute(a: int = Body(...), b: str = Body(...)): +def compute(a: int = Body(), b: str = Body()): return {"a": a, "b": b} diff --git a/tests/test_multi_query_errors.py b/tests/test_multi_query_errors.py index 0a15833fa..3da461af5 100644 --- a/tests/test_multi_query_errors.py +++ b/tests/test_multi_query_errors.py @@ -7,7 +7,7 @@ app = FastAPI() @app.get("/items/") -def read_items(q: List[int] = Query(None)): +def read_items(q: List[int] = Query(default=None)): return {"q": q} diff --git a/tests/test_multipart_installation.py b/tests/test_multipart_installation.py index c8a6fd942..788d9ef5a 100644 --- a/tests/test_multipart_installation.py +++ b/tests/test_multipart_installation.py @@ -12,7 +12,7 @@ def test_incorrect_multipart_installed_form(monkeypatch): app = FastAPI() @app.post("/") - async def root(username: str = Form(...)): + async def root(username: str = Form()): return username # pragma: nocover @@ -22,7 +22,7 @@ def test_incorrect_multipart_installed_file_upload(monkeypatch): app = FastAPI() @app.post("/") - async def root(f: UploadFile = File(...)): + async def root(f: UploadFile = File()): return f # pragma: nocover @@ -32,7 +32,7 @@ def test_incorrect_multipart_installed_file_bytes(monkeypatch): app = FastAPI() @app.post("/") - async def root(f: bytes = File(...)): + async def root(f: bytes = File()): return f # pragma: nocover @@ -42,7 +42,7 @@ def test_incorrect_multipart_installed_multi_form(monkeypatch): app = FastAPI() @app.post("/") - async def root(username: str = Form(...), password: str = Form(...)): + async def root(username: str = Form(), password: str = Form()): return username # pragma: nocover @@ -52,7 +52,7 @@ def test_incorrect_multipart_installed_form_file(monkeypatch): app = FastAPI() @app.post("/") - async def root(username: str = Form(...), f: UploadFile = File(...)): + async def root(username: str = Form(), f: UploadFile = File()): return username # pragma: nocover @@ -62,7 +62,7 @@ def test_no_multipart_installed(monkeypatch): app = FastAPI() @app.post("/") - async def root(username: str = Form(...)): + async def root(username: str = Form()): return username # pragma: nocover @@ -72,7 +72,7 @@ def test_no_multipart_installed_file(monkeypatch): app = FastAPI() @app.post("/") - async def root(f: UploadFile = File(...)): + async def root(f: UploadFile = File()): return f # pragma: nocover @@ -82,7 +82,7 @@ def test_no_multipart_installed_file_bytes(monkeypatch): app = FastAPI() @app.post("/") - async def root(f: bytes = File(...)): + async def root(f: bytes = File()): return f # pragma: nocover @@ -92,7 +92,7 @@ def test_no_multipart_installed_multi_form(monkeypatch): app = FastAPI() @app.post("/") - async def root(username: str = Form(...), password: str = Form(...)): + async def root(username: str = Form(), password: str = Form()): return username # pragma: nocover @@ -102,5 +102,5 @@ def test_no_multipart_installed_form_file(monkeypatch): app = FastAPI() @app.post("/") - async def root(username: str = Form(...), f: UploadFile = File(...)): + async def root(username: str = Form(), f: UploadFile = File()): return username # pragma: nocover diff --git a/tests/test_param_class.py b/tests/test_param_class.py index f5767ec96..1fd40dcd2 100644 --- a/tests/test_param_class.py +++ b/tests/test_param_class.py @@ -8,7 +8,7 @@ app = FastAPI() @app.get("/items/") -def read_items(q: Optional[str] = Param(None)): # type: ignore +def read_items(q: Optional[str] = Param(default=None)): # type: ignore return {"q": q} diff --git a/tests/test_param_include_in_schema.py b/tests/test_param_include_in_schema.py index 26aa63897..214f039b6 100644 --- a/tests/test_param_include_in_schema.py +++ b/tests/test_param_include_in_schema.py @@ -9,26 +9,26 @@ app = FastAPI() @app.get("/hidden_cookie") async def hidden_cookie( - hidden_cookie: Optional[str] = Cookie(None, include_in_schema=False) + hidden_cookie: Optional[str] = Cookie(default=None, include_in_schema=False) ): return {"hidden_cookie": hidden_cookie} @app.get("/hidden_header") async def hidden_header( - hidden_header: Optional[str] = Header(None, include_in_schema=False) + hidden_header: Optional[str] = Header(default=None, include_in_schema=False) ): return {"hidden_header": hidden_header} @app.get("/hidden_path/{hidden_path}") -async def hidden_path(hidden_path: str = Path(..., include_in_schema=False)): +async def hidden_path(hidden_path: str = Path(include_in_schema=False)): return {"hidden_path": hidden_path} @app.get("/hidden_query") async def hidden_query( - hidden_query: Optional[str] = Query(None, include_in_schema=False) + hidden_query: Optional[str] = Query(default=None, include_in_schema=False) ): return {"hidden_query": hidden_query} diff --git a/tests/test_repeated_dependency_schema.py b/tests/test_repeated_dependency_schema.py index 00441694e..ca0305184 100644 --- a/tests/test_repeated_dependency_schema.py +++ b/tests/test_repeated_dependency_schema.py @@ -4,7 +4,7 @@ from fastapi.testclient import TestClient app = FastAPI() -def get_header(*, someheader: str = Header(...)): +def get_header(*, someheader: str = Header()): return someheader diff --git a/tests/test_request_body_parameters_media_type.py b/tests/test_request_body_parameters_media_type.py index ace6bdef7..e9cf4006d 100644 --- a/tests/test_request_body_parameters_media_type.py +++ b/tests/test_request_body_parameters_media_type.py @@ -21,14 +21,14 @@ class Shop(BaseModel): @app.post("/products") -async def create_product(data: Product = Body(..., media_type=media_type, embed=True)): +async def create_product(data: Product = Body(media_type=media_type, embed=True)): pass # pragma: no cover @app.post("/shops") async def create_shop( - data: Shop = Body(..., media_type=media_type), - included: typing.List[Product] = Body([], media_type=media_type), + data: Shop = Body(media_type=media_type), + included: typing.List[Product] = Body(default=[], media_type=media_type), ): pass # pragma: no cover diff --git a/tests/test_schema_extra_examples.py b/tests/test_schema_extra_examples.py index 444e350a8..5047aeaa4 100644 --- a/tests/test_schema_extra_examples.py +++ b/tests/test_schema_extra_examples.py @@ -1,3 +1,5 @@ +from typing import Union + from fastapi import Body, Cookie, FastAPI, Header, Path, Query from fastapi.testclient import TestClient from pydantic import BaseModel @@ -18,14 +20,13 @@ def schema_extra(item: Item): @app.post("/example/") -def example(item: Item = Body(..., example={"data": "Data in Body example"})): +def example(item: Item = Body(example={"data": "Data in Body example"})): return item @app.post("/examples/") def examples( item: Item = Body( - ..., examples={ "example1": { "summary": "example1 summary", @@ -41,7 +42,6 @@ def examples( @app.post("/example_examples/") def example_examples( item: Item = Body( - ..., example={"data": "Overriden example"}, examples={ "example1": {"value": {"data": "examples example_examples 1"}}, @@ -55,7 +55,7 @@ def example_examples( # TODO: enable these tests once/if Form(embed=False) is supported # TODO: In that case, define if File() should support example/examples too # @app.post("/form_example") -# def form_example(firstname: str = Form(..., example="John")): +# def form_example(firstname: str = Form(example="John")): # return firstname @@ -89,7 +89,6 @@ def example_examples( @app.get("/path_example/{item_id}") def path_example( item_id: str = Path( - ..., example="item_1", ), ): @@ -99,7 +98,6 @@ def path_example( @app.get("/path_examples/{item_id}") def path_examples( item_id: str = Path( - ..., examples={ "example1": {"summary": "item ID summary", "value": "item_1"}, "example2": {"value": "item_2"}, @@ -112,7 +110,6 @@ def path_examples( @app.get("/path_example_examples/{item_id}") def path_example_examples( item_id: str = Path( - ..., example="item_overriden", examples={ "example1": {"summary": "item ID summary", "value": "item_1"}, @@ -125,8 +122,8 @@ def path_example_examples( @app.get("/query_example/") def query_example( - data: str = Query( - None, + data: Union[str, None] = Query( + default=None, example="query1", ), ): @@ -135,8 +132,8 @@ def query_example( @app.get("/query_examples/") def query_examples( - data: str = Query( - None, + data: Union[str, None] = Query( + default=None, examples={ "example1": {"summary": "Query example 1", "value": "query1"}, "example2": {"value": "query2"}, @@ -148,8 +145,8 @@ def query_examples( @app.get("/query_example_examples/") def query_example_examples( - data: str = Query( - None, + data: Union[str, None] = Query( + default=None, example="query_overriden", examples={ "example1": {"summary": "Qeury example 1", "value": "query1"}, @@ -162,8 +159,8 @@ def query_example_examples( @app.get("/header_example/") def header_example( - data: str = Header( - None, + data: Union[str, None] = Header( + default=None, example="header1", ), ): @@ -172,8 +169,8 @@ def header_example( @app.get("/header_examples/") def header_examples( - data: str = Header( - None, + data: Union[str, None] = Header( + default=None, examples={ "example1": {"summary": "header example 1", "value": "header1"}, "example2": {"value": "header2"}, @@ -185,8 +182,8 @@ def header_examples( @app.get("/header_example_examples/") def header_example_examples( - data: str = Header( - None, + data: Union[str, None] = Header( + default=None, example="header_overriden", examples={ "example1": {"summary": "Qeury example 1", "value": "header1"}, @@ -199,8 +196,8 @@ def header_example_examples( @app.get("/cookie_example/") def cookie_example( - data: str = Cookie( - None, + data: Union[str, None] = Cookie( + default=None, example="cookie1", ), ): @@ -209,8 +206,8 @@ def cookie_example( @app.get("/cookie_examples/") def cookie_examples( - data: str = Cookie( - None, + data: Union[str, None] = Cookie( + default=None, examples={ "example1": {"summary": "cookie example 1", "value": "cookie1"}, "example2": {"value": "cookie2"}, @@ -222,8 +219,8 @@ def cookie_examples( @app.get("/cookie_example_examples/") def cookie_example_examples( - data: str = Cookie( - None, + data: Union[str, None] = Cookie( + default=None, example="cookie_overriden", examples={ "example1": {"summary": "Qeury example 1", "value": "cookie1"}, diff --git a/tests/test_serialize_response_model.py b/tests/test_serialize_response_model.py index 295667437..3bb46b2e9 100644 --- a/tests/test_serialize_response_model.py +++ b/tests/test_serialize_response_model.py @@ -8,7 +8,7 @@ app = FastAPI() class Item(BaseModel): - name: str = Field(..., alias="aliased_name") + name: str = Field(alias="aliased_name") price: Optional[float] = None owner_ids: Optional[List[int]] = None diff --git a/tests/test_starlette_urlconvertors.py b/tests/test_starlette_urlconvertors.py index 2320c7005..5a980cbf6 100644 --- a/tests/test_starlette_urlconvertors.py +++ b/tests/test_starlette_urlconvertors.py @@ -5,17 +5,17 @@ app = FastAPI() @app.get("/int/{param:int}") -def int_convertor(param: int = Path(...)): +def int_convertor(param: int = Path()): return {"int": param} @app.get("/float/{param:float}") -def float_convertor(param: float = Path(...)): +def float_convertor(param: float = Path()): return {"float": param} @app.get("/path/{param:path}") -def path_convertor(param: str = Path(...)): +def path_convertor(param: str = Path()): return {"path": param} diff --git a/tests/test_tuples.py b/tests/test_tuples.py index 2085dc367..18ec2d048 100644 --- a/tests/test_tuples.py +++ b/tests/test_tuples.py @@ -27,7 +27,7 @@ def post_tuple_of_models(square: Tuple[Coordinate, Coordinate]): @app.post("/tuple-form/") -def hello(values: Tuple[int, int] = Form(...)): +def hello(values: Tuple[int, int] = Form()): return values From c5be1b0550f17d827721a5be1dc4344e73b1993f Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 13 May 2022 23:39:00 +0000 Subject: [PATCH 114/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 5c73818fe..416983bc1 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* โœจ Add support for not needing `...` as default value in required Query(), Path(), Header(), etc.. PR [#4906](https://github.com/tiangolo/fastapi/pull/4906) by [@tiangolo](https://github.com/tiangolo). * ๐ŸŽจ Fix default value as set in tutorial for Path Operations Advanced Configurations. PR [#4899](https://github.com/tiangolo/fastapi/pull/4899) by [@tiangolo](https://github.com/tiangolo). * โ™ป Refactor dict value extraction to minimize key lookups `fastapi/utils.py`. PR [#3139](https://github.com/tiangolo/fastapi/pull/3139) by [@ShahriyarR](https://github.com/ShahriyarR). * ๐Ÿ‘ท Fix installing Material for MkDocs Insiders in CI. PR [#4897](https://github.com/tiangolo/fastapi/pull/4897) by [@tiangolo](https://github.com/tiangolo). From ca437cdfabe7673b838cf42889ba1c653acd2228 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Sat, 14 May 2022 06:59:59 -0500 Subject: [PATCH 115/168] =?UTF-8?q?=F0=9F=93=9D=20Add=20docs=20recommendin?= =?UTF-8?q?g=20`Union`=20over=20`Optional`=20and=20migrate=20source=20exam?= =?UTF-8?q?ples=20(#4908)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ๐Ÿ“ Add docs recommending Union over Optional * ๐Ÿ“ Update docs recommending Union over Optional * ๐Ÿ“ Update source examples for docs, recommend Union over Optional * ๐Ÿ“ Update highlighted lines with updated source examples * ๐Ÿ“ Update highlighted lines in Markdown with recent code changes * ๐Ÿ“ Update docs, use Union instead of Optional * โ™ป๏ธ Update source examples to recommend Union over Optional * ๐ŸŽจ Update highlighted code in Markdown after moving from Optional to Union --- README.md | 14 +++---- docs/de/docs/index.md | 14 +++---- .../docs/advanced/additional-status-codes.md | 2 +- docs/en/docs/advanced/testing-dependencies.md | 2 +- docs/en/docs/deployment/docker.md | 4 +- docs/en/docs/index.md | 14 +++---- docs/en/docs/python-types.md | 42 +++++++++++++++++++ docs/en/docs/tutorial/body-multiple-params.md | 11 +++-- docs/en/docs/tutorial/body.md | 2 +- .../dependencies/classes-as-dependencies.md | 2 +- docs/en/docs/tutorial/dependencies/index.md | 4 +- .../tutorial/dependencies/sub-dependencies.md | 2 +- .../path-params-numeric-validations.md | 4 +- docs/en/docs/tutorial/response-model.md | 2 +- docs/en/docs/tutorial/schema-extra-example.md | 8 ++-- .../docs/advanced/additional-status-codes.md | 2 +- docs/es/docs/index.md | 14 +++---- docs/es/docs/tutorial/query-params.md | 2 +- docs/fa/docs/index.md | 14 +++---- docs/fr/docs/index.md | 14 +++---- .../docs/advanced/additional-status-codes.md | 2 +- .../tutorial/query-params-str-validations.md | 16 +++---- docs/ko/docs/index.md | 14 +++---- .../path-params-numeric-validations.md | 4 +- docs/ko/docs/tutorial/query-params.md | 2 +- docs/nl/docs/index.md | 14 +++---- docs/pl/docs/index.md | 14 +++---- docs/pt/docs/index.md | 14 ++++--- docs/pt/docs/tutorial/body.md | 2 +- .../tutorial/query-params-str-validations.md | 24 +++++------ docs/ru/docs/index.md | 14 +++---- docs/sq/docs/index.md | 14 +++---- docs/tr/docs/index.md | 14 +++---- docs/uk/docs/index.md | 14 +++---- .../docs/advanced/additional-status-codes.md | 2 +- docs/zh/docs/index.md | 14 +++---- docs/zh/docs/tutorial/body-multiple-params.md | 4 +- docs/zh/docs/tutorial/dependencies/index.md | 4 +- .../tutorial/dependencies/sub-dependencies.md | 2 +- .../path-params-numeric-validations.md | 4 +- .../tutorial/query-params-str-validations.md | 12 +++--- docs/zh/docs/tutorial/response-model.md | 2 +- docs/zh/docs/tutorial/schema-extra-example.md | 2 +- docs_src/additional_responses/tutorial002.py | 4 +- docs_src/additional_responses/tutorial004.py | 4 +- docs_src/background_tasks/tutorial002.py | 4 +- docs_src/body/tutorial001.py | 6 +-- docs_src/body/tutorial002.py | 6 +-- docs_src/body/tutorial003.py | 6 +-- docs_src/body/tutorial004.py | 8 ++-- docs_src/body_multiple_params/tutorial002.py | 8 ++-- docs_src/body_nested_models/tutorial001.py | 6 +-- docs_src/body_nested_models/tutorial002.py | 6 +-- .../body_nested_models/tutorial002_py39.py | 6 +-- docs_src/body_nested_models/tutorial003.py | 6 +-- .../body_nested_models/tutorial003_py39.py | 6 +-- docs_src/body_nested_models/tutorial004.py | 8 ++-- .../body_nested_models/tutorial004_py39.py | 8 ++-- docs_src/body_nested_models/tutorial005.py | 8 ++-- .../body_nested_models/tutorial005_py39.py | 8 ++-- docs_src/body_nested_models/tutorial006.py | 8 ++-- .../body_nested_models/tutorial006_py39.py | 8 ++-- docs_src/body_nested_models/tutorial007.py | 10 ++--- .../body_nested_models/tutorial007_py39.py | 10 ++--- docs_src/body_updates/tutorial001.py | 8 ++-- docs_src/body_updates/tutorial001_py39.py | 8 ++-- docs_src/body_updates/tutorial002.py | 8 ++-- docs_src/body_updates/tutorial002_py39.py | 8 ++-- docs_src/dataclasses/tutorial001.py | 6 +-- docs_src/dataclasses/tutorial002.py | 6 +-- docs_src/dataclasses/tutorial003.py | 4 +- docs_src/dependencies/tutorial001.py | 6 ++- docs_src/dependencies/tutorial002.py | 4 +- docs_src/dependencies/tutorial003.py | 4 +- docs_src/dependencies/tutorial004.py | 4 +- docs_src/dependencies/tutorial005.py | 7 ++-- docs_src/dependency_testing/tutorial001.py | 8 ++-- docs_src/encoder/tutorial001.py | 4 +- docs_src/extra_data_types/tutorial001.py | 10 ++--- docs_src/extra_models/tutorial001.py | 8 ++-- docs_src/extra_models/tutorial002.py | 4 +- docs_src/header_params/tutorial001.py | 4 +- docs_src/header_params/tutorial002.py | 4 +- docs_src/header_params/tutorial003.py | 4 +- docs_src/header_params/tutorial003_py39.py | 4 +- docs_src/nosql_databases/tutorial001.py | 8 ++-- docs_src/openapi_callbacks/tutorial001.py | 6 +-- .../tutorial004.py | 6 +-- .../tutorial001.py | 6 +-- .../tutorial001_py39.py | 6 +-- .../tutorial002.py | 6 +-- .../tutorial002_py39.py | 6 +-- .../tutorial003.py | 6 +-- .../tutorial003_py39.py | 6 +-- .../tutorial004.py | 6 +-- .../tutorial004_py39.py | 6 +-- .../tutorial005.py | 6 +-- .../tutorial005_py39.py | 6 +-- docs_src/python_types/tutorial009c.py | 5 +++ docs_src/python_types/tutorial009c_py310.py | 2 + docs_src/python_types/tutorial011.py | 4 +- docs_src/python_types/tutorial011_py39.py | 4 +- docs_src/python_types/tutorial012.py | 8 ++++ docs_src/query_params/tutorial002.py | 4 +- docs_src/query_params/tutorial003.py | 4 +- docs_src/query_params/tutorial004.py | 4 +- docs_src/query_params/tutorial006.py | 4 +- .../tutorial001.py | 4 +- docs_src/request_files/tutorial001_02.py | 6 +-- docs_src/response_directly/tutorial001.py | 4 +- docs_src/response_model/tutorial001.py | 6 +-- docs_src/response_model/tutorial001_py39.py | 6 +-- docs_src/response_model/tutorial002.py | 4 +- docs_src/response_model/tutorial003.py | 6 +-- docs_src/response_model/tutorial004.py | 4 +- docs_src/response_model/tutorial004_py39.py | 4 +- docs_src/response_model/tutorial005.py | 4 +- docs_src/response_model/tutorial006.py | 4 +- docs_src/schema_extra_example/tutorial001.py | 6 +-- docs_src/schema_extra_example/tutorial002.py | 6 +-- docs_src/schema_extra_example/tutorial003.py | 6 +-- docs_src/schema_extra_example/tutorial004.py | 6 +-- docs_src/security/tutorial002.py | 8 ++-- docs_src/security/tutorial003.py | 8 ++-- docs_src/security/tutorial004.py | 12 +++--- docs_src/security/tutorial005.py | 12 +++--- docs_src/security/tutorial005_py39.py | 12 +++--- docs_src/sql_databases/sql_app/schemas.py | 4 +- .../sql_databases/sql_app_py39/schemas.py | 4 +- .../sql_databases_peewee/sql_app/schemas.py | 4 +- docs_src/websockets/tutorial002.py | 8 ++-- 131 files changed, 489 insertions(+), 426 deletions(-) create mode 100644 docs_src/python_types/tutorial009c.py create mode 100644 docs_src/python_types/tutorial009c_py310.py create mode 100644 docs_src/python_types/tutorial012.py diff --git a/README.md b/README.md index 9ad50f271..5e9e97a2a 100644 --- a/README.md +++ b/README.md @@ -151,7 +151,7 @@ $ pip install "uvicorn[standard]" * Create a file `main.py` with: ```Python -from typing import Optional +from typing import Union from fastapi import FastAPI @@ -164,7 +164,7 @@ def read_root(): @app.get("/items/{item_id}") -def read_item(item_id: int, q: Optional[str] = None): +def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} ``` @@ -174,7 +174,7 @@ def read_item(item_id: int, q: Optional[str] = None): If your code uses `async` / `await`, use `async def`: ```Python hl_lines="9 14" -from typing import Optional +from typing import Union from fastapi import FastAPI @@ -187,7 +187,7 @@ async def read_root(): @app.get("/items/{item_id}") -async def read_item(item_id: int, q: Optional[str] = None): +async def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} ``` @@ -266,7 +266,7 @@ Now modify the file `main.py` to receive a body from a `PUT` request. Declare the body using standard Python types, thanks to Pydantic. ```Python hl_lines="4 9-12 25-27" -from typing import Optional +from typing import Union from fastapi import FastAPI from pydantic import BaseModel @@ -277,7 +277,7 @@ app = FastAPI() class Item(BaseModel): name: str price: float - is_offer: Optional[bool] = None + is_offer: Union[bool, None] = None @app.get("/") @@ -286,7 +286,7 @@ def read_root(): @app.get("/items/{item_id}") -def read_item(item_id: int, q: Optional[str] = None): +def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} diff --git a/docs/de/docs/index.md b/docs/de/docs/index.md index ce13bcc4a..929754462 100644 --- a/docs/de/docs/index.md +++ b/docs/de/docs/index.md @@ -149,7 +149,7 @@ $ pip install uvicorn[standard] * Create a file `main.py` with: ```Python -from typing import Optional +from typing import Union from fastapi import FastAPI @@ -162,7 +162,7 @@ def read_root(): @app.get("/items/{item_id}") -def read_item(item_id: int, q: Optional[str] = None): +def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} ``` @@ -172,7 +172,7 @@ def read_item(item_id: int, q: Optional[str] = None): If your code uses `async` / `await`, use `async def`: ```Python hl_lines="9 14" -from typing import Optional +from typing import Union from fastapi import FastAPI @@ -185,7 +185,7 @@ async def read_root(): @app.get("/items/{item_id}") -async def read_item(item_id: int, q: Optional[str] = None): +async def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} ``` @@ -264,7 +264,7 @@ Now modify the file `main.py` to receive a body from a `PUT` request. Declare the body using standard Python types, thanks to Pydantic. ```Python hl_lines="4 9-12 25-27" -from typing import Optional +from typing import Union from fastapi import FastAPI from pydantic import BaseModel @@ -275,7 +275,7 @@ app = FastAPI() class Item(BaseModel): name: str price: float - is_offer: Optional[bool] = None + is_offer: Union[bool, None] = None @app.get("/") @@ -284,7 +284,7 @@ def read_root(): @app.get("/items/{item_id}") -def read_item(item_id: int, q: Optional[str] = None): +def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} diff --git a/docs/en/docs/advanced/additional-status-codes.md b/docs/en/docs/advanced/additional-status-codes.md index 37ec283ff..b61f88b93 100644 --- a/docs/en/docs/advanced/additional-status-codes.md +++ b/docs/en/docs/advanced/additional-status-codes.md @@ -14,7 +14,7 @@ But you also want it to accept new items. And when the items didn't exist before To achieve that, import `JSONResponse`, and return your content there directly, setting the `status_code` that you want: -```Python hl_lines="4 23" +```Python hl_lines="4 25" {!../../../docs_src/additional_status_codes/tutorial001.py!} ``` diff --git a/docs/en/docs/advanced/testing-dependencies.md b/docs/en/docs/advanced/testing-dependencies.md index 79208e8dc..7bba82fb7 100644 --- a/docs/en/docs/advanced/testing-dependencies.md +++ b/docs/en/docs/advanced/testing-dependencies.md @@ -28,7 +28,7 @@ To override a dependency for testing, you put as a key the original dependency ( And then **FastAPI** will call that override instead of the original dependency. -```Python hl_lines="26-27 30" +```Python hl_lines="28-29 32" {!../../../docs_src/dependency_testing/tutorial001.py!} ``` diff --git a/docs/en/docs/deployment/docker.md b/docs/en/docs/deployment/docker.md index 651b0e840..8a542622e 100644 --- a/docs/en/docs/deployment/docker.md +++ b/docs/en/docs/deployment/docker.md @@ -142,7 +142,7 @@ Successfully installed fastapi pydantic uvicorn * Create a `main.py` file with: ```Python -from typing import Optional +from typing import Union from fastapi import FastAPI @@ -155,7 +155,7 @@ def read_root(): @app.get("/items/{item_id}") -def read_item(item_id: int, q: Optional[str] = None): +def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} ``` diff --git a/docs/en/docs/index.md b/docs/en/docs/index.md index 7de1e50df..17163ba01 100644 --- a/docs/en/docs/index.md +++ b/docs/en/docs/index.md @@ -148,7 +148,7 @@ $ pip install "uvicorn[standard]" * Create a file `main.py` with: ```Python -from typing import Optional +from typing import Union from fastapi import FastAPI @@ -161,7 +161,7 @@ def read_root(): @app.get("/items/{item_id}") -def read_item(item_id: int, q: Optional[str] = None): +def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} ``` @@ -171,7 +171,7 @@ def read_item(item_id: int, q: Optional[str] = None): If your code uses `async` / `await`, use `async def`: ```Python hl_lines="9 14" -from typing import Optional +from typing import Union from fastapi import FastAPI @@ -184,7 +184,7 @@ async def read_root(): @app.get("/items/{item_id}") -async def read_item(item_id: int, q: Optional[str] = None): +async def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} ``` @@ -263,7 +263,7 @@ Now modify the file `main.py` to receive a body from a `PUT` request. Declare the body using standard Python types, thanks to Pydantic. ```Python hl_lines="4 9-12 25-27" -from typing import Optional +from typing import Union from fastapi import FastAPI from pydantic import BaseModel @@ -274,7 +274,7 @@ app = FastAPI() class Item(BaseModel): name: str price: float - is_offer: Optional[bool] = None + is_offer: Union[bool, None] = None @app.get("/") @@ -283,7 +283,7 @@ def read_root(): @app.get("/items/{item_id}") -def read_item(item_id: int, q: Optional[str] = None): +def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} diff --git a/docs/en/docs/python-types.md b/docs/en/docs/python-types.md index 8486ed849..963fcaf1c 100644 --- a/docs/en/docs/python-types.md +++ b/docs/en/docs/python-types.md @@ -317,6 +317,45 @@ This also means that in Python 3.10, you can use `Something | None`: {!> ../../../docs_src/python_types/tutorial009_py310.py!} ``` +#### Using `Union` or `Optional` + +If you are using a Python version below 3.10, here's a tip from my very **subjective** point of view: + +* ๐Ÿšจ Avoid using `Optional[SomeType]` +* Instead โœจ **use `Union[SomeType, None]`** โœจ. + +Both are equivalent and underneath they are the same, but I would recommend `Union` instead of `Optional` because the word "**optional**" would seem to imply that the value is optional, and it actually means "it can be `None`", even if it's not optional and is still required. + +I think `Union[str, SomeType]` is more explicit about what it means. + +It's just about the words and names. But those words can affect how you and your teammates think about the code. + +As an example, let's take this function: + +```Python hl_lines="1 4" +{!../../../docs_src/python_types/tutorial009c.py!} +``` + +The parameter `name` is defined as `Optional[str]`, but it is **not optional**, you cannot call the function without the parameter: + +```Python +say_hi() # Oh, no, this throws an error! ๐Ÿ˜ฑ +``` + +The `name` parameter is **still required** (not *optional*) because it doesn't have a default value. Still, `name` accepts `None` as the value: + +```Python +say_hi(name=None) # This works, None is valid ๐ŸŽ‰ +``` + +The good news is, once you are on Python 3.10 you won't have to worry about that, as you will be able to simply use `|` to define unions of types: + +```Python hl_lines="1 4" +{!../../../docs_src/python_types/tutorial009c_py310.py!} +``` + +And then you won't have to worry about names like `Optional` and `Union`. ๐Ÿ˜Ž + #### Generic types These types that take type parameters in square brackets are called **Generic types** or **Generics**, for example: @@ -422,6 +461,9 @@ An example from the official Pydantic docs: You will see a lot more of all this in practice in the [Tutorial - User Guide](tutorial/index.md){.internal-link target=_blank}. +!!! tip + Pydantic has a special behavior when you use `Optional` or `Union[Something, None]` without a default value, you can read more about it in the Pydantic docs about Required Optional fields. + ## Type hints in **FastAPI** **FastAPI** takes advantage of these type hints to do several things. diff --git a/docs/en/docs/tutorial/body-multiple-params.md b/docs/en/docs/tutorial/body-multiple-params.md index 13de4c8ea..31dd27fed 100644 --- a/docs/en/docs/tutorial/body-multiple-params.md +++ b/docs/en/docs/tutorial/body-multiple-params.md @@ -89,13 +89,13 @@ But you can instruct **FastAPI** to treat it as another body key using `Body`: === "Python 3.6 and above" - ```Python hl_lines="23" + ```Python hl_lines="22" {!> ../../../docs_src/body_multiple_params/tutorial003.py!} ``` === "Python 3.10 and above" - ```Python hl_lines="21" + ```Python hl_lines="20" {!> ../../../docs_src/body_multiple_params/tutorial003_py310.py!} ``` @@ -126,7 +126,7 @@ Of course, you can also declare additional query parameters whenever you need, a As, by default, singular values are interpreted as query parameters, you don't have to explicitly add a `Query`, you can just do: ```Python -q: Optional[str] = None +q: Union[str, None] = None ``` Or in Python 3.10 and above: @@ -139,7 +139,7 @@ For example: === "Python 3.6 and above" - ```Python hl_lines="28" + ```Python hl_lines="27" {!> ../../../docs_src/body_multiple_params/tutorial004.py!} ``` @@ -152,7 +152,6 @@ For example: !!! info `Body` also has all the same extra validation and metadata parameters as `Query`,`Path` and others you will see later. - ## Embed a single body parameter Let's say you only have a single `item` body parameter from a Pydantic model `Item`. @@ -162,7 +161,7 @@ By default, **FastAPI** will then expect its body directly. But if you want it to expect a JSON with a key `item` and inside of it the model contents, as it does when you declare extra body parameters, you can use the special `Body` parameter `embed`: ```Python -item: Item = Body(..., embed=True) +item: Item = Body(embed=True) ``` as in: diff --git a/docs/en/docs/tutorial/body.md b/docs/en/docs/tutorial/body.md index eb21f29a8..509005936 100644 --- a/docs/en/docs/tutorial/body.md +++ b/docs/en/docs/tutorial/body.md @@ -206,7 +206,7 @@ The function parameters will be recognized as follows: !!! note FastAPI will know that the value of `q` is not required because of the default value `= None`. - The `Optional` in `Optional[str]` is not used by FastAPI, but will allow your editor to give you better support and detect errors. + The `Union` in `Union[str, None]` is not used by FastAPI, but will allow your editor to give you better support and detect errors. ## Without Pydantic diff --git a/docs/en/docs/tutorial/dependencies/classes-as-dependencies.md b/docs/en/docs/tutorial/dependencies/classes-as-dependencies.md index 663fff15b..fb41ba1f6 100644 --- a/docs/en/docs/tutorial/dependencies/classes-as-dependencies.md +++ b/docs/en/docs/tutorial/dependencies/classes-as-dependencies.md @@ -109,7 +109,7 @@ Pay attention to the `__init__` method used to create the instance of the class: === "Python 3.6 and above" - ```Python hl_lines="8" + ```Python hl_lines="9" {!> ../../../docs_src/dependencies/tutorial001.py!} ``` diff --git a/docs/en/docs/tutorial/dependencies/index.md b/docs/en/docs/tutorial/dependencies/index.md index fe10facfb..5078c0096 100644 --- a/docs/en/docs/tutorial/dependencies/index.md +++ b/docs/en/docs/tutorial/dependencies/index.md @@ -33,7 +33,7 @@ It is just a function that can take all the same parameters that a *path operati === "Python 3.6 and above" - ```Python hl_lines="8-9" + ```Python hl_lines="8-11" {!> ../../../docs_src/dependencies/tutorial001.py!} ``` @@ -81,7 +81,7 @@ The same way you use `Body`, `Query`, etc. with your *path operation function* p === "Python 3.6 and above" - ```Python hl_lines="13 18" + ```Python hl_lines="15 20" {!> ../../../docs_src/dependencies/tutorial001.py!} ``` diff --git a/docs/en/docs/tutorial/dependencies/sub-dependencies.md b/docs/en/docs/tutorial/dependencies/sub-dependencies.md index 51531228d..a5b40c9ad 100644 --- a/docs/en/docs/tutorial/dependencies/sub-dependencies.md +++ b/docs/en/docs/tutorial/dependencies/sub-dependencies.md @@ -55,7 +55,7 @@ Then we can use the dependency with: === "Python 3.6 and above" - ```Python hl_lines="21" + ```Python hl_lines="22" {!> ../../../docs_src/dependencies/tutorial005.py!} ``` diff --git a/docs/en/docs/tutorial/path-params-numeric-validations.md b/docs/en/docs/tutorial/path-params-numeric-validations.md index 31bf91a0e..29235c6e2 100644 --- a/docs/en/docs/tutorial/path-params-numeric-validations.md +++ b/docs/en/docs/tutorial/path-params-numeric-validations.md @@ -59,7 +59,7 @@ It doesn't matter for **FastAPI**. It will detect the parameters by their names, So, you can declare your function as: -```Python hl_lines="8" +```Python hl_lines="7" {!../../../docs_src/path_params_numeric_validations/tutorial002.py!} ``` @@ -71,7 +71,7 @@ Pass `*`, as the first parameter of the function. Python won't do anything with that `*`, but it will know that all the following parameters should be called as keyword arguments (key-value pairs), also known as kwargs. Even if they don't have a default value. -```Python hl_lines="8" +```Python hl_lines="7" {!../../../docs_src/path_params_numeric_validations/tutorial003.py!} ``` diff --git a/docs/en/docs/tutorial/response-model.md b/docs/en/docs/tutorial/response-model.md index c751a9256..e371e86e4 100644 --- a/docs/en/docs/tutorial/response-model.md +++ b/docs/en/docs/tutorial/response-model.md @@ -162,7 +162,7 @@ Your response model could have default values, like: {!> ../../../docs_src/response_model/tutorial004_py310.py!} ``` -* `description: Optional[str] = None` has a default of `None`. +* `description: Union[str, None] = None` has a default of `None`. * `tax: float = 10.5` has a default of `10.5`. * `tags: List[str] = []` as a default of an empty list: `[]`. diff --git a/docs/en/docs/tutorial/schema-extra-example.md b/docs/en/docs/tutorial/schema-extra-example.md index c69df51dc..94347018d 100644 --- a/docs/en/docs/tutorial/schema-extra-example.md +++ b/docs/en/docs/tutorial/schema-extra-example.md @@ -68,13 +68,13 @@ Here we pass an `example` of the data expected in `Body()`: === "Python 3.6 and above" - ```Python hl_lines="21-26" + ```Python hl_lines="20-25" {!> ../../../docs_src/schema_extra_example/tutorial003.py!} ``` === "Python 3.10 and above" - ```Python hl_lines="19-24" + ```Python hl_lines="18-23" {!> ../../../docs_src/schema_extra_example/tutorial003_py310.py!} ``` @@ -99,13 +99,13 @@ Each specific example `dict` in the `examples` can contain: === "Python 3.6 and above" - ```Python hl_lines="22-48" + ```Python hl_lines="21-47" {!> ../../../docs_src/schema_extra_example/tutorial004.py!} ``` === "Python 3.10 and above" - ```Python hl_lines="20-46" + ```Python hl_lines="19-45" {!> ../../../docs_src/schema_extra_example/tutorial004_py310.py!} ``` diff --git a/docs/es/docs/advanced/additional-status-codes.md b/docs/es/docs/advanced/additional-status-codes.md index 67224fb36..1f28ea85b 100644 --- a/docs/es/docs/advanced/additional-status-codes.md +++ b/docs/es/docs/advanced/additional-status-codes.md @@ -14,7 +14,7 @@ Pero tambiรฉn quieres que acepte nuevos รญtems. Cuando los รญtems no existan ant Para conseguir esto importa `JSONResponse` y devuelve ahรญ directamente tu contenido, asignando el `status_code` que quieras: -```Python hl_lines="2 19" +```Python hl_lines="4 25" {!../../../docs_src/additional_status_codes/tutorial001.py!} ``` diff --git a/docs/es/docs/index.md b/docs/es/docs/index.md index 1fa79fdde..ef4850b56 100644 --- a/docs/es/docs/index.md +++ b/docs/es/docs/index.md @@ -145,7 +145,7 @@ $ pip install uvicorn[standard] ```Python from fastapi import FastAPI -from typing import Optional +from typing import Union app = FastAPI() @@ -156,7 +156,7 @@ def read_root(): @app.get("/items/{item_id}") -def read_item(item_id: int, q: Optional[str] = None): +def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} ``` @@ -167,7 +167,7 @@ Si tu cรณdigo usa `async` / `await`, usa `async def`: ```Python hl_lines="7 12" from fastapi import FastAPI -from typing import Optional +from typing import Union app = FastAPI() @@ -178,7 +178,7 @@ async def read_root(): @app.get("/items/{item_id}") -async def read_item(item_id: int, q: Optional[str] = None): +async def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} ``` @@ -259,7 +259,7 @@ Declara el body usando las declaraciones de tipo estรกndares de Python gracias a ```Python hl_lines="2 7-10 23-25" from fastapi import FastAPI from pydantic import BaseModel -from typing import Optional +from typing import Union app = FastAPI() @@ -267,7 +267,7 @@ app = FastAPI() class Item(BaseModel): name: str price: float - is_offer: Optional[bool] = None + is_offer: Union[bool, None] = None @app.get("/") @@ -276,7 +276,7 @@ def read_root(): @app.get("/items/{item_id}") -def read_item(item_id: int, q: Optional[str] = None): +def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} diff --git a/docs/es/docs/tutorial/query-params.md b/docs/es/docs/tutorial/query-params.md index 69caee6e8..482af8dc0 100644 --- a/docs/es/docs/tutorial/query-params.md +++ b/docs/es/docs/tutorial/query-params.md @@ -75,7 +75,7 @@ En este caso el parรกmetro de la funciรณn `q` serรก opcional y serรก `None` por !!! note "Nota" FastAPI sabrรก que `q` es opcional por el `= None`. - El `Optional` en `Optional[str]` no es usado por FastAPI (FastAPI solo usarรก la parte `str`), pero el `Optional[str]` le permitirรก a tu editor ayudarte a encontrar errores en tu cรณdigo. + El `Union` en `Union[str, None]` no es usado por FastAPI (FastAPI solo usarรก la parte `str`), pero el `Union[str, None]` le permitirรก a tu editor ayudarte a encontrar errores en tu cรณdigo. ## Conversiรณn de tipos de parรกmetros de query diff --git a/docs/fa/docs/index.md b/docs/fa/docs/index.md index 0070de179..fd52f994c 100644 --- a/docs/fa/docs/index.md +++ b/docs/fa/docs/index.md @@ -152,7 +152,7 @@ $ pip install "uvicorn[standard]" * Create a file `main.py` with: ```Python -from typing import Optional +from typing import Union from fastapi import FastAPI @@ -165,7 +165,7 @@ def read_root(): @app.get("/items/{item_id}") -def read_item(item_id: int, q: Optional[str] = None): +def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} ``` @@ -175,7 +175,7 @@ def read_item(item_id: int, q: Optional[str] = None): If your code uses `async` / `await`, use `async def`: ```Python hl_lines="9 14" -from typing import Optional +from typing import Union from fastapi import FastAPI @@ -188,7 +188,7 @@ async def read_root(): @app.get("/items/{item_id}") -async def read_item(item_id: int, q: Optional[str] = None): +async def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} ``` @@ -267,7 +267,7 @@ Now modify the file `main.py` to receive a body from a `PUT` request. Declare the body using standard Python types, thanks to Pydantic. ```Python hl_lines="4 9-12 25-27" -from typing import Optional +from typing import Union from fastapi import FastAPI from pydantic import BaseModel @@ -278,7 +278,7 @@ app = FastAPI() class Item(BaseModel): name: str price: float - is_offer: Optional[bool] = None + is_offer: Union[bool, None] = None @app.get("/") @@ -287,7 +287,7 @@ def read_root(): @app.get("/items/{item_id}") -def read_item(item_id: int, q: Optional[str] = None): +def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} diff --git a/docs/fr/docs/index.md b/docs/fr/docs/index.md index 0b537054e..f713ee96b 100644 --- a/docs/fr/docs/index.md +++ b/docs/fr/docs/index.md @@ -149,7 +149,7 @@ $ pip install uvicorn[standard] * Create a file `main.py` with: ```Python -from typing import Optional +from typing import Union from fastapi import FastAPI @@ -162,7 +162,7 @@ def read_root(): @app.get("/items/{item_id}") -def read_item(item_id: int, q: Optional[str] = None): +def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} ``` @@ -172,7 +172,7 @@ def read_item(item_id: int, q: Optional[str] = None): If your code uses `async` / `await`, use `async def`: ```Python hl_lines="9 14" -from typing import Optional +from typing import Union from fastapi import FastAPI @@ -185,7 +185,7 @@ async def read_root(): @app.get("/items/{item_id}") -async def read_item(item_id: int, q: Optional[str] = None): +async def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} ``` @@ -264,7 +264,7 @@ Now modify the file `main.py` to receive a body from a `PUT` request. Declare the body using standard Python types, thanks to Pydantic. ```Python hl_lines="4 9 10 11 12 25 26 27" -from typing import Optional +from typing import Union from fastapi import FastAPI from pydantic import BaseModel @@ -275,7 +275,7 @@ app = FastAPI() class Item(BaseModel): name: str price: float - is_offer: Optional[bool] = None + is_offer: Union[bool, None] = None @app.get("/") @@ -284,7 +284,7 @@ def read_root(): @app.get("/items/{item_id}") -def read_item(item_id: int, q: Optional[str] = None): +def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} diff --git a/docs/ja/docs/advanced/additional-status-codes.md b/docs/ja/docs/advanced/additional-status-codes.md index 6c03cd92b..d1f8e6451 100644 --- a/docs/ja/docs/advanced/additional-status-codes.md +++ b/docs/ja/docs/advanced/additional-status-codes.md @@ -14,7 +14,7 @@ ใ“ใ‚Œใ‚’้”ๆˆใ™ใ‚‹ใซใฏใ€ `JSONResponse` ใ‚’ใ‚คใƒณใƒใƒผใƒˆใ—ใ€ `status_code` ใ‚’่จญๅฎšใ—ใฆ็›ดๆŽฅๅ†…ๅฎนใ‚’่ฟ”ใ—ใพใ™ใ€‚ -```Python hl_lines="4 23" +```Python hl_lines="4 25" {!../../../docs_src/additional_status_codes/tutorial001.py!} ``` diff --git a/docs/ja/docs/tutorial/query-params-str-validations.md b/docs/ja/docs/tutorial/query-params-str-validations.md index ff0af725f..8d375d7ce 100644 --- a/docs/ja/docs/tutorial/query-params-str-validations.md +++ b/docs/ja/docs/tutorial/query-params-str-validations.md @@ -34,12 +34,12 @@ {!../../../docs_src/query_params_str_validations/tutorial002.py!} ``` -ใƒ‡ใƒ•ใ‚ฉใƒซใƒˆๅ€ค`None`ใ‚’`Query(None)`ใซ็ฝฎใๆ›ใˆใ‚‹ๅฟ…่ฆใŒใ‚ใ‚‹ใฎใงใ€`Query`ใฎๆœ€ๅˆใฎๅผ•ๆ•ฐใฏใƒ‡ใƒ•ใ‚ฉใƒซใƒˆๅ€คใ‚’ๅฎš็พฉใ™ใ‚‹ใฎใจๅŒใ˜ใงใ™ใ€‚ +ใƒ‡ใƒ•ใ‚ฉใƒซใƒˆๅ€ค`None`ใ‚’`Query(default=None)`ใซ็ฝฎใๆ›ใˆใ‚‹ๅฟ…่ฆใŒใ‚ใ‚‹ใฎใงใ€`Query`ใฎๆœ€ๅˆใฎๅผ•ๆ•ฐใฏใƒ‡ใƒ•ใ‚ฉใƒซใƒˆๅ€คใ‚’ๅฎš็พฉใ™ใ‚‹ใฎใจๅŒใ˜ใงใ™ใ€‚ ใชใฎใง: ```Python -q: Optional[str] = Query(None) +q: Optional[str] = Query(default=None) ``` ...ใ‚’ไปฅไธ‹ใจๅŒใ˜ใ‚ˆใ†ใซใƒ‘ใƒฉใƒกใƒผใ‚ฟใ‚’ใ‚ชใƒ—ใ‚ทใƒงใƒณใซใ—ใพใ™: @@ -60,7 +60,7 @@ q: Optional[str] = None ใ‚‚ใ—ใใฏ: ```Python - = Query(None) + = Query(default=None) ``` ใใ—ใฆใ€ `None` ใ‚’ๅˆฉ็”จใ™ใ‚‹ใ“ใจใงใ‚ฏใ‚จใƒชใƒ‘ใƒฉใƒกใƒผใ‚ฟใŒๅฟ…้ ˆใงใฏใชใ„ใจๆคœ็Ÿฅใ—ใพใ™ใ€‚ @@ -70,7 +70,7 @@ q: Optional[str] = None ใใ—ใฆใ€ใ•ใ‚‰ใซๅคšใใฎใƒ‘ใƒฉใƒกใƒผใ‚ฟใ‚’`Query`ใซๆธกใ™ใ“ใจใŒใงใใพใ™ใ€‚ใ“ใฎๅ ดๅˆใ€ๆ–‡ๅญ—ๅˆ—ใซ้ฉ็”จใ•ใ‚Œใ‚‹ใ€`max_length`ใƒ‘ใƒฉใƒกใƒผใ‚ฟใ‚’ๆŒ‡ๅฎšใ—ใพใ™ใ€‚ ```Python -q: str = Query(None, max_length=50) +q: Union[str, None] = Query(default=None, max_length=50) ``` ใ“ใ‚Œใซใ‚ˆใ‚Šใ€ใƒ‡ใƒผใ‚ฟใ‚’ๆคœ่จผใ—ใ€ใƒ‡ใƒผใ‚ฟใŒๆœ‰ๅŠนใงใชใ„ๅ ดๅˆใฏๆ˜Ž็ขบใชใ‚จใƒฉใƒผใ‚’่กจ็คบใ—ใ€OpenAPIใ‚นใ‚ญใƒผใƒžใฎใ€€*path operation* ใซใƒ‘ใƒฉใƒกใƒผใ‚ฟใ‚’่จ˜่ผ‰ใ—ใพใ™ใ€‚ @@ -79,7 +79,7 @@ q: str = Query(None, max_length=50) ใƒ‘ใƒฉใƒกใƒผใ‚ฟ`min_length`ใ‚‚่ฟฝๅŠ ใ™ใ‚‹ใ“ใจใŒใงใใพใ™: -```Python hl_lines="9" +```Python hl_lines="10" {!../../../docs_src/query_params_str_validations/tutorial003.py!} ``` @@ -87,7 +87,7 @@ q: str = Query(None, max_length=50) ใƒ‘ใƒฉใƒกใƒผใ‚ฟใŒไธ€่‡ดใ™ใ‚‹ในใๆญฃ่ฆ่กจ็พใ‚’ๅฎš็พฉใ™ใ‚‹ใ“ใจใŒใงใใพใ™: -```Python hl_lines="10" +```Python hl_lines="11" {!../../../docs_src/query_params_str_validations/tutorial004.py!} ``` @@ -125,13 +125,13 @@ q: str ไปฅไธ‹ใฎไปฃใ‚ใ‚Šใซ: ```Python -q: Optional[str] = None +q: Union[str, None] = None ``` ็พๅœจใฏไปฅไธ‹ใฎไพ‹ใฎใ‚ˆใ†ใซ`Query`ใงๅฎฃ่จ€ใ—ใฆใ„ใพใ™: ```Python -q: Optional[str] = Query(None, min_length=3) +q: Union[str, None] = Query(default=None, min_length=3) ``` ใใฎใŸใ‚ใ€`Query`ใ‚’ไฝฟ็”จใ—ใฆๅฟ…้ ˆใฎๅ€คใ‚’ๅฎฃ่จ€ใ™ใ‚‹ๅฟ…่ฆใŒใ‚ใ‚‹ๅ ดๅˆใฏใ€็ฌฌไธ€ๅผ•ๆ•ฐใซ`...`ใ‚’ไฝฟ็”จใ™ใ‚‹ใ“ใจใŒใงใใพใ™: diff --git a/docs/ko/docs/index.md b/docs/ko/docs/index.md index 284628955..ec4422994 100644 --- a/docs/ko/docs/index.md +++ b/docs/ko/docs/index.md @@ -145,7 +145,7 @@ $ pip install uvicorn[standard] * `main.py` ํŒŒ์ผ์„ ๋งŒ๋“œ์‹ญ์‹œ์˜ค: ```Python -from typing import Optional +from typing import Union from fastapi import FastAPI @@ -158,7 +158,7 @@ def read_root(): @app.get("/items/{item_id}") -def read_item(item_id: int, q: Optional[str] = None): +def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} ``` @@ -168,7 +168,7 @@ def read_item(item_id: int, q: Optional[str] = None): ์—ฌ๋Ÿฌ๋ถ„์˜ ์ฝ”๋“œ๊ฐ€ `async` / `await`์„ ์‚ฌ์šฉํ•œ๋‹ค๋ฉด, `async def`๋ฅผ ์‚ฌ์šฉํ•˜์‹ญ์‹œ์˜ค. ```Python hl_lines="9 14" -from typing import Optional +from typing import Union from fastapi import FastAPI @@ -181,7 +181,7 @@ async def read_root(): @app.get("/items/{item_id}") -async def read_item(item_id: int, q: Optional[str] = None): +async def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} ``` @@ -260,7 +260,7 @@ INFO: Application startup complete. Pydantic์„ ์ด์šฉํ•ด ํŒŒ์ด์ฌ ํ‘œ์ค€ ํƒ€์ž…์œผ๋กœ ๋ณธ๋ฌธ์„ ์„ ์–ธํ•ฉ๋‹ˆ๋‹ค. ```Python hl_lines="4 9 10 11 12 25 26 27" -from typing import Optional +from typing import Union from fastapi import FastAPI from pydantic import BaseModel @@ -271,7 +271,7 @@ app = FastAPI() class Item(BaseModel): name: str price: float - is_offer: Optional[bool] = None + is_offer: Union[bool, None] = None @app.get("/") @@ -280,7 +280,7 @@ def read_root(): @app.get("/items/{item_id}") -def read_item(item_id: int, q: Optional[str] = None): +def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} diff --git a/docs/ko/docs/tutorial/path-params-numeric-validations.md b/docs/ko/docs/tutorial/path-params-numeric-validations.md index abb9d03db..cadf543fc 100644 --- a/docs/ko/docs/tutorial/path-params-numeric-validations.md +++ b/docs/ko/docs/tutorial/path-params-numeric-validations.md @@ -43,7 +43,7 @@ ๋”ฐ๋ผ์„œ ํ•จ์ˆ˜๋ฅผ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์„ ์–ธ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค: -```Python hl_lines="8" +```Python hl_lines="7" {!../../../docs_src/path_params_numeric_validations/tutorial002.py!} ``` @@ -55,7 +55,7 @@ ํŒŒ์ด์ฌ์€ `*`์œผ๋กœ ์•„๋ฌด๋Ÿฐ ํ–‰๋™๋„ ํ•˜์ง€ ์•Š์ง€๋งŒ, ๋”ฐ๋ฅด๋Š” ๋งค๊ฐœ๋ณ€์ˆ˜๋“ค์€ kwargs๋กœ๋„ ์•Œ๋ ค์ง„ ํ‚ค์›Œ๋“œ ์ธ์ž(ํ‚ค-๊ฐ’ ์Œ)์—ฌ์•ผ ํ•จ์„ ์ธ์ง€ํ•ฉ๋‹ˆ๋‹ค. ๊ธฐ๋ณธ๊ฐ’์„ ๊ฐ€์ง€๊ณ  ์žˆ์ง€ ์•Š๋”๋ผ๋„ ๊ทธ๋ ‡์Šต๋‹ˆ๋‹ค. -```Python hl_lines="8" +```Python hl_lines="7" {!../../../docs_src/path_params_numeric_validations/tutorial003.py!} ``` diff --git a/docs/ko/docs/tutorial/query-params.md b/docs/ko/docs/tutorial/query-params.md index 05f2ff9c9..bb631e6ff 100644 --- a/docs/ko/docs/tutorial/query-params.md +++ b/docs/ko/docs/tutorial/query-params.md @@ -75,7 +75,7 @@ http://127.0.0.1:8000/items/?skip=20 !!! note "์ฐธ๊ณ " FastAPI๋Š” `q`๊ฐ€ `= None`์ด๋ฏ€๋กœ ์„ ํƒ์ ์ด๋ผ๋Š” ๊ฒƒ์„ ์ธ์ง€ํ•ฉ๋‹ˆ๋‹ค. - `Optional[str]`์— ์žˆ๋Š” `Optional`์€ FastAPI(FastAPI๋Š” `str` ๋ถ€๋ถ„๋งŒ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค)๊ฐ€ ์‚ฌ์šฉํ•˜๋Š”๊ฒŒ ์•„๋‹ˆ์ง€๋งŒ, `Optional[str]`์€ ํŽธ์ง‘๊ธฐ์—๊ฒŒ ์ฝ”๋“œ์—์„œ ์˜ค๋ฅ˜๋ฅผ ์ฐพ์•„๋‚ผ ์ˆ˜ ์žˆ๊ฒŒ ๋„์™€์ค๋‹ˆ๋‹ค. + `Union[str, None]`์— ์žˆ๋Š” `Union`์€ FastAPI(FastAPI๋Š” `str` ๋ถ€๋ถ„๋งŒ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค)๊ฐ€ ์‚ฌ์šฉํ•˜๋Š”๊ฒŒ ์•„๋‹ˆ์ง€๋งŒ, `Union[str, None]`์€ ํŽธ์ง‘๊ธฐ์—๊ฒŒ ์ฝ”๋“œ์—์„œ ์˜ค๋ฅ˜๋ฅผ ์ฐพ์•„๋‚ผ ์ˆ˜ ์žˆ๊ฒŒ ๋„์™€์ค๋‹ˆ๋‹ค. ## ์ฟผ๋ฆฌ ๋งค๊ฐœ๋ณ€์ˆ˜ ํ˜•๋ณ€ํ™˜ diff --git a/docs/nl/docs/index.md b/docs/nl/docs/index.md index 0070de179..fd52f994c 100644 --- a/docs/nl/docs/index.md +++ b/docs/nl/docs/index.md @@ -152,7 +152,7 @@ $ pip install "uvicorn[standard]" * Create a file `main.py` with: ```Python -from typing import Optional +from typing import Union from fastapi import FastAPI @@ -165,7 +165,7 @@ def read_root(): @app.get("/items/{item_id}") -def read_item(item_id: int, q: Optional[str] = None): +def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} ``` @@ -175,7 +175,7 @@ def read_item(item_id: int, q: Optional[str] = None): If your code uses `async` / `await`, use `async def`: ```Python hl_lines="9 14" -from typing import Optional +from typing import Union from fastapi import FastAPI @@ -188,7 +188,7 @@ async def read_root(): @app.get("/items/{item_id}") -async def read_item(item_id: int, q: Optional[str] = None): +async def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} ``` @@ -267,7 +267,7 @@ Now modify the file `main.py` to receive a body from a `PUT` request. Declare the body using standard Python types, thanks to Pydantic. ```Python hl_lines="4 9-12 25-27" -from typing import Optional +from typing import Union from fastapi import FastAPI from pydantic import BaseModel @@ -278,7 +278,7 @@ app = FastAPI() class Item(BaseModel): name: str price: float - is_offer: Optional[bool] = None + is_offer: Union[bool, None] = None @app.get("/") @@ -287,7 +287,7 @@ def read_root(): @app.get("/items/{item_id}") -def read_item(item_id: int, q: Optional[str] = None): +def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} diff --git a/docs/pl/docs/index.md b/docs/pl/docs/index.md index 4a300ae63..bbe1b1ad1 100644 --- a/docs/pl/docs/index.md +++ b/docs/pl/docs/index.md @@ -144,7 +144,7 @@ $ pip install uvicorn[standard] * Utwรณrz plik o nazwie `main.py` z: ```Python -from typing import Optional +from typing import Union from fastapi import FastAPI @@ -157,7 +157,7 @@ def read_root(): @app.get("/items/{item_id}") -def read_item(item_id: int, q: Optional[str] = None): +def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} ``` @@ -167,7 +167,7 @@ def read_item(item_id: int, q: Optional[str] = None): Jeลผeli twรณj kod korzysta z `async` / `await`, uลผyj `async def`: ```Python hl_lines="9 14" -from typing import Optional +from typing import Union from fastapi import FastAPI @@ -180,7 +180,7 @@ async def read_root(): @app.get("/items/{item_id}") -async def read_item(item_id: int, q: Optional[str] = None): +async def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} ``` @@ -258,7 +258,7 @@ Zmodyfikuj teraz plik `main.py`, aby otrzmywaล‚ treล›ฤ‡ (body) ลผฤ…dania `PUT`. Zadeklaruj treล›ฤ‡ ลผฤ…dania, uลผywajฤ…c standardowych typรณw w Pythonie dziฤ™ki Pydantic. ```Python hl_lines="4 9-12 25-27" -from typing import Optional +from typing import Union from fastapi import FastAPI from pydantic import BaseModel @@ -269,7 +269,7 @@ app = FastAPI() class Item(BaseModel): name: str price: float - is_offer: Optional[bool] = None + is_offer: Union[bool, None] = None @app.get("/") @@ -278,7 +278,7 @@ def read_root(): @app.get("/items/{item_id}") -def read_item(item_id: int, q: Optional[str] = None): +def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} diff --git a/docs/pt/docs/index.md b/docs/pt/docs/index.md index c1a0dbf0d..b1d0c89f2 100644 --- a/docs/pt/docs/index.md +++ b/docs/pt/docs/index.md @@ -138,7 +138,7 @@ $ pip install uvicorn[standard] * Crie um arquivo `main.py` com: ```Python -from typing import Optional +from typing import Union from fastapi import FastAPI @@ -151,7 +151,7 @@ def read_root(): @app.get("/items/{item_id}") -def read_item(item_id: int, q: Optional[str] = None): +def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} ``` @@ -161,7 +161,7 @@ def read_item(item_id: int, q: Optional[str] = None): Se seu cรณdigo utiliza `async` / `await`, use `async def`: ```Python hl_lines="9 14" -from typing import Optional +from typing import Union from fastapi import FastAPI @@ -174,7 +174,7 @@ async def read_root(): @app.get("/items/{item_id}") -async def read_item(item_id: int, q: Optional[str] = None): +async def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} ``` @@ -253,6 +253,8 @@ Agora modifique o arquivo `main.py` para receber um corpo para uma requisiรงรฃo Declare o corpo utilizando tipos padrรฃo Python, graรงas ao Pydantic. ```Python hl_lines="4 9-12 25-27" +from typing import Union + from fastapi import FastAPI from pydantic import BaseModel @@ -262,7 +264,7 @@ app = FastAPI() class Item(BaseModel): name: str price: float - is_offer: Optional[bool] = None + is_offer: Union[bool] = None @app.get("/") @@ -271,7 +273,7 @@ def read_root(): @app.get("/items/{item_id}") -def read_item(item_id: int, q: Optional[str] = None): +def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} diff --git a/docs/pt/docs/tutorial/body.md b/docs/pt/docs/tutorial/body.md index 5abc91177..99e05ab77 100644 --- a/docs/pt/docs/tutorial/body.md +++ b/docs/pt/docs/tutorial/body.md @@ -158,7 +158,7 @@ Os parรขmetros da funรงรฃo serรฃo reconhecidos conforme abaixo: !!! note "Observaรงรฃo" O FastAPI saberรก que o valor de `q` nรฃo รฉ obrigatรณrio por causa do valor padrรฃo `= None`. - O `Optional` em `Optional[str]` nรฃo รฉ utilizado pelo FastAPI, mas permite ao seu editor de texto lhe dar um suporte melhor e detectar erros. + O `Union` em `Union[str, None]` nรฃo รฉ utilizado pelo FastAPI, mas permite ao seu editor de texto lhe dar um suporte melhor e detectar erros. ## Sem o Pydantic diff --git a/docs/pt/docs/tutorial/query-params-str-validations.md b/docs/pt/docs/tutorial/query-params-str-validations.md index baac5f493..9a9e071db 100644 --- a/docs/pt/docs/tutorial/query-params-str-validations.md +++ b/docs/pt/docs/tutorial/query-params-str-validations.md @@ -8,12 +8,12 @@ Vamos utilizar essa aplicaรงรฃo como exemplo: {!../../../docs_src/query_params_str_validations/tutorial001.py!} ``` -O parรขmetro de consulta `q` รฉ do tipo `Optional[str]`, o que significa que รฉ do tipo `str` mas que tambรฉm pode ser `None`, e de fato, o valor padrรฃo รฉ `None`, entรฃo o FastAPI saberรก que nรฃo รฉ obrigatรณrio. +O parรขmetro de consulta `q` รฉ do tipo `Union[str, None]`, o que significa que รฉ do tipo `str` mas que tambรฉm pode ser `None`, e de fato, o valor padrรฃo รฉ `None`, entรฃo o FastAPI saberรก que nรฃo รฉ obrigatรณrio. !!! note "Observaรงรฃo" O FastAPI saberรก que o valor de `q` nรฃo รฉ obrigatรณrio por causa do valor padrรฃo `= None`. - O `Optional` em `Optional[str]` nรฃo รฉ usado pelo FastAPI, mas permitirรก que seu editor lhe dรช um melhor suporte e detecte erros. + O `Union` em `Union[str, None]` nรฃo รฉ usado pelo FastAPI, mas permitirรก que seu editor lhe dรช um melhor suporte e detecte erros. ## Validaรงรฃo adicional @@ -35,18 +35,18 @@ Agora utilize-o como valor padrรฃo do seu parรขmetro, definindo o parรขmetro `ma {!../../../docs_src/query_params_str_validations/tutorial002.py!} ``` -Note que substituรญmos o valor padrรฃo de `None` para `Query(None)`, o primeiro parรขmetro de `Query` serve para o mesmo propรณsito: definir o valor padrรฃo do parรขmetro. +Note que substituรญmos o valor padrรฃo de `None` para `Query(default=None)`, o primeiro parรขmetro de `Query` serve para o mesmo propรณsito: definir o valor padrรฃo do parรขmetro. Entรฃo: ```Python -q: Optional[str] = Query(None) +q: Union[str, None] = Query(default=None) ``` ...Torna o parรขmetro opcional, da mesma maneira que: ```Python -q: Optional[str] = None +q: Union[str, None] = None ``` Mas o declara explicitamente como um parรขmetro de consulta. @@ -61,17 +61,17 @@ Mas o declara explicitamente como um parรขmetro de consulta. Ou com: ```Python - = Query(None) + = Query(default=None) ``` E irรก utilizar o `None` para detectar que o parรขmetro de consulta nรฃo รฉ obrigatรณrio. - O `Optional` รฉ apenas para permitir que seu editor de texto lhe dรช um melhor suporte. + O `Union` รฉ apenas para permitir que seu editor de texto lhe dรช um melhor suporte. Entรฃo, podemos passar mais parรขmetros para `Query`. Neste caso, o parรขmetro `max_length` que se aplica a textos: ```Python -q: str = Query(None, max_length=50) +q: str = Query(default=None, max_length=50) ``` Isso irรก validar os dados, mostrar um erro claro quando os dados forem invรกlidos, e documentar o parรขmetro na *operaรงรฃo de rota* do esquema OpenAPI.. @@ -80,7 +80,7 @@ Isso irรก validar os dados, mostrar um erro claro quando os dados forem invรกlid Vocรช tambรฉm pode incluir um parรขmetro `min_length`: -```Python hl_lines="9" +```Python hl_lines="10" {!../../../docs_src/query_params_str_validations/tutorial003.py!} ``` @@ -88,7 +88,7 @@ Vocรช tambรฉm pode incluir um parรขmetro `min_length`: Vocรช pode definir uma expressรฃo regular que combine com um padrรฃo esperado pelo parรขmetro: -```Python hl_lines="10" +```Python hl_lines="11" {!../../../docs_src/query_params_str_validations/tutorial004.py!} ``` @@ -126,13 +126,13 @@ q: str em vez desta: ```Python -q: Optional[str] = None +q: Union[str, None] = None ``` Mas agora nรณs o estamos declarando como `Query`, conforme abaixo: ```Python -q: Optional[str] = Query(None, min_length=3) +q: Union[str, None] = Query(default=None, min_length=3) ``` Entรฃo, quando vocรช precisa declarar um parรขmetro obrigatรณrio utilizando o `Query`, vocรช pode utilizar `...` como o primeiro argumento: diff --git a/docs/ru/docs/index.md b/docs/ru/docs/index.md index a1d302276..9a3957d5f 100644 --- a/docs/ru/docs/index.md +++ b/docs/ru/docs/index.md @@ -149,7 +149,7 @@ $ pip install uvicorn[standard] * Create a file `main.py` with: ```Python -from typing import Optional +from typing import Union from fastapi import FastAPI @@ -162,7 +162,7 @@ def read_root(): @app.get("/items/{item_id}") -def read_item(item_id: int, q: Optional[str] = None): +def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} ``` @@ -172,7 +172,7 @@ def read_item(item_id: int, q: Optional[str] = None): If your code uses `async` / `await`, use `async def`: ```Python hl_lines="9 14" -from typing import Optional +from typing import Union from fastapi import FastAPI @@ -185,7 +185,7 @@ async def read_root(): @app.get("/items/{item_id}") -async def read_item(item_id: int, q: Optional[str] = None): +async def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} ``` @@ -264,7 +264,7 @@ Now modify the file `main.py` to receive a body from a `PUT` request. Declare the body using standard Python types, thanks to Pydantic. ```Python hl_lines="4 9-12 25-27" -from typing import Optional +from typing import Union from fastapi import FastAPI from pydantic import BaseModel @@ -275,7 +275,7 @@ app = FastAPI() class Item(BaseModel): name: str price: float - is_offer: Optional[bool] = None + is_offer: Union[bool, None] = None @app.get("/") @@ -284,7 +284,7 @@ def read_root(): @app.get("/items/{item_id}") -def read_item(item_id: int, q: Optional[str] = None): +def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} diff --git a/docs/sq/docs/index.md b/docs/sq/docs/index.md index 0bb7b55e3..29f92e020 100644 --- a/docs/sq/docs/index.md +++ b/docs/sq/docs/index.md @@ -149,7 +149,7 @@ $ pip install uvicorn[standard] * Create a file `main.py` with: ```Python -from typing import Optional +from typing import Union from fastapi import FastAPI @@ -162,7 +162,7 @@ def read_root(): @app.get("/items/{item_id}") -def read_item(item_id: int, q: Optional[str] = None): +def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} ``` @@ -172,7 +172,7 @@ def read_item(item_id: int, q: Optional[str] = None): If your code uses `async` / `await`, use `async def`: ```Python hl_lines="9 14" -from typing import Optional +from typing import Union from fastapi import FastAPI @@ -185,7 +185,7 @@ async def read_root(): @app.get("/items/{item_id}") -async def read_item(item_id: int, q: Optional[str] = None): +async def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} ``` @@ -264,7 +264,7 @@ Now modify the file `main.py` to receive a body from a `PUT` request. Declare the body using standard Python types, thanks to Pydantic. ```Python hl_lines="4 9-12 25-27" -from typing import Optional +from typing import Union from fastapi import FastAPI from pydantic import BaseModel @@ -275,7 +275,7 @@ app = FastAPI() class Item(BaseModel): name: str price: float - is_offer: Optional[bool] = None + is_offer: Union[bool, None] = None @app.get("/") @@ -284,7 +284,7 @@ def read_root(): @app.get("/items/{item_id}") -def read_item(item_id: int, q: Optional[str] = None): +def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} diff --git a/docs/tr/docs/index.md b/docs/tr/docs/index.md index 3195cd440..5693029b5 100644 --- a/docs/tr/docs/index.md +++ b/docs/tr/docs/index.md @@ -157,7 +157,7 @@ $ pip install uvicorn[standard] * `main.py` adฤฑnda bir dosya oluลŸtur : ```Python -from typing import Optional +from typing import Union from fastapi import FastAPI @@ -170,7 +170,7 @@ def read_root(): @app.get("/items/{item_id}") -def read_item(item_id: int, q: Optional[str] = None): +def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} ``` @@ -180,7 +180,7 @@ def read_item(item_id: int, q: Optional[str] = None): EฤŸer kodunda `async` / `await` var ise, `async def` kullan: ```Python hl_lines="9 14" -from typing import Optional +from typing import Union from fastapi import FastAPI @@ -193,7 +193,7 @@ async def read_root(): @app.get("/items/{item_id}") -async def read_item(item_id: int, q: Optional[str] = None): +async def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} ``` @@ -272,7 +272,7 @@ Senin iรงin alternatif olarak (kwargs๏ผŒๆฅ่ฐƒ็”จใ€‚ๅณไฝฟๅฎƒไปฌๆฒกๆœ‰้ป˜่ฎคๅ€ผใ€‚ -```Python hl_lines="8" +```Python hl_lines="7" {!../../../docs_src/path_params_numeric_validations/tutorial003.py!} ``` diff --git a/docs/zh/docs/tutorial/query-params-str-validations.md b/docs/zh/docs/tutorial/query-params-str-validations.md index 1d1d383d4..0b2b9446a 100644 --- a/docs/zh/docs/tutorial/query-params-str-validations.md +++ b/docs/zh/docs/tutorial/query-params-str-validations.md @@ -30,12 +30,12 @@ {!../../../docs_src/query_params_str_validations/tutorial002.py!} ``` -็”ฑไบŽๆˆ‘ไปฌๅฟ…้กป็”จ `Query(None)` ๆ›ฟๆข้ป˜่ฎคๅ€ผ `None`๏ผŒ`Query` ็š„็ฌฌไธ€ไธชๅ‚ๆ•ฐๅŒๆ ทไนŸๆ˜ฏ็”จไบŽๅฎšไน‰้ป˜่ฎคๅ€ผใ€‚ +็”ฑไบŽๆˆ‘ไปฌๅฟ…้กป็”จ `Query(default=None)` ๆ›ฟๆข้ป˜่ฎคๅ€ผ `None`๏ผŒ`Query` ็š„็ฌฌไธ€ไธชๅ‚ๆ•ฐๅŒๆ ทไนŸๆ˜ฏ็”จไบŽๅฎšไน‰้ป˜่ฎคๅ€ผใ€‚ ๆ‰€ไปฅ๏ผš ```Python -q: str = Query(None) +q: Union[str, None] = Query(default=None) ``` ...ไฝฟๅพ—ๅ‚ๆ•ฐๅฏ้€‰๏ผŒ็ญ‰ๅŒไบŽ๏ผš @@ -49,7 +49,7 @@ q: str = None ็„ถๅŽ๏ผŒๆˆ‘ไปฌๅฏไปฅๅฐ†ๆ›ดๅคš็š„ๅ‚ๆ•ฐไผ ้€’็ป™ `Query`ใ€‚ๅœจๆœฌไพ‹ไธญ๏ผŒ้€‚็”จไบŽๅญ—็ฌฆไธฒ็š„ `max_length` ๅ‚ๆ•ฐ๏ผš ```Python -q: str = Query(None, max_length=50) +q: Union[str, None] = Query(default=None, max_length=50) ``` ๅฐ†ไผšๆ ก้ชŒๆ•ฐๆฎ๏ผŒๅœจๆ•ฐๆฎๆ— ๆ•ˆๆ—ถๅฑ•็คบๆธ…ๆ™ฐ็š„้”™่ฏฏไฟกๆฏ๏ผŒๅนถๅœจ OpenAPI ๆจกๅผ็š„*่ทฏๅพ„ๆ“ไฝœ*ไธญ่ฎฐๅฝ•่ฏฅๅ‚โ€‹โ€‹ๆ•ฐใ€‚ @@ -58,7 +58,7 @@ q: str = Query(None, max_length=50) ไฝ ่ฟ˜ๅฏไปฅๆทปๅŠ  `min_length` ๅ‚ๆ•ฐ๏ผš -```Python hl_lines="9" +```Python hl_lines="10" {!../../../docs_src/query_params_str_validations/tutorial003.py!} ``` @@ -66,7 +66,7 @@ q: str = Query(None, max_length=50) ไฝ ๅฏไปฅๅฎšไน‰ไธ€ไธชๅ‚ๆ•ฐๅ€ผๅฟ…้กปๅŒน้…็š„ๆญฃๅˆ™่กจ่พพๅผ๏ผš -```Python hl_lines="10" +```Python hl_lines="11" {!../../../docs_src/query_params_str_validations/tutorial004.py!} ``` @@ -110,7 +110,7 @@ q: str = None ไฝ†ๆ˜ฏ็Žฐๅœจๆˆ‘ไปฌๆญฃๅœจ็”จ `Query` ๅฃฐๆ˜Žๅฎƒ๏ผŒไพ‹ๅฆ‚๏ผš ```Python -q: str = Query(None, min_length=3) +q: Union[str, None] = Query(default=None, min_length=3) ``` ๅ› ๆญค๏ผŒๅฝ“ไฝ ๅœจไฝฟ็”จ `Query` ไธ”้œ€่ฆๅฃฐๆ˜Žไธ€ไธชๅ€ผๆ˜ฏๅฟ…้œ€็š„ๆ—ถ๏ผŒๅฏไปฅๅฐ† `...` ็”จไฝœ็ฌฌไธ€ไธชๅ‚ๆ•ฐๅ€ผ๏ผš diff --git a/docs/zh/docs/tutorial/response-model.md b/docs/zh/docs/tutorial/response-model.md index 59a7c17d5..ea3d0666d 100644 --- a/docs/zh/docs/tutorial/response-model.md +++ b/docs/zh/docs/tutorial/response-model.md @@ -94,7 +94,7 @@ FastAPI ๅฐ†ไฝฟ็”จๆญค `response_model` ๆฅ๏ผš {!../../../docs_src/response_model/tutorial004.py!} ``` -* `description: Optional[str] = None` ๅ…ทๆœ‰้ป˜่ฎคๅ€ผ `None`ใ€‚ +* `description: Union[str, None] = None` ๅ…ทๆœ‰้ป˜่ฎคๅ€ผ `None`ใ€‚ * `tax: float = 10.5` ๅ…ทๆœ‰้ป˜่ฎคๅ€ผ `10.5`. * `tags: List[str] = []` ๅ…ทๆœ‰ไธ€ไธช็ฉบๅˆ—่กจไฝœไธบ้ป˜่ฎคๅ€ผ๏ผš `[]`. diff --git a/docs/zh/docs/tutorial/schema-extra-example.md b/docs/zh/docs/tutorial/schema-extra-example.md index 6482366b0..8f5fbfe70 100644 --- a/docs/zh/docs/tutorial/schema-extra-example.md +++ b/docs/zh/docs/tutorial/schema-extra-example.md @@ -33,7 +33,7 @@ ๆฏ”ๅฆ‚๏ผŒไฝ ๅฏไปฅๅฐ†่ฏทๆฑ‚ไฝ“็š„ไธ€ไธช `example` ไผ ้€’็ป™ `Body`: -```Python hl_lines="21-26" +```Python hl_lines="20-25" {!../../../docs_src/schema_extra_example/tutorial003.py!} ``` diff --git a/docs_src/additional_responses/tutorial002.py b/docs_src/additional_responses/tutorial002.py index a46e95959..bd0c95704 100644 --- a/docs_src/additional_responses/tutorial002.py +++ b/docs_src/additional_responses/tutorial002.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI from fastapi.responses import FileResponse @@ -23,7 +23,7 @@ app = FastAPI() } }, ) -async def read_item(item_id: str, img: Optional[bool] = None): +async def read_item(item_id: str, img: Union[bool, None] = None): if img: return FileResponse("image.png", media_type="image/png") else: diff --git a/docs_src/additional_responses/tutorial004.py b/docs_src/additional_responses/tutorial004.py index 361aecb8e..978bc18c1 100644 --- a/docs_src/additional_responses/tutorial004.py +++ b/docs_src/additional_responses/tutorial004.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI from fastapi.responses import FileResponse @@ -25,7 +25,7 @@ app = FastAPI() response_model=Item, responses={**responses, 200: {"content": {"image/png": {}}}}, ) -async def read_item(item_id: str, img: Optional[bool] = None): +async def read_item(item_id: str, img: Union[bool, None] = None): if img: return FileResponse("image.png", media_type="image/png") else: diff --git a/docs_src/background_tasks/tutorial002.py b/docs_src/background_tasks/tutorial002.py index e7517e8cd..2e1b2f6c6 100644 --- a/docs_src/background_tasks/tutorial002.py +++ b/docs_src/background_tasks/tutorial002.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import BackgroundTasks, Depends, FastAPI @@ -10,7 +10,7 @@ def write_log(message: str): log.write(message) -def get_query(background_tasks: BackgroundTasks, q: Optional[str] = None): +def get_query(background_tasks: BackgroundTasks, q: Union[str, None] = None): if q: message = f"found query: {q}\n" background_tasks.add_task(write_log, message) diff --git a/docs_src/body/tutorial001.py b/docs_src/body/tutorial001.py index 52144bd2b..f93317274 100644 --- a/docs_src/body/tutorial001.py +++ b/docs_src/body/tutorial001.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI from pydantic import BaseModel @@ -6,9 +6,9 @@ from pydantic import BaseModel class Item(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float - tax: Optional[float] = None + tax: Union[float, None] = None app = FastAPI() diff --git a/docs_src/body/tutorial002.py b/docs_src/body/tutorial002.py index 644fabae9..7f5183908 100644 --- a/docs_src/body/tutorial002.py +++ b/docs_src/body/tutorial002.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI from pydantic import BaseModel @@ -6,9 +6,9 @@ from pydantic import BaseModel class Item(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float - tax: Optional[float] = None + tax: Union[float, None] = None app = FastAPI() diff --git a/docs_src/body/tutorial003.py b/docs_src/body/tutorial003.py index c99ea694b..89a6b833c 100644 --- a/docs_src/body/tutorial003.py +++ b/docs_src/body/tutorial003.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI from pydantic import BaseModel @@ -6,9 +6,9 @@ from pydantic import BaseModel class Item(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float - tax: Optional[float] = None + tax: Union[float, None] = None app = FastAPI() diff --git a/docs_src/body/tutorial004.py b/docs_src/body/tutorial004.py index 7a222a390..e2df0df2b 100644 --- a/docs_src/body/tutorial004.py +++ b/docs_src/body/tutorial004.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI from pydantic import BaseModel @@ -6,16 +6,16 @@ from pydantic import BaseModel class Item(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float - tax: Optional[float] = None + tax: Union[float, None] = None app = FastAPI() @app.put("/items/{item_id}") -async def create_item(item_id: int, item: Item, q: Optional[str] = None): +async def create_item(item_id: int, item: Item, q: Union[str, None] = None): result = {"item_id": item_id, **item.dict()} if q: result.update({"q": q}) diff --git a/docs_src/body_multiple_params/tutorial002.py b/docs_src/body_multiple_params/tutorial002.py index 6b8748420..2d7160ae8 100644 --- a/docs_src/body_multiple_params/tutorial002.py +++ b/docs_src/body_multiple_params/tutorial002.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI from pydantic import BaseModel @@ -8,14 +8,14 @@ app = FastAPI() class Item(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float - tax: Optional[float] = None + tax: Union[float, None] = None class User(BaseModel): username: str - full_name: Optional[str] = None + full_name: Union[str, None] = None @app.put("/items/{item_id}") diff --git a/docs_src/body_nested_models/tutorial001.py b/docs_src/body_nested_models/tutorial001.py index fe14fdf93..37ef6dda5 100644 --- a/docs_src/body_nested_models/tutorial001.py +++ b/docs_src/body_nested_models/tutorial001.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI from pydantic import BaseModel @@ -8,9 +8,9 @@ app = FastAPI() class Item(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float - tax: Optional[float] = None + tax: Union[float, None] = None tags: list = [] diff --git a/docs_src/body_nested_models/tutorial002.py b/docs_src/body_nested_models/tutorial002.py index 1770516a4..155cff788 100644 --- a/docs_src/body_nested_models/tutorial002.py +++ b/docs_src/body_nested_models/tutorial002.py @@ -1,4 +1,4 @@ -from typing import List, Optional +from typing import List, Union from fastapi import FastAPI from pydantic import BaseModel @@ -8,9 +8,9 @@ app = FastAPI() class Item(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float - tax: Optional[float] = None + tax: Union[float, None] = None tags: List[str] = [] diff --git a/docs_src/body_nested_models/tutorial002_py39.py b/docs_src/body_nested_models/tutorial002_py39.py index af523a74e..8a93a7233 100644 --- a/docs_src/body_nested_models/tutorial002_py39.py +++ b/docs_src/body_nested_models/tutorial002_py39.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI from pydantic import BaseModel @@ -8,9 +8,9 @@ app = FastAPI() class Item(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float - tax: Optional[float] = None + tax: Union[float, None] = None tags: list[str] = [] diff --git a/docs_src/body_nested_models/tutorial003.py b/docs_src/body_nested_models/tutorial003.py index 33dbbe3a9..84ed18bf4 100644 --- a/docs_src/body_nested_models/tutorial003.py +++ b/docs_src/body_nested_models/tutorial003.py @@ -1,4 +1,4 @@ -from typing import Optional, Set +from typing import Set, Union from fastapi import FastAPI from pydantic import BaseModel @@ -8,9 +8,9 @@ app = FastAPI() class Item(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float - tax: Optional[float] = None + tax: Union[float, None] = None tags: Set[str] = set() diff --git a/docs_src/body_nested_models/tutorial003_py39.py b/docs_src/body_nested_models/tutorial003_py39.py index 931d92f88..b590ece36 100644 --- a/docs_src/body_nested_models/tutorial003_py39.py +++ b/docs_src/body_nested_models/tutorial003_py39.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI from pydantic import BaseModel @@ -8,9 +8,9 @@ app = FastAPI() class Item(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float - tax: Optional[float] = None + tax: Union[float, None] = None tags: set[str] = set() diff --git a/docs_src/body_nested_models/tutorial004.py b/docs_src/body_nested_models/tutorial004.py index 311a4e73f..a07bfacac 100644 --- a/docs_src/body_nested_models/tutorial004.py +++ b/docs_src/body_nested_models/tutorial004.py @@ -1,4 +1,4 @@ -from typing import Optional, Set +from typing import Set, Union from fastapi import FastAPI from pydantic import BaseModel @@ -13,11 +13,11 @@ class Image(BaseModel): class Item(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float - tax: Optional[float] = None + tax: Union[float, None] = None tags: Set[str] = set() - image: Optional[Image] = None + image: Union[Image, None] = None @app.put("/items/{item_id}") diff --git a/docs_src/body_nested_models/tutorial004_py39.py b/docs_src/body_nested_models/tutorial004_py39.py index ab05da023..dc2b175fb 100644 --- a/docs_src/body_nested_models/tutorial004_py39.py +++ b/docs_src/body_nested_models/tutorial004_py39.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI from pydantic import BaseModel @@ -13,11 +13,11 @@ class Image(BaseModel): class Item(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float - tax: Optional[float] = None + tax: Union[float, None] = None tags: set[str] = set() - image: Optional[Image] = None + image: Union[Image, None] = None @app.put("/items/{item_id}") diff --git a/docs_src/body_nested_models/tutorial005.py b/docs_src/body_nested_models/tutorial005.py index e76498c3b..5a01264ed 100644 --- a/docs_src/body_nested_models/tutorial005.py +++ b/docs_src/body_nested_models/tutorial005.py @@ -1,4 +1,4 @@ -from typing import Optional, Set +from typing import Set, Union from fastapi import FastAPI from pydantic import BaseModel, HttpUrl @@ -13,11 +13,11 @@ class Image(BaseModel): class Item(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float - tax: Optional[float] = None + tax: Union[float, None] = None tags: Set[str] = set() - image: Optional[Image] = None + image: Union[Image, None] = None @app.put("/items/{item_id}") diff --git a/docs_src/body_nested_models/tutorial005_py39.py b/docs_src/body_nested_models/tutorial005_py39.py index 504551883..47db90008 100644 --- a/docs_src/body_nested_models/tutorial005_py39.py +++ b/docs_src/body_nested_models/tutorial005_py39.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI from pydantic import BaseModel, HttpUrl @@ -13,11 +13,11 @@ class Image(BaseModel): class Item(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float - tax: Optional[float] = None + tax: Union[float, None] = None tags: set[str] = set() - image: Optional[Image] = None + image: Union[Image, None] = None @app.put("/items/{item_id}") diff --git a/docs_src/body_nested_models/tutorial006.py b/docs_src/body_nested_models/tutorial006.py index da7836715..75f1f30e3 100644 --- a/docs_src/body_nested_models/tutorial006.py +++ b/docs_src/body_nested_models/tutorial006.py @@ -1,4 +1,4 @@ -from typing import List, Optional, Set +from typing import List, Set, Union from fastapi import FastAPI from pydantic import BaseModel, HttpUrl @@ -13,11 +13,11 @@ class Image(BaseModel): class Item(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float - tax: Optional[float] = None + tax: Union[float, None] = None tags: Set[str] = set() - images: Optional[List[Image]] = None + images: Union[List[Image], None] = None @app.put("/items/{item_id}") diff --git a/docs_src/body_nested_models/tutorial006_py39.py b/docs_src/body_nested_models/tutorial006_py39.py index 61898178e..b14409703 100644 --- a/docs_src/body_nested_models/tutorial006_py39.py +++ b/docs_src/body_nested_models/tutorial006_py39.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI from pydantic import BaseModel, HttpUrl @@ -13,11 +13,11 @@ class Image(BaseModel): class Item(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float - tax: Optional[float] = None + tax: Union[float, None] = None tags: set[str] = set() - images: Optional[list[Image]] = None + images: Union[list[Image], None] = None @app.put("/items/{item_id}") diff --git a/docs_src/body_nested_models/tutorial007.py b/docs_src/body_nested_models/tutorial007.py index dfbbeaab1..641f09dce 100644 --- a/docs_src/body_nested_models/tutorial007.py +++ b/docs_src/body_nested_models/tutorial007.py @@ -1,4 +1,4 @@ -from typing import List, Optional, Set +from typing import List, Set, Union from fastapi import FastAPI from pydantic import BaseModel, HttpUrl @@ -13,16 +13,16 @@ class Image(BaseModel): class Item(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float - tax: Optional[float] = None + tax: Union[float, None] = None tags: Set[str] = set() - images: Optional[List[Image]] = None + images: Union[List[Image], None] = None class Offer(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float items: List[Item] diff --git a/docs_src/body_nested_models/tutorial007_py39.py b/docs_src/body_nested_models/tutorial007_py39.py index 0c7d32fbb..59cf01e23 100644 --- a/docs_src/body_nested_models/tutorial007_py39.py +++ b/docs_src/body_nested_models/tutorial007_py39.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI from pydantic import BaseModel, HttpUrl @@ -13,16 +13,16 @@ class Image(BaseModel): class Item(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float - tax: Optional[float] = None + tax: Union[float, None] = None tags: set[str] = set() - images: Optional[list[Image]] = None + images: Union[list[Image], None] = None class Offer(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float items: list[Item] diff --git a/docs_src/body_updates/tutorial001.py b/docs_src/body_updates/tutorial001.py index 9b8f3ccf1..4e65d77e2 100644 --- a/docs_src/body_updates/tutorial001.py +++ b/docs_src/body_updates/tutorial001.py @@ -1,4 +1,4 @@ -from typing import List, Optional +from typing import List, Union from fastapi import FastAPI from fastapi.encoders import jsonable_encoder @@ -8,9 +8,9 @@ app = FastAPI() class Item(BaseModel): - name: Optional[str] = None - description: Optional[str] = None - price: Optional[float] = None + name: Union[str, None] = None + description: Union[str, None] = None + price: Union[float, None] = None tax: float = 10.5 tags: List[str] = [] diff --git a/docs_src/body_updates/tutorial001_py39.py b/docs_src/body_updates/tutorial001_py39.py index 5d5388b56..999bcdb82 100644 --- a/docs_src/body_updates/tutorial001_py39.py +++ b/docs_src/body_updates/tutorial001_py39.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI from fastapi.encoders import jsonable_encoder @@ -8,9 +8,9 @@ app = FastAPI() class Item(BaseModel): - name: Optional[str] = None - description: Optional[str] = None - price: Optional[float] = None + name: Union[str, None] = None + description: Union[str, None] = None + price: Union[float, None] = None tax: float = 10.5 tags: list[str] = [] diff --git a/docs_src/body_updates/tutorial002.py b/docs_src/body_updates/tutorial002.py index 46d27e67e..c3a0fe79e 100644 --- a/docs_src/body_updates/tutorial002.py +++ b/docs_src/body_updates/tutorial002.py @@ -1,4 +1,4 @@ -from typing import List, Optional +from typing import List, Union from fastapi import FastAPI from fastapi.encoders import jsonable_encoder @@ -8,9 +8,9 @@ app = FastAPI() class Item(BaseModel): - name: Optional[str] = None - description: Optional[str] = None - price: Optional[float] = None + name: Union[str, None] = None + description: Union[str, None] = None + price: Union[float, None] = None tax: float = 10.5 tags: List[str] = [] diff --git a/docs_src/body_updates/tutorial002_py39.py b/docs_src/body_updates/tutorial002_py39.py index ab85bd5ae..eb35b3521 100644 --- a/docs_src/body_updates/tutorial002_py39.py +++ b/docs_src/body_updates/tutorial002_py39.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI from fastapi.encoders import jsonable_encoder @@ -8,9 +8,9 @@ app = FastAPI() class Item(BaseModel): - name: Optional[str] = None - description: Optional[str] = None - price: Optional[float] = None + name: Union[str, None] = None + description: Union[str, None] = None + price: Union[float, None] = None tax: float = 10.5 tags: list[str] = [] diff --git a/docs_src/dataclasses/tutorial001.py b/docs_src/dataclasses/tutorial001.py index 43015eb27..2954c391f 100644 --- a/docs_src/dataclasses/tutorial001.py +++ b/docs_src/dataclasses/tutorial001.py @@ -1,5 +1,5 @@ from dataclasses import dataclass -from typing import Optional +from typing import Union from fastapi import FastAPI @@ -8,8 +8,8 @@ from fastapi import FastAPI class Item: name: str price: float - description: Optional[str] = None - tax: Optional[float] = None + description: Union[str, None] = None + tax: Union[float, None] = None app = FastAPI() diff --git a/docs_src/dataclasses/tutorial002.py b/docs_src/dataclasses/tutorial002.py index aaa7b8799..08a238080 100644 --- a/docs_src/dataclasses/tutorial002.py +++ b/docs_src/dataclasses/tutorial002.py @@ -1,5 +1,5 @@ from dataclasses import dataclass, field -from typing import List, Optional +from typing import List, Union from fastapi import FastAPI @@ -9,8 +9,8 @@ class Item: name: str price: float tags: List[str] = field(default_factory=list) - description: Optional[str] = None - tax: Optional[float] = None + description: Union[str, None] = None + tax: Union[float, None] = None app = FastAPI() diff --git a/docs_src/dataclasses/tutorial003.py b/docs_src/dataclasses/tutorial003.py index 2c1fccdd7..34ce1199e 100644 --- a/docs_src/dataclasses/tutorial003.py +++ b/docs_src/dataclasses/tutorial003.py @@ -1,5 +1,5 @@ from dataclasses import field # (1) -from typing import List, Optional +from typing import List, Union from fastapi import FastAPI from pydantic.dataclasses import dataclass # (2) @@ -8,7 +8,7 @@ from pydantic.dataclasses import dataclass # (2) @dataclass class Item: name: str - description: Optional[str] = None + description: Union[str, None] = None @dataclass diff --git a/docs_src/dependencies/tutorial001.py b/docs_src/dependencies/tutorial001.py index a9da971dc..b1275103a 100644 --- a/docs_src/dependencies/tutorial001.py +++ b/docs_src/dependencies/tutorial001.py @@ -1,11 +1,13 @@ -from typing import Optional +from typing import Union from fastapi import Depends, FastAPI app = FastAPI() -async def common_parameters(q: Optional[str] = None, skip: int = 0, limit: int = 100): +async def common_parameters( + q: Union[str, None] = None, skip: int = 0, limit: int = 100 +): return {"q": q, "skip": skip, "limit": limit} diff --git a/docs_src/dependencies/tutorial002.py b/docs_src/dependencies/tutorial002.py index 458f6b5bb..8e863e4fa 100644 --- a/docs_src/dependencies/tutorial002.py +++ b/docs_src/dependencies/tutorial002.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import Depends, FastAPI @@ -9,7 +9,7 @@ fake_items_db = [{"item_name": "Foo"}, {"item_name": "Bar"}, {"item_name": "Baz" class CommonQueryParams: - def __init__(self, q: Optional[str] = None, skip: int = 0, limit: int = 100): + def __init__(self, q: Union[str, None] = None, skip: int = 0, limit: int = 100): self.q = q self.skip = skip self.limit = limit diff --git a/docs_src/dependencies/tutorial003.py b/docs_src/dependencies/tutorial003.py index 3f3e940f8..34614e539 100644 --- a/docs_src/dependencies/tutorial003.py +++ b/docs_src/dependencies/tutorial003.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import Depends, FastAPI @@ -9,7 +9,7 @@ fake_items_db = [{"item_name": "Foo"}, {"item_name": "Bar"}, {"item_name": "Baz" class CommonQueryParams: - def __init__(self, q: Optional[str] = None, skip: int = 0, limit: int = 100): + def __init__(self, q: Union[str, None] = None, skip: int = 0, limit: int = 100): self.q = q self.skip = skip self.limit = limit diff --git a/docs_src/dependencies/tutorial004.py b/docs_src/dependencies/tutorial004.py index daa7b4670..d9fe88148 100644 --- a/docs_src/dependencies/tutorial004.py +++ b/docs_src/dependencies/tutorial004.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import Depends, FastAPI @@ -9,7 +9,7 @@ fake_items_db = [{"item_name": "Foo"}, {"item_name": "Bar"}, {"item_name": "Baz" class CommonQueryParams: - def __init__(self, q: Optional[str] = None, skip: int = 0, limit: int = 100): + def __init__(self, q: Union[str, None] = None, skip: int = 0, limit: int = 100): self.q = q self.skip = skip self.limit = limit diff --git a/docs_src/dependencies/tutorial005.py b/docs_src/dependencies/tutorial005.py index 24f73c617..697332b5b 100644 --- a/docs_src/dependencies/tutorial005.py +++ b/docs_src/dependencies/tutorial005.py @@ -1,16 +1,17 @@ -from typing import Optional +from typing import Union from fastapi import Cookie, Depends, FastAPI app = FastAPI() -def query_extractor(q: Optional[str] = None): +def query_extractor(q: Union[str, None] = None): return q def query_or_cookie_extractor( - q: str = Depends(query_extractor), last_query: Optional[str] = Cookie(default=None) + q: str = Depends(query_extractor), + last_query: Union[str, None] = Cookie(default=None), ): if not q: return last_query diff --git a/docs_src/dependency_testing/tutorial001.py b/docs_src/dependency_testing/tutorial001.py index 237d3b231..a5fe1d9bf 100644 --- a/docs_src/dependency_testing/tutorial001.py +++ b/docs_src/dependency_testing/tutorial001.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import Depends, FastAPI from fastapi.testclient import TestClient @@ -6,7 +6,9 @@ from fastapi.testclient import TestClient app = FastAPI() -async def common_parameters(q: Optional[str] = None, skip: int = 0, limit: int = 100): +async def common_parameters( + q: Union[str, None] = None, skip: int = 0, limit: int = 100 +): return {"q": q, "skip": skip, "limit": limit} @@ -23,7 +25,7 @@ async def read_users(commons: dict = Depends(common_parameters)): client = TestClient(app) -async def override_dependency(q: Optional[str] = None): +async def override_dependency(q: Union[str, None] = None): return {"q": q, "skip": 5, "limit": 10} diff --git a/docs_src/encoder/tutorial001.py b/docs_src/encoder/tutorial001.py index a918fdd64..5f7e7061e 100644 --- a/docs_src/encoder/tutorial001.py +++ b/docs_src/encoder/tutorial001.py @@ -1,5 +1,5 @@ from datetime import datetime -from typing import Optional +from typing import Union from fastapi import FastAPI from fastapi.encoders import jsonable_encoder @@ -11,7 +11,7 @@ fake_db = {} class Item(BaseModel): title: str timestamp: datetime - description: Optional[str] = None + description: Union[str, None] = None app = FastAPI() diff --git a/docs_src/extra_data_types/tutorial001.py b/docs_src/extra_data_types/tutorial001.py index 9f5e911bf..8ae8472a7 100644 --- a/docs_src/extra_data_types/tutorial001.py +++ b/docs_src/extra_data_types/tutorial001.py @@ -1,5 +1,5 @@ from datetime import datetime, time, timedelta -from typing import Optional +from typing import Union from uuid import UUID from fastapi import Body, FastAPI @@ -10,10 +10,10 @@ app = FastAPI() @app.put("/items/{item_id}") async def read_items( item_id: UUID, - start_datetime: Optional[datetime] = Body(default=None), - end_datetime: Optional[datetime] = Body(default=None), - repeat_at: Optional[time] = Body(default=None), - process_after: Optional[timedelta] = Body(default=None), + start_datetime: Union[datetime, None] = Body(default=None), + end_datetime: Union[datetime, None] = Body(default=None), + repeat_at: Union[time, None] = Body(default=None), + process_after: Union[timedelta, None] = Body(default=None), ): start_process = start_datetime + process_after duration = end_datetime - start_process diff --git a/docs_src/extra_models/tutorial001.py b/docs_src/extra_models/tutorial001.py index e95844f60..4be56cd2a 100644 --- a/docs_src/extra_models/tutorial001.py +++ b/docs_src/extra_models/tutorial001.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI from pydantic import BaseModel, EmailStr @@ -10,20 +10,20 @@ class UserIn(BaseModel): username: str password: str email: EmailStr - full_name: Optional[str] = None + full_name: Union[str, None] = None class UserOut(BaseModel): username: str email: EmailStr - full_name: Optional[str] = None + full_name: Union[str, None] = None class UserInDB(BaseModel): username: str hashed_password: str email: EmailStr - full_name: Optional[str] = None + full_name: Union[str, None] = None def fake_password_hasher(raw_password: str): diff --git a/docs_src/extra_models/tutorial002.py b/docs_src/extra_models/tutorial002.py index 5bc6e707f..70fa16441 100644 --- a/docs_src/extra_models/tutorial002.py +++ b/docs_src/extra_models/tutorial002.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI from pydantic import BaseModel, EmailStr @@ -9,7 +9,7 @@ app = FastAPI() class UserBase(BaseModel): username: str email: EmailStr - full_name: Optional[str] = None + full_name: Union[str, None] = None class UserIn(UserBase): diff --git a/docs_src/header_params/tutorial001.py b/docs_src/header_params/tutorial001.py index 1df561a12..74429c8e2 100644 --- a/docs_src/header_params/tutorial001.py +++ b/docs_src/header_params/tutorial001.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI, Header @@ -6,5 +6,5 @@ app = FastAPI() @app.get("/items/") -async def read_items(user_agent: Optional[str] = Header(default=None)): +async def read_items(user_agent: Union[str, None] = Header(default=None)): return {"User-Agent": user_agent} diff --git a/docs_src/header_params/tutorial002.py b/docs_src/header_params/tutorial002.py index 2250727f6..639ab1735 100644 --- a/docs_src/header_params/tutorial002.py +++ b/docs_src/header_params/tutorial002.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI, Header @@ -7,6 +7,6 @@ app = FastAPI() @app.get("/items/") async def read_items( - strange_header: Optional[str] = Header(default=None, convert_underscores=False) + strange_header: Union[str, None] = Header(default=None, convert_underscores=False) ): return {"strange_header": strange_header} diff --git a/docs_src/header_params/tutorial003.py b/docs_src/header_params/tutorial003.py index 1ef131cee..a61314aed 100644 --- a/docs_src/header_params/tutorial003.py +++ b/docs_src/header_params/tutorial003.py @@ -1,4 +1,4 @@ -from typing import List, Optional +from typing import List, Union from fastapi import FastAPI, Header @@ -6,5 +6,5 @@ app = FastAPI() @app.get("/items/") -async def read_items(x_token: Optional[List[str]] = Header(default=None)): +async def read_items(x_token: Union[List[str], None] = Header(default=None)): return {"X-Token values": x_token} diff --git a/docs_src/header_params/tutorial003_py39.py b/docs_src/header_params/tutorial003_py39.py index 78dda58da..34437db16 100644 --- a/docs_src/header_params/tutorial003_py39.py +++ b/docs_src/header_params/tutorial003_py39.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI, Header @@ -6,5 +6,5 @@ app = FastAPI() @app.get("/items/") -async def read_items(x_token: Optional[list[str]] = Header(default=None)): +async def read_items(x_token: Union[list[str], None] = Header(default=None)): return {"X-Token values": x_token} diff --git a/docs_src/nosql_databases/tutorial001.py b/docs_src/nosql_databases/tutorial001.py index 39548d862..91893e528 100644 --- a/docs_src/nosql_databases/tutorial001.py +++ b/docs_src/nosql_databases/tutorial001.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from couchbase import LOCKMODE_WAIT from couchbase.bucket import Bucket @@ -23,9 +23,9 @@ def get_bucket(): class User(BaseModel): username: str - email: Optional[str] = None - full_name: Optional[str] = None - disabled: Optional[bool] = None + email: Union[str, None] = None + full_name: Union[str, None] = None + disabled: Union[bool, None] = None class UserInDB(User): diff --git a/docs_src/openapi_callbacks/tutorial001.py b/docs_src/openapi_callbacks/tutorial001.py index 2fb836751..3f1bac6e2 100644 --- a/docs_src/openapi_callbacks/tutorial001.py +++ b/docs_src/openapi_callbacks/tutorial001.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import APIRouter, FastAPI from pydantic import BaseModel, HttpUrl @@ -8,7 +8,7 @@ app = FastAPI() class Invoice(BaseModel): id: str - title: Optional[str] = None + title: Union[str, None] = None customer: str total: float @@ -33,7 +33,7 @@ def invoice_notification(body: InvoiceEvent): @app.post("/invoices/", callbacks=invoices_callback_router.routes) -def create_invoice(invoice: Invoice, callback_url: Optional[HttpUrl] = None): +def create_invoice(invoice: Invoice, callback_url: Union[HttpUrl, None] = None): """ Create an invoice. diff --git a/docs_src/path_operation_advanced_configuration/tutorial004.py b/docs_src/path_operation_advanced_configuration/tutorial004.py index da678aed3..a3aad4ac4 100644 --- a/docs_src/path_operation_advanced_configuration/tutorial004.py +++ b/docs_src/path_operation_advanced_configuration/tutorial004.py @@ -1,4 +1,4 @@ -from typing import Optional, Set +from typing import Set, Union from fastapi import FastAPI from pydantic import BaseModel @@ -8,9 +8,9 @@ app = FastAPI() class Item(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float - tax: Optional[float] = None + tax: Union[float, None] = None tags: Set[str] = set() diff --git a/docs_src/path_operation_configuration/tutorial001.py b/docs_src/path_operation_configuration/tutorial001.py index 1316d9237..83fd8377a 100644 --- a/docs_src/path_operation_configuration/tutorial001.py +++ b/docs_src/path_operation_configuration/tutorial001.py @@ -1,4 +1,4 @@ -from typing import Optional, Set +from typing import Set, Union from fastapi import FastAPI, status from pydantic import BaseModel @@ -8,9 +8,9 @@ app = FastAPI() class Item(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float - tax: Optional[float] = None + tax: Union[float, None] = None tags: Set[str] = set() diff --git a/docs_src/path_operation_configuration/tutorial001_py39.py b/docs_src/path_operation_configuration/tutorial001_py39.py index 5c04d8bac..a9dcbf389 100644 --- a/docs_src/path_operation_configuration/tutorial001_py39.py +++ b/docs_src/path_operation_configuration/tutorial001_py39.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI, status from pydantic import BaseModel @@ -8,9 +8,9 @@ app = FastAPI() class Item(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float - tax: Optional[float] = None + tax: Union[float, None] = None tags: set[str] = set() diff --git a/docs_src/path_operation_configuration/tutorial002.py b/docs_src/path_operation_configuration/tutorial002.py index 2df537d86..798b0c231 100644 --- a/docs_src/path_operation_configuration/tutorial002.py +++ b/docs_src/path_operation_configuration/tutorial002.py @@ -1,4 +1,4 @@ -from typing import Optional, Set +from typing import Set, Union from fastapi import FastAPI from pydantic import BaseModel @@ -8,9 +8,9 @@ app = FastAPI() class Item(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float - tax: Optional[float] = None + tax: Union[float, None] = None tags: Set[str] = set() diff --git a/docs_src/path_operation_configuration/tutorial002_py39.py b/docs_src/path_operation_configuration/tutorial002_py39.py index 766d9fb0b..e7ced7de7 100644 --- a/docs_src/path_operation_configuration/tutorial002_py39.py +++ b/docs_src/path_operation_configuration/tutorial002_py39.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI from pydantic import BaseModel @@ -8,9 +8,9 @@ app = FastAPI() class Item(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float - tax: Optional[float] = None + tax: Union[float, None] = None tags: set[str] = set() diff --git a/docs_src/path_operation_configuration/tutorial003.py b/docs_src/path_operation_configuration/tutorial003.py index 269a1a253..26bf7daba 100644 --- a/docs_src/path_operation_configuration/tutorial003.py +++ b/docs_src/path_operation_configuration/tutorial003.py @@ -1,4 +1,4 @@ -from typing import Optional, Set +from typing import Set, Union from fastapi import FastAPI from pydantic import BaseModel @@ -8,9 +8,9 @@ app = FastAPI() class Item(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float - tax: Optional[float] = None + tax: Union[float, None] = None tags: Set[str] = set() diff --git a/docs_src/path_operation_configuration/tutorial003_py39.py b/docs_src/path_operation_configuration/tutorial003_py39.py index 446198b5c..607c5707e 100644 --- a/docs_src/path_operation_configuration/tutorial003_py39.py +++ b/docs_src/path_operation_configuration/tutorial003_py39.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI from pydantic import BaseModel @@ -8,9 +8,9 @@ app = FastAPI() class Item(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float - tax: Optional[float] = None + tax: Union[float, None] = None tags: set[str] = set() diff --git a/docs_src/path_operation_configuration/tutorial004.py b/docs_src/path_operation_configuration/tutorial004.py index de83be836..8f865c58a 100644 --- a/docs_src/path_operation_configuration/tutorial004.py +++ b/docs_src/path_operation_configuration/tutorial004.py @@ -1,4 +1,4 @@ -from typing import Optional, Set +from typing import Set, Union from fastapi import FastAPI from pydantic import BaseModel @@ -8,9 +8,9 @@ app = FastAPI() class Item(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float - tax: Optional[float] = None + tax: Union[float, None] = None tags: Set[str] = set() diff --git a/docs_src/path_operation_configuration/tutorial004_py39.py b/docs_src/path_operation_configuration/tutorial004_py39.py index bf6005b95..fc25680c5 100644 --- a/docs_src/path_operation_configuration/tutorial004_py39.py +++ b/docs_src/path_operation_configuration/tutorial004_py39.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI from pydantic import BaseModel @@ -8,9 +8,9 @@ app = FastAPI() class Item(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float - tax: Optional[float] = None + tax: Union[float, None] = None tags: set[str] = set() diff --git a/docs_src/path_operation_configuration/tutorial005.py b/docs_src/path_operation_configuration/tutorial005.py index 0f62c3814..2c1be4a34 100644 --- a/docs_src/path_operation_configuration/tutorial005.py +++ b/docs_src/path_operation_configuration/tutorial005.py @@ -1,4 +1,4 @@ -from typing import Optional, Set +from typing import Set, Union from fastapi import FastAPI from pydantic import BaseModel @@ -8,9 +8,9 @@ app = FastAPI() class Item(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float - tax: Optional[float] = None + tax: Union[float, None] = None tags: Set[str] = set() diff --git a/docs_src/path_operation_configuration/tutorial005_py39.py b/docs_src/path_operation_configuration/tutorial005_py39.py index 5ef320405..ddf29b733 100644 --- a/docs_src/path_operation_configuration/tutorial005_py39.py +++ b/docs_src/path_operation_configuration/tutorial005_py39.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI from pydantic import BaseModel @@ -8,9 +8,9 @@ app = FastAPI() class Item(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float - tax: Optional[float] = None + tax: Union[float, None] = None tags: set[str] = set() diff --git a/docs_src/python_types/tutorial009c.py b/docs_src/python_types/tutorial009c.py new file mode 100644 index 000000000..2f539a34b --- /dev/null +++ b/docs_src/python_types/tutorial009c.py @@ -0,0 +1,5 @@ +from typing import Optional + + +def say_hi(name: Optional[str]): + print(f"Hey {name}!") diff --git a/docs_src/python_types/tutorial009c_py310.py b/docs_src/python_types/tutorial009c_py310.py new file mode 100644 index 000000000..96b1220fc --- /dev/null +++ b/docs_src/python_types/tutorial009c_py310.py @@ -0,0 +1,2 @@ +def say_hi(name: str | None): + print(f"Hey {name}!") diff --git a/docs_src/python_types/tutorial011.py b/docs_src/python_types/tutorial011.py index 047b633b5..c8634cbff 100644 --- a/docs_src/python_types/tutorial011.py +++ b/docs_src/python_types/tutorial011.py @@ -1,5 +1,5 @@ from datetime import datetime -from typing import List, Optional +from typing import List, Union from pydantic import BaseModel @@ -7,7 +7,7 @@ from pydantic import BaseModel class User(BaseModel): id: int name = "John Doe" - signup_ts: Optional[datetime] = None + signup_ts: Union[datetime, None] = None friends: List[int] = [] diff --git a/docs_src/python_types/tutorial011_py39.py b/docs_src/python_types/tutorial011_py39.py index af79e2df0..468496f51 100644 --- a/docs_src/python_types/tutorial011_py39.py +++ b/docs_src/python_types/tutorial011_py39.py @@ -1,5 +1,5 @@ from datetime import datetime -from typing import Optional +from typing import Union from pydantic import BaseModel @@ -7,7 +7,7 @@ from pydantic import BaseModel class User(BaseModel): id: int name = "John Doe" - signup_ts: Optional[datetime] = None + signup_ts: Union[datetime, None] = None friends: list[int] = [] diff --git a/docs_src/python_types/tutorial012.py b/docs_src/python_types/tutorial012.py new file mode 100644 index 000000000..74fa94c43 --- /dev/null +++ b/docs_src/python_types/tutorial012.py @@ -0,0 +1,8 @@ +from typing import Optional + +from pydantic import BaseModel + + +class User(BaseModel): + name: str + age: Optional[int] diff --git a/docs_src/query_params/tutorial002.py b/docs_src/query_params/tutorial002.py index 32918465e..8465f45ee 100644 --- a/docs_src/query_params/tutorial002.py +++ b/docs_src/query_params/tutorial002.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI @@ -6,7 +6,7 @@ app = FastAPI() @app.get("/items/{item_id}") -async def read_item(item_id: str, q: Optional[str] = None): +async def read_item(item_id: str, q: Union[str, None] = None): if q: return {"item_id": item_id, "q": q} return {"item_id": item_id} diff --git a/docs_src/query_params/tutorial003.py b/docs_src/query_params/tutorial003.py index c81a96785..3362715b3 100644 --- a/docs_src/query_params/tutorial003.py +++ b/docs_src/query_params/tutorial003.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI @@ -6,7 +6,7 @@ app = FastAPI() @app.get("/items/{item_id}") -async def read_item(item_id: str, q: Optional[str] = None, short: bool = False): +async def read_item(item_id: str, q: Union[str, None] = None, short: bool = False): item = {"item_id": item_id} if q: item.update({"q": q}) diff --git a/docs_src/query_params/tutorial004.py b/docs_src/query_params/tutorial004.py index 37f97fa2a..049c3ae93 100644 --- a/docs_src/query_params/tutorial004.py +++ b/docs_src/query_params/tutorial004.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI @@ -7,7 +7,7 @@ app = FastAPI() @app.get("/users/{user_id}/items/{item_id}") async def read_user_item( - user_id: int, item_id: str, q: Optional[str] = None, short: bool = False + user_id: int, item_id: str, q: Union[str, None] = None, short: bool = False ): item = {"item_id": item_id, "owner_id": user_id} if q: diff --git a/docs_src/query_params/tutorial006.py b/docs_src/query_params/tutorial006.py index ffe328340..f0dbfe08f 100644 --- a/docs_src/query_params/tutorial006.py +++ b/docs_src/query_params/tutorial006.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI @@ -7,7 +7,7 @@ app = FastAPI() @app.get("/items/{item_id}") async def read_user_item( - item_id: str, needy: str, skip: int = 0, limit: Optional[int] = None + item_id: str, needy: str, skip: int = 0, limit: Union[int, None] = None ): item = {"item_id": item_id, "needy": needy, "skip": skip, "limit": limit} return item diff --git a/docs_src/query_params_str_validations/tutorial001.py b/docs_src/query_params_str_validations/tutorial001.py index 5d7bfb0ee..e38326b18 100644 --- a/docs_src/query_params_str_validations/tutorial001.py +++ b/docs_src/query_params_str_validations/tutorial001.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI @@ -6,7 +6,7 @@ app = FastAPI() @app.get("/items/") -async def read_items(q: Optional[str] = None): +async def read_items(q: Union[str, None] = None): results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} if q: results.update({"q": q}) diff --git a/docs_src/request_files/tutorial001_02.py b/docs_src/request_files/tutorial001_02.py index 3f311c4b8..ac30be2d3 100644 --- a/docs_src/request_files/tutorial001_02.py +++ b/docs_src/request_files/tutorial001_02.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI, File, UploadFile @@ -6,7 +6,7 @@ app = FastAPI() @app.post("/files/") -async def create_file(file: Optional[bytes] = File(default=None)): +async def create_file(file: Union[bytes, None] = File(default=None)): if not file: return {"message": "No file sent"} else: @@ -14,7 +14,7 @@ async def create_file(file: Optional[bytes] = File(default=None)): @app.post("/uploadfile/") -async def create_upload_file(file: Optional[UploadFile] = None): +async def create_upload_file(file: Union[UploadFile, None] = None): if not file: return {"message": "No upload file sent"} else: diff --git a/docs_src/response_directly/tutorial001.py b/docs_src/response_directly/tutorial001.py index 6acdc0fc8..5ab655a8a 100644 --- a/docs_src/response_directly/tutorial001.py +++ b/docs_src/response_directly/tutorial001.py @@ -1,5 +1,5 @@ from datetime import datetime -from typing import Optional +from typing import Union from fastapi import FastAPI from fastapi.encoders import jsonable_encoder @@ -10,7 +10,7 @@ from pydantic import BaseModel class Item(BaseModel): title: str timestamp: datetime - description: Optional[str] = None + description: Union[str, None] = None app = FastAPI() diff --git a/docs_src/response_model/tutorial001.py b/docs_src/response_model/tutorial001.py index 57992ecfc..0f6e03e5b 100644 --- a/docs_src/response_model/tutorial001.py +++ b/docs_src/response_model/tutorial001.py @@ -1,4 +1,4 @@ -from typing import List, Optional +from typing import List, Union from fastapi import FastAPI from pydantic import BaseModel @@ -8,9 +8,9 @@ app = FastAPI() class Item(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float - tax: Optional[float] = None + tax: Union[float, None] = None tags: List[str] = [] diff --git a/docs_src/response_model/tutorial001_py39.py b/docs_src/response_model/tutorial001_py39.py index 37b866864..cdcca39d2 100644 --- a/docs_src/response_model/tutorial001_py39.py +++ b/docs_src/response_model/tutorial001_py39.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI from pydantic import BaseModel @@ -8,9 +8,9 @@ app = FastAPI() class Item(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float - tax: Optional[float] = None + tax: Union[float, None] = None tags: list[str] = [] diff --git a/docs_src/response_model/tutorial002.py b/docs_src/response_model/tutorial002.py index 373317eb9..c68e8b138 100644 --- a/docs_src/response_model/tutorial002.py +++ b/docs_src/response_model/tutorial002.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI from pydantic import BaseModel, EmailStr @@ -10,7 +10,7 @@ class UserIn(BaseModel): username: str password: str email: EmailStr - full_name: Optional[str] = None + full_name: Union[str, None] = None # Don't do this in production! diff --git a/docs_src/response_model/tutorial003.py b/docs_src/response_model/tutorial003.py index e14026dd8..37e493dcb 100644 --- a/docs_src/response_model/tutorial003.py +++ b/docs_src/response_model/tutorial003.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI from pydantic import BaseModel, EmailStr @@ -10,13 +10,13 @@ class UserIn(BaseModel): username: str password: str email: EmailStr - full_name: Optional[str] = None + full_name: Union[str, None] = None class UserOut(BaseModel): username: str email: EmailStr - full_name: Optional[str] = None + full_name: Union[str, None] = None @app.post("/user/", response_model=UserOut) diff --git a/docs_src/response_model/tutorial004.py b/docs_src/response_model/tutorial004.py index 1e18f989d..10b48039a 100644 --- a/docs_src/response_model/tutorial004.py +++ b/docs_src/response_model/tutorial004.py @@ -1,4 +1,4 @@ -from typing import List, Optional +from typing import List, Union from fastapi import FastAPI from pydantic import BaseModel @@ -8,7 +8,7 @@ app = FastAPI() class Item(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float tax: float = 10.5 tags: List[str] = [] diff --git a/docs_src/response_model/tutorial004_py39.py b/docs_src/response_model/tutorial004_py39.py index 07ccbbf41..9463b45ec 100644 --- a/docs_src/response_model/tutorial004_py39.py +++ b/docs_src/response_model/tutorial004_py39.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI from pydantic import BaseModel @@ -8,7 +8,7 @@ app = FastAPI() class Item(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float tax: float = 10.5 tags: list[str] = [] diff --git a/docs_src/response_model/tutorial005.py b/docs_src/response_model/tutorial005.py index 03933d1f7..30eb9f8e3 100644 --- a/docs_src/response_model/tutorial005.py +++ b/docs_src/response_model/tutorial005.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI from pydantic import BaseModel @@ -8,7 +8,7 @@ app = FastAPI() class Item(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float tax: float = 10.5 diff --git a/docs_src/response_model/tutorial006.py b/docs_src/response_model/tutorial006.py index 629ab8a3a..3ffdb512b 100644 --- a/docs_src/response_model/tutorial006.py +++ b/docs_src/response_model/tutorial006.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI from pydantic import BaseModel @@ -8,7 +8,7 @@ app = FastAPI() class Item(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float tax: float = 10.5 diff --git a/docs_src/schema_extra_example/tutorial001.py b/docs_src/schema_extra_example/tutorial001.py index fab4d7a44..a5ae28127 100644 --- a/docs_src/schema_extra_example/tutorial001.py +++ b/docs_src/schema_extra_example/tutorial001.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI from pydantic import BaseModel @@ -8,9 +8,9 @@ app = FastAPI() class Item(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float - tax: Optional[float] = None + tax: Union[float, None] = None class Config: schema_extra = { diff --git a/docs_src/schema_extra_example/tutorial002.py b/docs_src/schema_extra_example/tutorial002.py index a2aec46f5..6de434f81 100644 --- a/docs_src/schema_extra_example/tutorial002.py +++ b/docs_src/schema_extra_example/tutorial002.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import FastAPI from pydantic import BaseModel, Field @@ -8,9 +8,9 @@ app = FastAPI() class Item(BaseModel): name: str = Field(example="Foo") - description: Optional[str] = Field(default=None, example="A very nice Item") + description: Union[str, None] = Field(default=None, example="A very nice Item") price: float = Field(example=35.4) - tax: Optional[float] = Field(default=None, example=3.2) + tax: Union[float, None] = Field(default=None, example=3.2) @app.put("/items/{item_id}") diff --git a/docs_src/schema_extra_example/tutorial003.py b/docs_src/schema_extra_example/tutorial003.py index 43d46b81b..ce1736bba 100644 --- a/docs_src/schema_extra_example/tutorial003.py +++ b/docs_src/schema_extra_example/tutorial003.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import Body, FastAPI from pydantic import BaseModel @@ -8,9 +8,9 @@ app = FastAPI() class Item(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float - tax: Optional[float] = None + tax: Union[float, None] = None @app.put("/items/{item_id}") diff --git a/docs_src/schema_extra_example/tutorial004.py b/docs_src/schema_extra_example/tutorial004.py index 42d7a04a3..b67edf30c 100644 --- a/docs_src/schema_extra_example/tutorial004.py +++ b/docs_src/schema_extra_example/tutorial004.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import Body, FastAPI from pydantic import BaseModel @@ -8,9 +8,9 @@ app = FastAPI() class Item(BaseModel): name: str - description: Optional[str] = None + description: Union[str, None] = None price: float - tax: Optional[float] = None + tax: Union[float, None] = None @app.put("/items/{item_id}") diff --git a/docs_src/security/tutorial002.py b/docs_src/security/tutorial002.py index 03e0cd5fc..bfd035221 100644 --- a/docs_src/security/tutorial002.py +++ b/docs_src/security/tutorial002.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import Depends, FastAPI from fastapi.security import OAuth2PasswordBearer @@ -11,9 +11,9 @@ oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token") class User(BaseModel): username: str - email: Optional[str] = None - full_name: Optional[str] = None - disabled: Optional[bool] = None + email: Union[str, None] = None + full_name: Union[str, None] = None + disabled: Union[bool, None] = None def fake_decode_token(token): diff --git a/docs_src/security/tutorial003.py b/docs_src/security/tutorial003.py index a6bb176e4..4b324866f 100644 --- a/docs_src/security/tutorial003.py +++ b/docs_src/security/tutorial003.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import Depends, FastAPI, HTTPException, status from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm @@ -33,9 +33,9 @@ oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token") class User(BaseModel): username: str - email: Optional[str] = None - full_name: Optional[str] = None - disabled: Optional[bool] = None + email: Union[str, None] = None + full_name: Union[str, None] = None + disabled: Union[bool, None] = None class UserInDB(User): diff --git a/docs_src/security/tutorial004.py b/docs_src/security/tutorial004.py index 18e2c428f..64099abe9 100644 --- a/docs_src/security/tutorial004.py +++ b/docs_src/security/tutorial004.py @@ -1,5 +1,5 @@ from datetime import datetime, timedelta -from typing import Optional +from typing import Union from fastapi import Depends, FastAPI, HTTPException, status from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm @@ -31,14 +31,14 @@ class Token(BaseModel): class TokenData(BaseModel): - username: Optional[str] = None + username: Union[str, None] = None class User(BaseModel): username: str - email: Optional[str] = None - full_name: Optional[str] = None - disabled: Optional[bool] = None + email: Union[str, None] = None + full_name: Union[str, None] = None + disabled: Union[bool, None] = None class UserInDB(User): @@ -75,7 +75,7 @@ def authenticate_user(fake_db, username: str, password: str): return user -def create_access_token(data: dict, expires_delta: Optional[timedelta] = None): +def create_access_token(data: dict, expires_delta: Union[timedelta, None] = None): to_encode = data.copy() if expires_delta: expire = datetime.utcnow() + expires_delta diff --git a/docs_src/security/tutorial005.py b/docs_src/security/tutorial005.py index 5b34a09f1..ab3af9a6a 100644 --- a/docs_src/security/tutorial005.py +++ b/docs_src/security/tutorial005.py @@ -1,5 +1,5 @@ from datetime import datetime, timedelta -from typing import List, Optional +from typing import List, Union from fastapi import Depends, FastAPI, HTTPException, Security, status from fastapi.security import ( @@ -42,15 +42,15 @@ class Token(BaseModel): class TokenData(BaseModel): - username: Optional[str] = None + username: Union[str, None] = None scopes: List[str] = [] class User(BaseModel): username: str - email: Optional[str] = None - full_name: Optional[str] = None - disabled: Optional[bool] = None + email: Union[str, None] = None + full_name: Union[str, None] = None + disabled: Union[bool, None] = None class UserInDB(User): @@ -90,7 +90,7 @@ def authenticate_user(fake_db, username: str, password: str): return user -def create_access_token(data: dict, expires_delta: Optional[timedelta] = None): +def create_access_token(data: dict, expires_delta: Union[timedelta, None] = None): to_encode = data.copy() if expires_delta: expire = datetime.utcnow() + expires_delta diff --git a/docs_src/security/tutorial005_py39.py b/docs_src/security/tutorial005_py39.py index d45c08ce6..38391308a 100644 --- a/docs_src/security/tutorial005_py39.py +++ b/docs_src/security/tutorial005_py39.py @@ -1,5 +1,5 @@ from datetime import datetime, timedelta -from typing import Optional +from typing import Union from fastapi import Depends, FastAPI, HTTPException, Security, status from fastapi.security import ( @@ -42,15 +42,15 @@ class Token(BaseModel): class TokenData(BaseModel): - username: Optional[str] = None + username: Union[str, None] = None scopes: list[str] = [] class User(BaseModel): username: str - email: Optional[str] = None - full_name: Optional[str] = None - disabled: Optional[bool] = None + email: Union[str, None] = None + full_name: Union[str, None] = None + disabled: Union[bool, None] = None class UserInDB(User): @@ -90,7 +90,7 @@ def authenticate_user(fake_db, username: str, password: str): return user -def create_access_token(data: dict, expires_delta: Optional[timedelta] = None): +def create_access_token(data: dict, expires_delta: Union[timedelta, None] = None): to_encode = data.copy() if expires_delta: expire = datetime.utcnow() + expires_delta diff --git a/docs_src/sql_databases/sql_app/schemas.py b/docs_src/sql_databases/sql_app/schemas.py index 51655663a..c49beba88 100644 --- a/docs_src/sql_databases/sql_app/schemas.py +++ b/docs_src/sql_databases/sql_app/schemas.py @@ -1,11 +1,11 @@ -from typing import List, Optional +from typing import List, Union from pydantic import BaseModel class ItemBase(BaseModel): title: str - description: Optional[str] = None + description: Union[str, None] = None class ItemCreate(ItemBase): diff --git a/docs_src/sql_databases/sql_app_py39/schemas.py b/docs_src/sql_databases/sql_app_py39/schemas.py index a19f1cdfe..dadc403d9 100644 --- a/docs_src/sql_databases/sql_app_py39/schemas.py +++ b/docs_src/sql_databases/sql_app_py39/schemas.py @@ -1,11 +1,11 @@ -from typing import Optional +from typing import Union from pydantic import BaseModel class ItemBase(BaseModel): title: str - description: Optional[str] = None + description: Union[str, None] = None class ItemCreate(ItemBase): diff --git a/docs_src/sql_databases_peewee/sql_app/schemas.py b/docs_src/sql_databases_peewee/sql_app/schemas.py index b715604ee..d8775cb30 100644 --- a/docs_src/sql_databases_peewee/sql_app/schemas.py +++ b/docs_src/sql_databases_peewee/sql_app/schemas.py @@ -1,4 +1,4 @@ -from typing import Any, List, Optional +from typing import Any, List, Union import peewee from pydantic import BaseModel @@ -15,7 +15,7 @@ class PeeweeGetterDict(GetterDict): class ItemBase(BaseModel): title: str - description: Optional[str] = None + description: Union[str, None] = None class ItemCreate(ItemBase): diff --git a/docs_src/websockets/tutorial002.py b/docs_src/websockets/tutorial002.py index b01008530..cf5c7e805 100644 --- a/docs_src/websockets/tutorial002.py +++ b/docs_src/websockets/tutorial002.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Union from fastapi import Cookie, Depends, FastAPI, Query, WebSocket, status from fastapi.responses import HTMLResponse @@ -57,8 +57,8 @@ async def get(): async def get_cookie_or_token( websocket: WebSocket, - session: Optional[str] = Cookie(default=None), - token: Optional[str] = Query(default=None), + session: Union[str, None] = Cookie(default=None), + token: Union[str, None] = Query(default=None), ): if session is None and token is None: await websocket.close(code=status.WS_1008_POLICY_VIOLATION) @@ -69,7 +69,7 @@ async def get_cookie_or_token( async def websocket_endpoint( websocket: WebSocket, item_id: str, - q: Optional[int] = None, + q: Union[int, None] = None, cookie_or_token: str = Depends(get_cookie_or_token), ): await websocket.accept() From 0a8d6871fb860a1dcedd169035c9df847825439a Mon Sep 17 00:00:00 2001 From: github-actions Date: Sat, 14 May 2022 12:00:32 +0000 Subject: [PATCH 116/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 416983bc1..2a43718a1 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐Ÿ“ Add docs recommending `Union` over `Optional` and migrate source examples. PR [#4908](https://github.com/tiangolo/fastapi/pull/4908) by [@tiangolo](https://github.com/tiangolo). * โœจ Add support for not needing `...` as default value in required Query(), Path(), Header(), etc.. PR [#4906](https://github.com/tiangolo/fastapi/pull/4906) by [@tiangolo](https://github.com/tiangolo). * ๐ŸŽจ Fix default value as set in tutorial for Path Operations Advanced Configurations. PR [#4899](https://github.com/tiangolo/fastapi/pull/4899) by [@tiangolo](https://github.com/tiangolo). * โ™ป Refactor dict value extraction to minimize key lookups `fastapi/utils.py`. PR [#3139](https://github.com/tiangolo/fastapi/pull/3139) by [@ShahriyarR](https://github.com/ShahriyarR). From acab64b3c355a2aeb13c7739a639f9fe2a03bc1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Sat, 14 May 2022 14:08:31 -0500 Subject: [PATCH 117/168] =?UTF-8?q?=E2=9C=85=20Add=20tests=20for=20require?= =?UTF-8?q?d=20nonable=20parameters=20and=20body=20fields=20(#4907)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_required_noneable.py | 62 +++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 tests/test_required_noneable.py diff --git a/tests/test_required_noneable.py b/tests/test_required_noneable.py new file mode 100644 index 000000000..5da8cd4d0 --- /dev/null +++ b/tests/test_required_noneable.py @@ -0,0 +1,62 @@ +from typing import Union + +from fastapi import Body, FastAPI, Query +from fastapi.testclient import TestClient + +app = FastAPI() + + +@app.get("/query") +def read_query(q: Union[str, None]): + return q + + +@app.get("/explicit-query") +def read_explicit_query(q: Union[str, None] = Query()): + return q + + +@app.post("/body-embed") +def send_body_embed(b: Union[str, None] = Body(embed=True)): + return b + + +client = TestClient(app) + + +def test_required_nonable_query_invalid(): + response = client.get("/query") + assert response.status_code == 422 + + +def test_required_noneable_query_value(): + response = client.get("/query", params={"q": "foo"}) + assert response.status_code == 200 + assert response.json() == "foo" + + +def test_required_nonable_explicit_query_invalid(): + response = client.get("/explicit-query") + assert response.status_code == 422 + + +def test_required_nonable_explicit_query_value(): + response = client.get("/explicit-query", params={"q": "foo"}) + assert response.status_code == 200 + assert response.json() == "foo" + + +def test_required_nonable_body_embed_no_content(): + response = client.post("/body-embed") + assert response.status_code == 422 + + +def test_required_nonable_body_embed_invalid(): + response = client.post("/body-embed", json={"invalid": "invalid"}) + assert response.status_code == 422 + + +def test_required_noneable_body_embed_value(): + response = client.post("/body-embed", json={"b": "foo"}) + assert response.status_code == 200 + assert response.json() == "foo" From 1711403732cf092ac69cfca0783862631489ad21 Mon Sep 17 00:00:00 2001 From: github-actions Date: Sat, 14 May 2022 19:09:00 +0000 Subject: [PATCH 118/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 2a43718a1..81bc21645 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* โœ… Add tests for required nonable parameters and body fields. PR [#4907](https://github.com/tiangolo/fastapi/pull/4907) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ“ Add docs recommending `Union` over `Optional` and migrate source examples. PR [#4908](https://github.com/tiangolo/fastapi/pull/4908) by [@tiangolo](https://github.com/tiangolo). * โœจ Add support for not needing `...` as default value in required Query(), Path(), Header(), etc.. PR [#4906](https://github.com/tiangolo/fastapi/pull/4906) by [@tiangolo](https://github.com/tiangolo). * ๐ŸŽจ Fix default value as set in tutorial for Path Operations Advanced Configurations. PR [#4899](https://github.com/tiangolo/fastapi/pull/4899) by [@tiangolo](https://github.com/tiangolo). From 1673b3ec118d5b7efe4865d1d752ff2a878282c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Sat, 14 May 2022 14:53:50 -0500 Subject: [PATCH 119/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 106 ++++++++++++++++++++++++++++++---- 1 file changed, 94 insertions(+), 12 deletions(-) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 81bc21645..a671fe276 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,27 +2,109 @@ ## Latest Changes -* โœ… Add tests for required nonable parameters and body fields. PR [#4907](https://github.com/tiangolo/fastapi/pull/4907) by [@tiangolo](https://github.com/tiangolo). -* ๐Ÿ“ Add docs recommending `Union` over `Optional` and migrate source examples. PR [#4908](https://github.com/tiangolo/fastapi/pull/4908) by [@tiangolo](https://github.com/tiangolo). -* โœจ Add support for not needing `...` as default value in required Query(), Path(), Header(), etc.. PR [#4906](https://github.com/tiangolo/fastapi/pull/4906) by [@tiangolo](https://github.com/tiangolo). +### Features + +* โœจ Add support for omitting `...` as default value when declaring required parameters with: + +* `Path()` +* `Query()` +* `Header()` +* `Cookie()` +* `Body()` +* `Form()` +* `File()` + +New docs at [Tutorial - Query Parameters and String Validations - Make it required](https://fastapi.tiangolo.com/tutorial/query-params-str-validations/#make-it-required). PR [#4906](https://github.com/tiangolo/fastapi/pull/4906) by [@tiangolo](https://github.com/tiangolo). + +Up to now, declaring a required parameter while adding additional validation or metadata needed using `...` (Ellipsis). + +For example: + +```Python +from fastapi import Cookie, FastAPI, Header, Path, Query + +app = FastAPI() + + +@app.get("/items/{item_id}") +def main( + item_id: int = Path(default=..., gt=0), + query: str = Query(default=..., max_length=10), + session: str = Cookie(default=..., min_length=3), + x_trace: str = Header(default=..., title="Tracing header"), +): + return {"message": "Hello World"} +``` + +...all these parameters are required because the default value is `...` (Ellipsis). + +But now it's possible and supported to just omit the default value, as would be done with Pydantic fields, and the parameters would still be required. + +โœจ For example, this is now supported: + +```Python +from fastapi import Cookie, FastAPI, Header, Path, Query + +app = FastAPI() + + +@app.get("/items/{item_id}") +def main( + item_id: int = Path(gt=0), + query: str = Query(max_length=10), + session: str = Cookie(min_length=3), + x_trace: str = Header(title="Tracing header"), +): + return {"message": "Hello World"} +``` + +To declare parameters as optional (not required), you can set a default value as always, for example using `None`: + +```Python +from typing import Union +from fastapi import Cookie, FastAPI, Header, Path, Query + +app = FastAPI() + + +@app.get("/items/{item_id}") +def main( + item_id: int = Path(gt=0), + query: Union[str, None] = Query(default=None, max_length=10), + session: Union[str, None] = Cookie(default=None, min_length=3), + x_trace: Union[str, None] = Header(default=None, title="Tracing header"), +): + return {"message": "Hello World"} +``` + +### Docs + +* ๐Ÿ“ Add docs recommending `Union` over `Optional` and migrate source examples. New docs at [Python Types Intro - Using `Union` or `Optional`](https://fastapi.tiangolo.com/python-types/#using-union-or-optional). PR [#4908](https://github.com/tiangolo/fastapi/pull/4908) by [@tiangolo](https://github.com/tiangolo). * ๐ŸŽจ Fix default value as set in tutorial for Path Operations Advanced Configurations. PR [#4899](https://github.com/tiangolo/fastapi/pull/4899) by [@tiangolo](https://github.com/tiangolo). +* ๐Ÿ“ Add documentation for redefined path operations. PR [#4864](https://github.com/tiangolo/fastapi/pull/4864) by [@madkinsz](https://github.com/madkinsz). +* ๐Ÿ“ Updates links for Celery documentation. PR [#4736](https://github.com/tiangolo/fastapi/pull/4736) by [@sammyzord](https://github.com/sammyzord). +* โœ Fix example code with sets in tutorial for body nested models. PR [#3030](https://github.com/tiangolo/fastapi/pull/3030) by [@hitrust](https://github.com/hitrust). +* โœ Fix links to Pydantic docs. PR [#4670](https://github.com/tiangolo/fastapi/pull/4670) by [@kinuax](https://github.com/kinuax). +* ๐Ÿ“ Update docs about Swagger UI self-hosting with newer source links. PR [#4813](https://github.com/tiangolo/fastapi/pull/4813) by [@Kastakin](https://github.com/Kastakin). +* ๐Ÿ“ Add link to external article: Building the Poll App From Django Tutorial With FastAPI And React. PR [#4778](https://github.com/tiangolo/fastapi/pull/4778) by [@jbrocher](https://github.com/jbrocher). +* ๐Ÿ“ Add OpenAPI warning to "Body - Fields" docs with extra schema extensions. PR [#4846](https://github.com/tiangolo/fastapi/pull/4846) by [@ml-evs](https://github.com/ml-evs). + +### Translations + +* ๐ŸŒ Fix code examples in Japanese translation for `docs/ja/docs/tutorial/testing.md`. PR [#4623](https://github.com/tiangolo/fastapi/pull/4623) by [@hirotoKirimaru](https://github.com/hirotoKirimaru). + +### Internal + * โ™ป Refactor dict value extraction to minimize key lookups `fastapi/utils.py`. PR [#3139](https://github.com/tiangolo/fastapi/pull/3139) by [@ShahriyarR](https://github.com/ShahriyarR). +* โœ… Add tests for required nonable parameters and body fields. PR [#4907](https://github.com/tiangolo/fastapi/pull/4907) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ‘ท Fix installing Material for MkDocs Insiders in CI. PR [#4897](https://github.com/tiangolo/fastapi/pull/4897) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ‘ท Add pre-commit CI instead of custom GitHub Action. PR [#4896](https://github.com/tiangolo/fastapi/pull/4896) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ‘ท Add pre-commit GitHub Action workflow. PR [#4895](https://github.com/tiangolo/fastapi/pull/4895) by [@tiangolo](https://github.com/tiangolo). -* ๐Ÿ“ Add documentation for redefined path operations. PR [#4864](https://github.com/tiangolo/fastapi/pull/4864) by [@madkinsz](https://github.com/madkinsz). +* ๐Ÿ“ Add dark mode auto switch to docs based on OS preference. PR [#4869](https://github.com/tiangolo/fastapi/pull/4869) by [@ComicShrimp](https://github.com/ComicShrimp). * ๐Ÿ”ฅ Remove un-used old pending tests, already covered in other places. PR [#4891](https://github.com/tiangolo/fastapi/pull/4891) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ”ง Add Python formatting hooks to pre-commit. PR [#4890](https://github.com/tiangolo/fastapi/pull/4890) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ”ง Add pre-commit with first config and first formatting pass. PR [#4888](https://github.com/tiangolo/fastapi/pull/4888) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ‘ท Disable CI installing Material for MkDocs in forks. PR [#4410](https://github.com/tiangolo/fastapi/pull/4410) by [@dolfinus](https://github.com/dolfinus). -* ๐Ÿ“ Add OpenAPI warning to "Body - Fields" docs with extra schema extensions. PR [#4846](https://github.com/tiangolo/fastapi/pull/4846) by [@ml-evs](https://github.com/ml-evs). -* ๐Ÿ“ Add dark mode auto switch to docs based on OS preference. PR [#4869](https://github.com/tiangolo/fastapi/pull/4869) by [@ComicShrimp](https://github.com/ComicShrimp). -* ๐Ÿ“ Update docs about Swagger UI self-hosting with newer source links. PR [#4813](https://github.com/tiangolo/fastapi/pull/4813) by [@Kastakin](https://github.com/Kastakin). -* ๐Ÿ“ Add link to external article: Building the Poll App From Django Tutorial With FastAPI And React. PR [#4778](https://github.com/tiangolo/fastapi/pull/4778) by [@jbrocher](https://github.com/jbrocher). -* ๐ŸŒ Fix code examples in Japanese translation for `docs/ja/docs/tutorial/testing.md`. PR [#4623](https://github.com/tiangolo/fastapi/pull/4623) by [@hirotoKirimaru](https://github.com/hirotoKirimaru). -* ๐Ÿ“ Updates links for Celery documentation. PR [#4736](https://github.com/tiangolo/fastapi/pull/4736) by [@sammyzord](https://github.com/sammyzord). -* โœ Fix example code with sets in tutorial for body nested models. PR [#3030](https://github.com/tiangolo/fastapi/pull/3030) by [@hitrust](https://github.com/hitrust). -* โœ Fix links to Pydantic docs. PR [#4670](https://github.com/tiangolo/fastapi/pull/4670) by [@kinuax](https://github.com/kinuax). ## 0.77.1 From 1876ebc77949a9a254909ec61ea0c09365169ec2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Sat, 14 May 2022 14:58:04 -0500 Subject: [PATCH 120/168] =?UTF-8?q?=F0=9F=94=96=20Release=20version=200.78?= =?UTF-8?q?.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 3 +++ fastapi/__init__.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index a671fe276..edc58171b 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,9 @@ ## Latest Changes + +## 0.78.0 + ### Features * โœจ Add support for omitting `...` as default value when declaring required parameters with: diff --git a/fastapi/__init__.py b/fastapi/__init__.py index 1a4d00162..2465e2c27 100644 --- a/fastapi/__init__.py +++ b/fastapi/__init__.py @@ -1,6 +1,6 @@ """FastAPI framework, high performance, easy to learn, fast to code, ready for production""" -__version__ = "0.77.1" +__version__ = "0.78.0" from starlette import status as status From d8f3e8f20de8ebca5293f5b3ce71ee93c9124328 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Sat, 25 Jun 2022 21:49:44 +0200 Subject: [PATCH 121/168] =?UTF-8?q?=F0=9F=94=A7=20Update=20sponsors,=20rem?= =?UTF-8?q?ove=20Classiq,=20add=20ImgWhale=20(#5079)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ๐Ÿ”ง Update sponsors, remove Classiq, add ImgWhale * ๐Ÿ”ง Update README --- README.md | 2 +- docs/en/data/sponsors.yml | 6 ++-- docs/en/data/sponsors_badge.yml | 1 + docs/en/docs/img/sponsors/imgwhale-banner.svg | 14 ++++++++++ docs/en/docs/img/sponsors/imgwhale.svg | 28 +++++++++++++++++++ docs/en/overrides/main.html | 8 +++--- 6 files changed, 51 insertions(+), 8 deletions(-) create mode 100644 docs/en/docs/img/sponsors/imgwhale-banner.svg create mode 100644 docs/en/docs/img/sponsors/imgwhale.svg diff --git a/README.md b/README.md index 5e9e97a2a..d605affac 100644 --- a/README.md +++ b/README.md @@ -49,8 +49,8 @@ The key features are: - + diff --git a/docs/en/data/sponsors.yml b/docs/en/data/sponsors.yml index ac825193b..2fc08b3a5 100644 --- a/docs/en/data/sponsors.yml +++ b/docs/en/data/sponsors.yml @@ -5,12 +5,12 @@ gold: - url: https://cryptapi.io/ title: "CryptAPI: Your easy to use, secure and privacy oriented payment gateway." img: https://fastapi.tiangolo.com/img/sponsors/cryptapi.svg - - url: https://classiq.link/n4s - title: Join the team building a new SaaS platform that will change the computing world - img: https://fastapi.tiangolo.com/img/sponsors/classiq.png - url: https://www.dropbase.io/careers title: Dropbase - seamlessly collect, clean, and centralize data. img: https://fastapi.tiangolo.com/img/sponsors/dropbase.svg + - url: https://app.imgwhale.xyz/ + title: The ultimate solution to unlimited and forever cloud storage. + img: https://fastapi.tiangolo.com/img/sponsors/imgwhale.svg silver: - url: https://www.deta.sh/?ref=fastapi title: The launchpad for all your (team's) ideas diff --git a/docs/en/data/sponsors_badge.yml b/docs/en/data/sponsors_badge.yml index 1c8b0cde7..10a31b86a 100644 --- a/docs/en/data/sponsors_badge.yml +++ b/docs/en/data/sponsors_badge.yml @@ -10,3 +10,4 @@ logins: - InesIvanova - DropbaseHQ - VincentParedes + - BLUE-DEVIL1134 diff --git a/docs/en/docs/img/sponsors/imgwhale-banner.svg b/docs/en/docs/img/sponsors/imgwhale-banner.svg new file mode 100644 index 000000000..db87cc4c9 --- /dev/null +++ b/docs/en/docs/img/sponsors/imgwhale-banner.svg @@ -0,0 +1,14 @@ + + + + + + + + + + ImgWhale + The ultimate solution to unlimited and forevercloud storage. + + diff --git a/docs/en/docs/img/sponsors/imgwhale.svg b/docs/en/docs/img/sponsors/imgwhale.svg new file mode 100644 index 000000000..46aefd930 --- /dev/null +++ b/docs/en/docs/img/sponsors/imgwhale.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + ImgWhale + + The ultimate solution to unlimited and forever cloud storage. + + The ultimate solution to unlimited and forever cloud storage. + + + + diff --git a/docs/en/overrides/main.html b/docs/en/overrides/main.html index eb1cb5c82..62063da47 100644 --- a/docs/en/overrides/main.html +++ b/docs/en/overrides/main.html @@ -41,15 +41,15 @@ From f8c875bb3fd2f01112df666c4ab4ff4d1fe7d49b Mon Sep 17 00:00:00 2001 From: github-actions Date: Sat, 25 Jun 2022 19:50:20 +0000 Subject: [PATCH 122/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index edc58171b..0e60b0abf 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐Ÿ”ง Update sponsors, remove Classiq, add ImgWhale. PR [#5079](https://github.com/tiangolo/fastapi/pull/5079) by [@tiangolo](https://github.com/tiangolo). ## 0.78.0 From 6c6382df4d2d2c9f003658dae42f84fd2fbad36c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Fri, 1 Jul 2022 10:58:40 +0200 Subject: [PATCH 123/168] =?UTF-8?q?=F0=9F=94=A7=20Update=20sponsors,=20rem?= =?UTF-8?q?ove=20Dropbase,=20add=20Doist=20(#5096)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- docs/en/data/sponsors.yml | 6 +-- docs/en/docs/img/sponsors/doist-banner.svg | 46 ++++++++++++++++++ docs/en/docs/img/sponsors/doist.svg | 54 ++++++++++++++++++++++ docs/en/overrides/main.html | 8 ++-- 5 files changed, 108 insertions(+), 8 deletions(-) create mode 100644 docs/en/docs/img/sponsors/doist-banner.svg create mode 100644 docs/en/docs/img/sponsors/doist.svg diff --git a/README.md b/README.md index d605affac..505005ae9 100644 --- a/README.md +++ b/README.md @@ -49,8 +49,8 @@ The key features are: - + diff --git a/docs/en/data/sponsors.yml b/docs/en/data/sponsors.yml index 2fc08b3a5..c99c4b57a 100644 --- a/docs/en/data/sponsors.yml +++ b/docs/en/data/sponsors.yml @@ -5,12 +5,12 @@ gold: - url: https://cryptapi.io/ title: "CryptAPI: Your easy to use, secure and privacy oriented payment gateway." img: https://fastapi.tiangolo.com/img/sponsors/cryptapi.svg - - url: https://www.dropbase.io/careers - title: Dropbase - seamlessly collect, clean, and centralize data. - img: https://fastapi.tiangolo.com/img/sponsors/dropbase.svg - url: https://app.imgwhale.xyz/ title: The ultimate solution to unlimited and forever cloud storage. img: https://fastapi.tiangolo.com/img/sponsors/imgwhale.svg + - url: https://doist.com/careers/9B437B1615-wa-senior-backend-engineer-python + title: Help us migrate doist to FastAPI + img: https://fastapi.tiangolo.com/img/sponsors/doist.svg silver: - url: https://www.deta.sh/?ref=fastapi title: The launchpad for all your (team's) ideas diff --git a/docs/en/docs/img/sponsors/doist-banner.svg b/docs/en/docs/img/sponsors/doist-banner.svg new file mode 100644 index 000000000..3a4d9a295 --- /dev/null +++ b/docs/en/docs/img/sponsors/doist-banner.svg @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/en/docs/img/sponsors/doist.svg b/docs/en/docs/img/sponsors/doist.svg new file mode 100644 index 000000000..b55855f06 --- /dev/null +++ b/docs/en/docs/img/sponsors/doist.svg @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/en/overrides/main.html b/docs/en/overrides/main.html index 62063da47..9bed0253f 100644 --- a/docs/en/overrides/main.html +++ b/docs/en/overrides/main.html @@ -41,15 +41,15 @@ From 80472301817d3581f56163874b42d06c26d99942 Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 1 Jul 2022 08:59:26 +0000 Subject: [PATCH 124/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 0e60b0abf..2ae0a2ed0 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐Ÿ”ง Update sponsors, remove Dropbase, add Doist. PR [#5096](https://github.com/tiangolo/fastapi/pull/5096) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ”ง Update sponsors, remove Classiq, add ImgWhale. PR [#5079](https://github.com/tiangolo/fastapi/pull/5079) by [@tiangolo](https://github.com/tiangolo). ## 0.78.0 From b7686435777d1d4f79adad8f29191039bbc558b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Mon, 11 Jul 2022 21:30:41 +0200 Subject: [PATCH 125/168] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Move=20from=20`Opt?= =?UTF-8?q?ional[X]`=20to=20`Union[X,=20None]`=20for=20internal=20utils=20?= =?UTF-8?q?(#5124)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../comment-docs-preview-in-pr/app/main.py | 6 +++--- .../actions/notify-translations/app/main.py | 6 +++--- .github/actions/people/app/main.py | 18 +++++++++--------- .github/actions/watch-previews/app/main.py | 6 +++--- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/actions/comment-docs-preview-in-pr/app/main.py b/.github/actions/comment-docs-preview-in-pr/app/main.py index c9fb7cbbe..68914fdb9 100644 --- a/.github/actions/comment-docs-preview-in-pr/app/main.py +++ b/.github/actions/comment-docs-preview-in-pr/app/main.py @@ -1,7 +1,7 @@ import logging import sys from pathlib import Path -from typing import Optional +from typing import Union import httpx from github import Github @@ -14,7 +14,7 @@ github_api = "https://api.github.com" class Settings(BaseSettings): github_repository: str github_event_path: Path - github_event_name: Optional[str] = None + github_event_name: Union[str, None] = None input_token: SecretStr input_deploy_url: str @@ -42,7 +42,7 @@ if __name__ == "__main__": except ValidationError as e: logging.error(f"Error parsing event file: {e.errors()}") sys.exit(0) - use_pr: Optional[PullRequest] = None + use_pr: Union[PullRequest, None] = None for pr in repo.get_pulls(): if pr.head.sha == event.workflow_run.head_commit.id: use_pr = pr diff --git a/.github/actions/notify-translations/app/main.py b/.github/actions/notify-translations/app/main.py index 823685e00..d4ba0ecfc 100644 --- a/.github/actions/notify-translations/app/main.py +++ b/.github/actions/notify-translations/app/main.py @@ -2,7 +2,7 @@ import logging import random import time from pathlib import Path -from typing import Dict, Optional +from typing import Dict, Union import yaml from github import Github @@ -18,8 +18,8 @@ class Settings(BaseSettings): github_repository: str input_token: SecretStr github_event_path: Path - github_event_name: Optional[str] = None - input_debug: Optional[bool] = False + github_event_name: Union[str, None] = None + input_debug: Union[bool, None] = False class PartialGitHubEventIssue(BaseModel): diff --git a/.github/actions/people/app/main.py b/.github/actions/people/app/main.py index 9de6fc250..1455d01ca 100644 --- a/.github/actions/people/app/main.py +++ b/.github/actions/people/app/main.py @@ -4,7 +4,7 @@ import sys from collections import Counter, defaultdict from datetime import datetime, timedelta, timezone from pathlib import Path -from typing import Container, DefaultDict, Dict, List, Optional, Set +from typing import Container, DefaultDict, Dict, List, Set, Union import httpx import yaml @@ -133,7 +133,7 @@ class Author(BaseModel): class CommentsNode(BaseModel): createdAt: datetime - author: Optional[Author] = None + author: Union[Author, None] = None class Comments(BaseModel): @@ -142,7 +142,7 @@ class Comments(BaseModel): class IssuesNode(BaseModel): number: int - author: Optional[Author] = None + author: Union[Author, None] = None title: str createdAt: datetime state: str @@ -179,7 +179,7 @@ class Labels(BaseModel): class ReviewNode(BaseModel): - author: Optional[Author] = None + author: Union[Author, None] = None state: str @@ -190,7 +190,7 @@ class Reviews(BaseModel): class PullRequestNode(BaseModel): number: int labels: Labels - author: Optional[Author] = None + author: Union[Author, None] = None title: str createdAt: datetime state: str @@ -263,7 +263,7 @@ class Settings(BaseSettings): def get_graphql_response( - *, settings: Settings, query: str, after: Optional[str] = None + *, settings: Settings, query: str, after: Union[str, None] = None ): headers = {"Authorization": f"token {settings.input_token.get_secret_value()}"} variables = {"after": after} @@ -280,19 +280,19 @@ def get_graphql_response( return data -def get_graphql_issue_edges(*, settings: Settings, after: Optional[str] = None): +def get_graphql_issue_edges(*, settings: Settings, after: Union[str, None] = None): data = get_graphql_response(settings=settings, query=issues_query, after=after) graphql_response = IssuesResponse.parse_obj(data) return graphql_response.data.repository.issues.edges -def get_graphql_pr_edges(*, settings: Settings, after: Optional[str] = None): +def get_graphql_pr_edges(*, settings: Settings, after: Union[str, None] = None): data = get_graphql_response(settings=settings, query=prs_query, after=after) graphql_response = PRsResponse.parse_obj(data) return graphql_response.data.repository.pullRequests.edges -def get_graphql_sponsor_edges(*, settings: Settings, after: Optional[str] = None): +def get_graphql_sponsor_edges(*, settings: Settings, after: Union[str, None] = None): data = get_graphql_response(settings=settings, query=sponsors_query, after=after) graphql_response = SponsorsResponse.parse_obj(data) return graphql_response.data.user.sponsorshipsAsMaintainer.edges diff --git a/.github/actions/watch-previews/app/main.py b/.github/actions/watch-previews/app/main.py index 3b3520599..51285d02b 100644 --- a/.github/actions/watch-previews/app/main.py +++ b/.github/actions/watch-previews/app/main.py @@ -1,7 +1,7 @@ import logging from datetime import datetime from pathlib import Path -from typing import List, Optional +from typing import List, Union import httpx from github import Github @@ -16,7 +16,7 @@ class Settings(BaseSettings): input_token: SecretStr github_repository: str github_event_path: Path - github_event_name: Optional[str] = None + github_event_name: Union[str, None] = None class Artifact(BaseModel): @@ -74,7 +74,7 @@ if __name__ == "__main__": logging.info(f"Docs preview was notified: {notified}") if not notified: artifact_name = f"docs-zip-{commit}" - use_artifact: Optional[Artifact] = None + use_artifact: Union[Artifact, None] = None for artifact in artifacts_response.artifacts: if artifact.name == artifact_name: use_artifact = artifact From bea5194ffcbc943f7666a8ac46950936a0a43811 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 11 Jul 2022 19:31:26 +0000 Subject: [PATCH 126/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 2ae0a2ed0..9e5ed6371 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* โ™ป๏ธ Move from `Optional[X]` to `Union[X, None]` for internal utils. PR [#5124](https://github.com/tiangolo/fastapi/pull/5124) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ”ง Update sponsors, remove Dropbase, add Doist. PR [#5096](https://github.com/tiangolo/fastapi/pull/5096) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ”ง Update sponsors, remove Classiq, add ImgWhale. PR [#5079](https://github.com/tiangolo/fastapi/pull/5079) by [@tiangolo](https://github.com/tiangolo). From 1d5bbe5552a7eb9f7cefd3ae265c12c18dd67974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Tue, 12 Jul 2022 18:53:38 +0200 Subject: [PATCH 127/168] =?UTF-8?q?=F0=9F=91=B7=20Add=20Dependabot=20(#512?= =?UTF-8?q?8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/dependabot.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..946f2358c --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,12 @@ +version: 2 +updates: + # GitHub Actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + # Python + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "daily" From a0fd613527d4bb3e035b5c00051c654777dcbca1 Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 12 Jul 2022 16:54:11 +0000 Subject: [PATCH 128/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 9e5ed6371..e7326d0f1 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐Ÿ‘ท Add Dependabot. PR [#5128](https://github.com/tiangolo/fastapi/pull/5128) by [@tiangolo](https://github.com/tiangolo). * โ™ป๏ธ Move from `Optional[X]` to `Union[X, None]` for internal utils. PR [#5124](https://github.com/tiangolo/fastapi/pull/5124) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ”ง Update sponsors, remove Dropbase, add Doist. PR [#5096](https://github.com/tiangolo/fastapi/pull/5096) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ”ง Update sponsors, remove Classiq, add ImgWhale. PR [#5079](https://github.com/tiangolo/fastapi/pull/5079) by [@tiangolo](https://github.com/tiangolo). From c43120258fa89bc20d6f8ee671b6ead9ab223fc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Thu, 14 Jul 2022 13:19:42 +0200 Subject: [PATCH 129/168] =?UTF-8?q?=F0=9F=90=9B=20Fix=20removing=20body=20?= =?UTF-8?q?from=20status=20codes=20that=20do=20not=20support=20it=20(#5145?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fastapi/openapi/constants.py | 1 - fastapi/openapi/utils.py | 12 ++++------- fastapi/routing.py | 33 +++++++++++++++++------------ fastapi/utils.py | 7 ++++++ tests/test_response_code_no_body.py | 9 +++++++- 5 files changed, 38 insertions(+), 24 deletions(-) diff --git a/fastapi/openapi/constants.py b/fastapi/openapi/constants.py index 3e69e5524..1897ad750 100644 --- a/fastapi/openapi/constants.py +++ b/fastapi/openapi/constants.py @@ -1,3 +1,2 @@ METHODS_WITH_BODY = {"GET", "HEAD", "POST", "PUT", "DELETE", "PATCH"} -STATUS_CODES_WITH_NO_BODY = {100, 101, 102, 103, 204, 304} REF_PREFIX = "#/components/schemas/" diff --git a/fastapi/openapi/utils.py b/fastapi/openapi/utils.py index 4eb727bd4..5d3d95c24 100644 --- a/fastapi/openapi/utils.py +++ b/fastapi/openapi/utils.py @@ -9,11 +9,7 @@ from fastapi.datastructures import DefaultPlaceholder from fastapi.dependencies.models import Dependant from fastapi.dependencies.utils import get_flat_dependant, get_flat_params from fastapi.encoders import jsonable_encoder -from fastapi.openapi.constants import ( - METHODS_WITH_BODY, - REF_PREFIX, - STATUS_CODES_WITH_NO_BODY, -) +from fastapi.openapi.constants import METHODS_WITH_BODY, REF_PREFIX from fastapi.openapi.models import OpenAPI from fastapi.params import Body, Param from fastapi.responses import Response @@ -21,6 +17,7 @@ from fastapi.utils import ( deep_dict_update, generate_operation_id_for_path, get_model_definitions, + is_body_allowed_for_status_code, ) from pydantic import BaseModel from pydantic.fields import ModelField, Undefined @@ -265,9 +262,8 @@ def get_openapi_path( operation.setdefault("responses", {}).setdefault(status_code, {})[ "description" ] = route.response_description - if ( - route_response_media_type - and route.status_code not in STATUS_CODES_WITH_NO_BODY + if route_response_media_type and is_body_allowed_for_status_code( + route.status_code ): response_schema = {"type": "string"} if lenient_issubclass(current_response_class, JSONResponse): diff --git a/fastapi/routing.py b/fastapi/routing.py index a6542c15a..6f1a8e900 100644 --- a/fastapi/routing.py +++ b/fastapi/routing.py @@ -29,13 +29,13 @@ from fastapi.dependencies.utils import ( ) from fastapi.encoders import DictIntStrAny, SetIntStr, jsonable_encoder from fastapi.exceptions import RequestValidationError, WebSocketRequestValidationError -from fastapi.openapi.constants import STATUS_CODES_WITH_NO_BODY from fastapi.types import DecoratedCallable from fastapi.utils import ( create_cloned_field, create_response_field, generate_unique_id, get_value_or_default, + is_body_allowed_for_status_code, ) from pydantic import BaseModel from pydantic.error_wrappers import ErrorWrapper, ValidationError @@ -232,7 +232,17 @@ def get_request_handler( if raw_response.background is None: raw_response.background = background_tasks return raw_response - response_data = await serialize_response( + response_args: Dict[str, Any] = {"background": background_tasks} + # If status_code was set, use it, otherwise use the default from the + # response class, in the case of redirect it's 307 + current_status_code = ( + status_code if status_code else sub_response.status_code + ) + if current_status_code is not None: + response_args["status_code"] = current_status_code + if sub_response.status_code: + response_args["status_code"] = sub_response.status_code + content = await serialize_response( field=response_field, response_content=raw_response, include=response_model_include, @@ -243,15 +253,10 @@ def get_request_handler( exclude_none=response_model_exclude_none, is_coroutine=is_coroutine, ) - response_args: Dict[str, Any] = {"background": background_tasks} - # If status_code was set, use it, otherwise use the default from the - # response class, in the case of redirect it's 307 - if status_code is not None: - response_args["status_code"] = status_code - response = actual_response_class(response_data, **response_args) + response = actual_response_class(content, **response_args) + if not is_body_allowed_for_status_code(status_code): + response.body = b"" response.headers.raw.extend(sub_response.headers.raw) - if sub_response.status_code: - response.status_code = sub_response.status_code return response return app @@ -377,8 +382,8 @@ class APIRoute(routing.Route): status_code = int(status_code) self.status_code = status_code if self.response_model: - assert ( - status_code not in STATUS_CODES_WITH_NO_BODY + assert is_body_allowed_for_status_code( + status_code ), f"Status code {status_code} must not have a response body" response_name = "Response_" + self.unique_id self.response_field = create_response_field( @@ -410,8 +415,8 @@ class APIRoute(routing.Route): assert isinstance(response, dict), "An additional response must be a dict" model = response.get("model") if model: - assert ( - additional_status_code not in STATUS_CODES_WITH_NO_BODY + assert is_body_allowed_for_status_code( + additional_status_code ), f"Status code {additional_status_code} must not have a response body" response_name = f"Response_{additional_status_code}_{self.unique_id}" response_field = create_response_field(name=response_name, type_=model) diff --git a/fastapi/utils.py b/fastapi/utils.py index a7e135bca..887d57c90 100644 --- a/fastapi/utils.py +++ b/fastapi/utils.py @@ -18,6 +18,13 @@ if TYPE_CHECKING: # pragma: nocover from .routing import APIRoute +def is_body_allowed_for_status_code(status_code: Union[int, str, None]) -> bool: + if status_code is None: + return True + current_status_code = int(status_code) + return not (current_status_code < 200 or current_status_code in {204, 304}) + + def get_model_definitions( *, flat_models: Set[Union[Type[BaseModel], Type[Enum]]], diff --git a/tests/test_response_code_no_body.py b/tests/test_response_code_no_body.py index 45e2fabc7..6d9b5c333 100644 --- a/tests/test_response_code_no_body.py +++ b/tests/test_response_code_no_body.py @@ -28,7 +28,7 @@ class JsonApiError(BaseModel): responses={500: {"description": "Error", "model": JsonApiError}}, ) async def a(): - pass # pragma: no cover + pass @app.get("/b", responses={204: {"description": "No Content"}}) @@ -106,3 +106,10 @@ def test_openapi_schema(): response = client.get("/openapi.json") assert response.status_code == 200, response.text assert response.json() == openapi_schema + + +def test_get_response(): + response = client.get("/a") + assert response.status_code == 204, response.text + assert "content-length" not in response.headers + assert response.content == b"" From 43d8ebfb4d118b5c904b40f66a5faaedff298611 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 14 Jul 2022 11:20:21 +0000 Subject: [PATCH 130/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index e7326d0f1..042d4a921 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐Ÿ› Fix removing body from status codes that do not support it. PR [#5145](https://github.com/tiangolo/fastapi/pull/5145) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ‘ท Add Dependabot. PR [#5128](https://github.com/tiangolo/fastapi/pull/5128) by [@tiangolo](https://github.com/tiangolo). * โ™ป๏ธ Move from `Optional[X]` to `Union[X, None]` for internal utils. PR [#5124](https://github.com/tiangolo/fastapi/pull/5124) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ”ง Update sponsors, remove Dropbase, add Doist. PR [#5096](https://github.com/tiangolo/fastapi/pull/5096) by [@tiangolo](https://github.com/tiangolo). From ff47d50a9b59bbb96d64fb12bd6d584c9aed6595 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Jul 2022 13:20:51 +0200 Subject: [PATCH 131/168] =?UTF-8?q?=E2=AC=86=20Bump=20actions/setup-python?= =?UTF-8?q?=20from=202=20to=204=20(#5129)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [actions/setup-python](https://github.com/actions/setup-python) from 2 to 4. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v2...v4) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build-docs.yml | 2 +- .github/workflows/publish.yml | 2 +- .github/workflows/test.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 505d66f9f..7f0c4fa66 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -15,7 +15,7 @@ jobs: run: echo "$GITHUB_CONTEXT" - uses: actions/checkout@v2 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: "3.7" - uses: actions/cache@v2 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9dde4e066..ad61ff7a8 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -15,7 +15,7 @@ jobs: run: echo "$GITHUB_CONTEXT" - uses: actions/checkout@v2 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: "3.6" - uses: actions/cache@v2 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f0a82344e..dbc452048 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - uses: actions/cache@v2 From 2fcf044a9009e299ed22b4ae2c376ea3163cd256 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 14 Jul 2022 11:21:27 +0000 Subject: [PATCH 132/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 042d4a921..d522ed333 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* โฌ† Bump actions/setup-python from 2 to 4. PR [#5129](https://github.com/tiangolo/fastapi/pull/5129) by [@dependabot[bot]](https://github.com/apps/dependabot). * ๐Ÿ› Fix removing body from status codes that do not support it. PR [#5145](https://github.com/tiangolo/fastapi/pull/5145) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ‘ท Add Dependabot. PR [#5128](https://github.com/tiangolo/fastapi/pull/5128) by [@tiangolo](https://github.com/tiangolo). * โ™ป๏ธ Move from `Optional[X]` to `Union[X, None]` for internal utils. PR [#5124](https://github.com/tiangolo/fastapi/pull/5124) by [@tiangolo](https://github.com/tiangolo). From 397a2e3484e043cfce857bc8a709691dad690ac4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Jul 2022 13:21:37 +0200 Subject: [PATCH 133/168] =?UTF-8?q?=E2=AC=86=20Bump=20dawidd6/action-downl?= =?UTF-8?q?oad-artifact=20from=202.9.0=20to=202.21.1=20(#5130)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bump dawidd6/action-download-artifact from 2.9.0 to 2.21.1 Bumps [dawidd6/action-download-artifact](https://github.com/dawidd6/action-download-artifact) from 2.9.0 to 2.21.1. - [Release notes](https://github.com/dawidd6/action-download-artifact/releases) - [Commits](https://github.com/dawidd6/action-download-artifact/compare/v2.9.0...v2.21.1) --- updated-dependencies: - dependency-name: dawidd6/action-download-artifact dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/preview-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/preview-docs.yml b/.github/workflows/preview-docs.yml index 104c2677f..49a9a50c1 100644 --- a/.github/workflows/preview-docs.yml +++ b/.github/workflows/preview-docs.yml @@ -12,7 +12,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Download Artifact Docs - uses: dawidd6/action-download-artifact@v2.9.0 + uses: dawidd6/action-download-artifact@v2.21.1 with: github_token: ${{ secrets.GITHUB_TOKEN }} workflow: build-docs.yml From 7c3137301b2b5051c78ae4b42c9c36fc7bbc2769 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Jul 2022 13:22:02 +0200 Subject: [PATCH 134/168] =?UTF-8?q?=E2=AC=86=20Bump=20codecov/codecov-acti?= =?UTF-8?q?on=20from=202=20to=203=20(#5131)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 2 to 3. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v2...v3) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dbc452048..dfa3ed2df 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,4 +38,4 @@ jobs: - name: Test run: bash scripts/test.sh - name: Upload coverage - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v3 From 6497cb08f5314e78f3bad842fbfc17f43be79add Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Jul 2022 13:22:16 +0200 Subject: [PATCH 135/168] =?UTF-8?q?=E2=AC=86=20Bump=20nwtgck/actions-netli?= =?UTF-8?q?fy=20from=201.1.5=20to=201.2.3=20(#5132)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build-docs.yml | 2 +- .github/workflows/preview-docs.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 7f0c4fa66..bdc664429 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -41,7 +41,7 @@ jobs: name: docs-zip path: ./docs.zip - name: Deploy to Netlify - uses: nwtgck/actions-netlify@v1.1.5 + uses: nwtgck/actions-netlify@v1.2.3 with: publish-dir: './site' production-branch: master diff --git a/.github/workflows/preview-docs.yml b/.github/workflows/preview-docs.yml index 49a9a50c1..a05b367d4 100644 --- a/.github/workflows/preview-docs.yml +++ b/.github/workflows/preview-docs.yml @@ -25,7 +25,7 @@ jobs: rm -f docs.zip - name: Deploy to Netlify id: netlify - uses: nwtgck/actions-netlify@v1.1.5 + uses: nwtgck/actions-netlify@v1.2.3 with: publish-dir: './site' production-deploy: false From 3ccb9604781cdc0d5cdfe7b112b96b0bea4044b8 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 14 Jul 2022 11:22:19 +0000 Subject: [PATCH 136/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index d522ed333..86e26372d 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* โฌ† Bump dawidd6/action-download-artifact from 2.9.0 to 2.21.1. PR [#5130](https://github.com/tiangolo/fastapi/pull/5130) by [@dependabot[bot]](https://github.com/apps/dependabot). * โฌ† Bump actions/setup-python from 2 to 4. PR [#5129](https://github.com/tiangolo/fastapi/pull/5129) by [@dependabot[bot]](https://github.com/apps/dependabot). * ๐Ÿ› Fix removing body from status codes that do not support it. PR [#5145](https://github.com/tiangolo/fastapi/pull/5145) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ‘ท Add Dependabot. PR [#5128](https://github.com/tiangolo/fastapi/pull/5128) by [@tiangolo](https://github.com/tiangolo). From b7bd3c1d55b98b475c9d1e11edf5b1a2ab96fedc Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 14 Jul 2022 11:23:15 +0000 Subject: [PATCH 137/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 86e26372d..44d08b86b 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* โฌ† Bump codecov/codecov-action from 2 to 3. PR [#5131](https://github.com/tiangolo/fastapi/pull/5131) by [@dependabot[bot]](https://github.com/apps/dependabot). * โฌ† Bump dawidd6/action-download-artifact from 2.9.0 to 2.21.1. PR [#5130](https://github.com/tiangolo/fastapi/pull/5130) by [@dependabot[bot]](https://github.com/apps/dependabot). * โฌ† Bump actions/setup-python from 2 to 4. PR [#5129](https://github.com/tiangolo/fastapi/pull/5129) by [@dependabot[bot]](https://github.com/apps/dependabot). * ๐Ÿ› Fix removing body from status codes that do not support it. PR [#5145](https://github.com/tiangolo/fastapi/pull/5145) by [@tiangolo](https://github.com/tiangolo). From c15fce3248f83444106409e82d31fa0381ce7600 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 14 Jul 2022 11:24:11 +0000 Subject: [PATCH 138/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 44d08b86b..8ff9f8fcc 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* โฌ† Bump nwtgck/actions-netlify from 1.1.5 to 1.2.3. PR [#5132](https://github.com/tiangolo/fastapi/pull/5132) by [@dependabot[bot]](https://github.com/apps/dependabot). * โฌ† Bump codecov/codecov-action from 2 to 3. PR [#5131](https://github.com/tiangolo/fastapi/pull/5131) by [@dependabot[bot]](https://github.com/apps/dependabot). * โฌ† Bump dawidd6/action-download-artifact from 2.9.0 to 2.21.1. PR [#5130](https://github.com/tiangolo/fastapi/pull/5130) by [@dependabot[bot]](https://github.com/apps/dependabot). * โฌ† Bump actions/setup-python from 2 to 4. PR [#5129](https://github.com/tiangolo/fastapi/pull/5129) by [@dependabot[bot]](https://github.com/apps/dependabot). From 100799cde2c7a9ea86c9addcf6b9a8766c9a8415 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 14 Jul 2022 13:25:32 +0200 Subject: [PATCH 139/168] =?UTF-8?q?=E2=AC=86=20[pre-commit.ci]=20pre-commi?= =?UTF-8?q?t=20autoupdate=20(#5030)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.2.0 โ†’ v4.3.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.2.0...v4.3.0) - [github.com/asottile/pyupgrade: v2.32.1 โ†’ v2.37.1](https://github.com/asottile/pyupgrade/compare/v2.32.1...v2.37.1) - [github.com/psf/black: 22.3.0 โ†’ 22.6.0](https://github.com/psf/black/compare/22.3.0...22.6.0) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5c278571e..6944e4a25 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.2.0 + rev: v4.3.0 hooks: - id: check-added-large-files - id: check-toml @@ -12,7 +12,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/asottile/pyupgrade - rev: v2.32.1 + rev: v2.37.1 hooks: - id: pyupgrade args: @@ -43,7 +43,7 @@ repos: name: isort (pyi) types: [pyi] - repo: https://github.com/psf/black - rev: 22.3.0 + rev: 22.6.0 hooks: - id: black ci: From 606028dc8c395d1f93ee9ec59047834634f5ac9e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Jul 2022 11:26:14 +0000 Subject: [PATCH 140/168] =?UTF-8?q?=E2=AC=86=20Bump=20actions/checkout=20f?= =?UTF-8?q?rom=202=20to=203=20(#5133)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bump actions/checkout from 2 to 3 Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build-docs.yml | 2 +- .github/workflows/latest-changes.yml | 2 +- .github/workflows/notify-translations.yml | 2 +- .github/workflows/people.yml | 2 +- .github/workflows/preview-docs.yml | 2 +- .github/workflows/publish.yml | 2 +- .github/workflows/test.yml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index bdc664429..512d70078 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -13,7 +13,7 @@ jobs: env: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python uses: actions/setup-python@v4 with: diff --git a/.github/workflows/latest-changes.yml b/.github/workflows/latest-changes.yml index 5783c993a..4aa8475b6 100644 --- a/.github/workflows/latest-changes.yml +++ b/.github/workflows/latest-changes.yml @@ -20,7 +20,7 @@ jobs: latest-changes: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: # To allow latest-changes to commit to master token: ${{ secrets.ACTIONS_TOKEN }} diff --git a/.github/workflows/notify-translations.yml b/.github/workflows/notify-translations.yml index 7e414ab95..2fcb7595e 100644 --- a/.github/workflows/notify-translations.yml +++ b/.github/workflows/notify-translations.yml @@ -9,7 +9,7 @@ jobs: notify-translations: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 # Allow debugging with tmate - name: Setup tmate session uses: mxschmitt/action-tmate@v3 diff --git a/.github/workflows/people.yml b/.github/workflows/people.yml index 2004ee7b3..4b47b4072 100644 --- a/.github/workflows/people.yml +++ b/.github/workflows/people.yml @@ -14,7 +14,7 @@ jobs: fastapi-people: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 # Allow debugging with tmate - name: Setup tmate session uses: mxschmitt/action-tmate@v3 diff --git a/.github/workflows/preview-docs.yml b/.github/workflows/preview-docs.yml index a05b367d4..9e71a461a 100644 --- a/.github/workflows/preview-docs.yml +++ b/.github/workflows/preview-docs.yml @@ -10,7 +10,7 @@ jobs: preview-docs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Download Artifact Docs uses: dawidd6/action-download-artifact@v2.21.1 with: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ad61ff7a8..4686fd0d4 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -13,7 +13,7 @@ jobs: env: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python uses: actions/setup-python@v4 with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dfa3ed2df..763dbc44b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,7 @@ jobs: fail-fast: false steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python uses: actions/setup-python@v4 with: From 19701d12fb9078c81072d1c4907d255554f286fd Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 14 Jul 2022 11:26:52 +0000 Subject: [PATCH 141/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 8ff9f8fcc..fcd57540b 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* โฌ† [pre-commit.ci] pre-commit autoupdate. PR [#5030](https://github.com/tiangolo/fastapi/pull/5030) by [@pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci). * โฌ† Bump nwtgck/actions-netlify from 1.1.5 to 1.2.3. PR [#5132](https://github.com/tiangolo/fastapi/pull/5132) by [@dependabot[bot]](https://github.com/apps/dependabot). * โฌ† Bump codecov/codecov-action from 2 to 3. PR [#5131](https://github.com/tiangolo/fastapi/pull/5131) by [@dependabot[bot]](https://github.com/apps/dependabot). * โฌ† Bump dawidd6/action-download-artifact from 2.9.0 to 2.21.1. PR [#5130](https://github.com/tiangolo/fastapi/pull/5130) by [@dependabot[bot]](https://github.com/apps/dependabot). From 48b7804a791579648359353ed06400d9cc595dc7 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 14 Jul 2022 11:27:49 +0000 Subject: [PATCH 142/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index fcd57540b..3fe585e72 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* โฌ† Bump actions/checkout from 2 to 3. PR [#5133](https://github.com/tiangolo/fastapi/pull/5133) by [@dependabot[bot]](https://github.com/apps/dependabot). * โฌ† [pre-commit.ci] pre-commit autoupdate. PR [#5030](https://github.com/tiangolo/fastapi/pull/5030) by [@pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci). * โฌ† Bump nwtgck/actions-netlify from 1.1.5 to 1.2.3. PR [#5132](https://github.com/tiangolo/fastapi/pull/5132) by [@dependabot[bot]](https://github.com/apps/dependabot). * โฌ† Bump codecov/codecov-action from 2 to 3. PR [#5131](https://github.com/tiangolo/fastapi/pull/5131) by [@dependabot[bot]](https://github.com/apps/dependabot). From 120cf49089f2ce0e1d34534a3295157e29026636 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Wo=C5=BAniak?= <41345824+Valaraucoo@users.noreply.github.com> Date: Thu, 14 Jul 2022 13:30:09 +0200 Subject: [PATCH 143/168] =?UTF-8?q?=F0=9F=8C=90=F0=9F=87=B5=F0=9F=87=B1=20?= =?UTF-8?q?Add=20Polish=20translation=20for=20`docs/pl/docs/tutorial/first?= =?UTF-8?q?-steps.md`=20(#5024)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: Polish translation for tutorial/first-steps.md * docs: Polish translation / fixes after cr --- docs/pl/docs/tutorial/first-steps.md | 334 +++++++++++++++++++++++++++ docs/pl/mkdocs.yml | 1 + 2 files changed, 335 insertions(+) create mode 100644 docs/pl/docs/tutorial/first-steps.md diff --git a/docs/pl/docs/tutorial/first-steps.md b/docs/pl/docs/tutorial/first-steps.md new file mode 100644 index 000000000..9406d703d --- /dev/null +++ b/docs/pl/docs/tutorial/first-steps.md @@ -0,0 +1,334 @@ +# Pierwsze kroki + +Najprostszy plik FastAPI moลผe wyglฤ…daฤ‡ tak: + +```Python +{!../../../docs_src/first_steps/tutorial001.py!} +``` + +Skopiuj to do pliku `main.py`. + +Uruchom serwer: + +
+ +```console +$ uvicorn main:app --reload + +INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit) +INFO: Started reloader process [28720] +INFO: Started server process [28722] +INFO: Waiting for application startup. +INFO: Application startup complete. +``` + +
+ +!!! note + Polecenie `uvicorn main:app` odnosi siฤ™ do: + + * `main`: plik `main.py` ("moduล‚" Python). + * `app`: obiekt utworzony w pliku `main.py` w lini `app = FastAPI()`. + * `--reload`: sprawia, ลผe serwer uruchamia siฤ™ ponownie po zmianie kodu. Uลผywany tylko w trakcie tworzenia oprogramowania. + +Na wyjล›ciu znajduje siฤ™ linia z czymล› w rodzaju: + +```hl_lines="4" +INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit) +``` + +Ta linia pokazuje adres URL, pod ktรณrym Twoja aplikacja jest obsล‚ugiwana, na Twoim lokalnym komputerze. + +### Sprawdลบ to + +Otwรณrz w swojej przeglฤ…darce http://127.0.0.1:8000. + +Zobaczysz odpowiedลบ w formacie JSON: + +```JSON +{"message": "Hello World"} +``` + +### Interaktywna dokumentacja API + +Przejdลบ teraz do http://127.0.0.1:8000/docs. + +Zobaczysz automatycznฤ… i interaktywnฤ… dokumentacjฤ™ API (dostarczonฤ… przez Swagger UI): + +![Swagger UI](https://fastapi.tiangolo.com/img/index/index-01-swagger-ui-simple.png) + +### Alternatywna dokumentacja API + +Teraz przejdลบ do http://127.0.0.1:8000/redoc. + +Zobaczysz alternatywnฤ… automatycznie wygenerowanฤ… dokumentacjฤ™ API (dostarczonฤ… przez ReDoc): + +![ReDoc](https://fastapi.tiangolo.com/img/index/index-02-redoc-simple.png) + +### OpenAPI + +**FastAPI** generuje "schemat" z caล‚ym Twoim API przy uลผyciu standardu **OpenAPI** sล‚uลผฤ…cego do definiowania API. + +#### Schema + +"Schema" jest definicjฤ… lub opisem czegoล›. Nie jest to kod, ktรณry go implementuje, ale po prostu abstrakcyjny opis. + +#### API "Schema" + +W typ przypadku, OpenAPI to specyfikacja, ktรณra dyktuje sposรณb definiowania schematu interfejsu API. + +Definicja schematu zawiera ล›cieลผki API, moลผliwe parametry, ktรณre sฤ… przyjmowane przez endpointy, itp. + +#### "Schemat" danych + +Termin "schemat" moลผe rรณwnieลผ odnosiฤ‡ siฤ™ do wyglฤ…du niektรณrych danych, takich jak zawartoล›ฤ‡ JSON. + +W takim przypadku bฤ™dzie to oznaczaฤ‡ atrybuty JSON, ich typy danych itp. + +#### OpenAPI i JSON Schema + +OpenAPI definiuje API Schema dla Twojego API, ktรณry zawiera definicje (lub "schematy") danych wysyล‚anych i odbieranych przez Twรณj interfejs API przy uลผyciu **JSON Schema**, standardu dla schematรณw danych w formacie JSON. + +#### Sprawdลบ `openapi.json` + +Jeล›li jesteล› ciekawy, jak wyglฤ…da surowy schemat OpenAPI, FastAPI automatycznie generuje JSON Schema z opisami wszystkich Twoich API. + +Moลผesz to zobaczyฤ‡ bezpoล›rednio pod adresem: http://127.0.0.1:8000/openapi.json. + +Zobaczysz JSON zaczynajฤ…cy siฤ™ od czegoล› takiego: + +```JSON +{ + "openapi": "3.0.2", + "info": { + "title": "FastAPI", + "version": "0.1.0" + }, + "paths": { + "/items/": { + "get": { + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + + + +... +``` + +#### Do czego sล‚uลผy OpenAPI + +Schemat OpenAPI jest tym, co zasila dwa doล‚ฤ…czone interaktywne systemy dokumentacji. + +Istniejฤ… dziesiฤ…tki alternatyw, wszystkie oparte na OpenAPI. Moลผesz ล‚atwo dodaฤ‡ dowolnฤ… z nich do swojej aplikacji zbudowanej za pomocฤ… **FastAPI**. + +Moลผesz go rรณwnieลผ uลผyฤ‡ do automatycznego generowania kodu dla klientรณw, ktรณrzy komunikujฤ… siฤ™ z Twoim API. Na przykล‚ad aplikacje frontendowe, mobilne lub IoT. + +## Przypomnijmy, krok po kroku + +### Krok 1: zaimportuj `FastAPI` + +```Python hl_lines="1" +{!../../../docs_src/first_steps/tutorial001.py!} +``` + +`FastAPI` jest klasฤ…, ktรณra zapewnia wszystkie funkcjonalnoล›ci Twojego API. + +!!! note "Szczegรณล‚y techniczne" + `FastAPI` jest klasฤ…, ktรณra dziedziczy bezpoล›rednio z `Starlette`. + + Oznacza to, ลผe moลผesz korzystaฤ‡ ze wszystkich funkcjonalnoล›ci Starlette rรณwnieลผ w `FastAPI`. + + +### Krok 2: utwรณrz instancjฤ™ `FastAPI` + +```Python hl_lines="3" +{!../../../docs_src/first_steps/tutorial001.py!} +``` + +Zmienna `app` bฤ™dzie tutaj "instancjฤ…" klasy `FastAPI`. + +Bฤ™dzie to gล‚รณwny punkt interakcji przy tworzeniu caล‚ego interfejsu API. + +Ta zmienna `app` jest tฤ… samฤ… zmiennฤ…, do ktรณrej odnosi siฤ™ `uvicorn` w poleceniu: + +
+ +```console +$ uvicorn main:app --reload + +INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit) +``` + +
+ +Jeล›li stworzysz swojฤ… aplikacjฤ™, np.: + +```Python hl_lines="3" +{!../../../docs_src/first_steps/tutorial002.py!} +``` + +I umieล›cisz to w pliku `main.py`, to bฤ™dziesz mรณgล‚ tak wywoล‚aฤ‡ `uvicorn`: + +
+ +```console +$ uvicorn main:my_awesome_api --reload + +INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit) +``` + +
+ +### Krok 3: wykonaj *operacjฤ™ na ล›cieลผce* + +#### ลšcieลผka + +"ลšcieลผka" tutaj odnosi siฤ™ do ostatniej czฤ™ล›ci adresu URL, zaczynajฤ…c od pierwszego `/`. + +Wiฤ™c, w adresie URL takim jak: + +``` +https://example.com/items/foo +``` + +...ล›cieลผkฤ… bฤ™dzie: + +``` +/items/foo +``` + +!!! info + "ลšcieลผka" jest zazwyczaj nazywana "path", "endpoint" lub "route'. + +Podczas budowania API, "ล›cieลผka" jest gล‚รณwnym sposobem na oddzielenie "odpowiedzialnoล›ci" i โ€žzasobรณwโ€. + +#### Operacje + +"Operacje" tutaj odnoszฤ… siฤ™ do jednej z "metod" HTTP. + +Jedna z: + +* `POST` +* `GET` +* `PUT` +* `DELETE` + +...i te bardziej egzotyczne: + +* `OPTIONS` +* `HEAD` +* `PATCH` +* `TRACE` + +W protokole HTTP moลผna komunikowaฤ‡ siฤ™ z kaลผdฤ… ล›cieลผkฤ… za pomocฤ… jednej (lub wiฤ™cej) "metod". + +--- + +Podczas tworzenia API zwykle uลผywasz tych metod HTTP do wykonania okreล›lonej akcji. + +Zazwyczaj uลผywasz: + +* `POST`: do tworzenia danych. +* `GET`: do odczytywania danych. +* `PUT`: do aktualizacji danych. +* `DELETE`: do usuwania danych. + +Tak wiฤ™c w OpenAPI kaลผda z metod HTTP nazywana jest "operacjฤ…". + +Bฤ™dziemy je rรณwnieลผ nazywali "**operacjami**". + +#### Zdefiniuj *dekorator operacji na ล›cieลผce* + +```Python hl_lines="6" +{!../../../docs_src/first_steps/tutorial001.py!} +``` + +`@app.get("/")` mรณwi **FastAPI** ลผe funkcja poniลผej odpowiada za obsล‚ugฤ™ ลผฤ…daล„, ktรณre trafiajฤ… do: + +* ล›cieลผki `/` +* uลผywajฤ…c operacji get + +!!! info "`@decorator` Info" + Skล‚adnia `@something` jest w Pythonie nazywana "dekoratorem". + + Umieszczasz to na szczycie funkcji. Jak ล‚adnฤ… ozdobnฤ… czapkฤ™ (chyba stฤ…d wziฤ™ล‚a siฤ™ nazwa). + + "Dekorator" przyjmuje funkcjฤ™ znajdujฤ…cฤ… siฤ™ poniลผej jego i coล› z niฤ… robi. + + W naszym przypadku dekorator mรณwi **FastAPI**, ลผe poniลผsza funkcja odpowiada **ล›cieลผce** `/` z **operacjฤ…** `get`. + + Jest to "**dekorator operacji na ล›cieลผce**". + +Moลผesz rรณwnieลผ uลผyฤ‡ innej operacji: + +* `@app.post()` +* `@app.put()` +* `@app.delete()` + +Oraz tych bardziej egzotycznych: + +* `@app.options()` +* `@app.head()` +* `@app.patch()` +* `@app.trace()` + +!!! tip + Moลผesz dowolnie uลผywaฤ‡ kaลผdej operacji (metody HTTP). + + **FastAPI** nie narzuca ลผadnego konkretnego znaczenia. + + Informacje tutaj sฤ… przedstawione jako wskazรณwka, a nie wymรณg. + + Na przykล‚ad, uลผywajฤ…c GraphQL, normalnie wykonujesz wszystkie akcje uลผywajฤ…c tylko operacji `POST`. + +### Krok 4: zdefiniuj **funkcjฤ™ obsล‚ugujฤ…cฤ… ล›cieลผkฤ™** + +To jest nasza "**funkcja obsล‚ugujฤ…ca ล›cieลผkฤ™**": + +* **ล›cieลผka**: to `/`. +* **operacja**: to `get`. +* **funkcja**: to funkcja poniลผej "dekoratora" (poniลผej `@app.get("/")`). + +```Python hl_lines="7" +{!../../../docs_src/first_steps/tutorial001.py!} +``` + +Jest to funkcja Python. + +Zostanie ona wywoล‚ana przez **FastAPI** za kaลผdym razem, gdy otrzyma ลผฤ…danie do adresu URL "`/`" przy uลผyciu operacji `GET`. + +W tym przypadku jest to funkcja "asynchroniczna". + +--- + +Moลผesz rรณwnieลผ zdefiniowaฤ‡ to jako normalnฤ… funkcjฤ™ zamiast `async def`: + +```Python hl_lines="7" +{!../../../docs_src/first_steps/tutorial003.py!} +``` + +!!! note + Jeล›li nie znasz rรณลผnicy, sprawdลบ [Async: *"In a hurry?"*](/async/#in-a-hurry){.internal-link target=_blank}. + +### Krok 5: zwrรณฤ‡ zawartoล›ฤ‡ + +```Python hl_lines="8" +{!../../../docs_src/first_steps/tutorial001.py!} +``` + +Moลผesz zwrรณciฤ‡ `dict`, `list`, pojedynczฤ… wartoล›ฤ‡ jako `str`, `int`, itp. + +Moลผesz rรณwnieลผ zwrรณciฤ‡ modele Pydantic (wiฤ™cej o tym pรณลบniej). + +Istnieje wiele innych obiektรณw i modeli, ktรณre zostanฤ… automatycznie skonwertowane do formatu JSON (w tym ORM itp.). Sprรณbuj uลผyฤ‡ swoich ulubionych, jest bardzo prawdopodobne, ลผe sฤ… juลผ obsล‚ugiwane. + +## Podsumowanie + +* Zaimportuj `FastAPI`. +* Stwรณrz instancjฤ™ `app`. +* Dodaj **dekorator operacji na ล›cieลผce** (taki jak `@app.get("/")`). +* Napisz **funkcjฤ™ obsล‚ugujฤ…cฤ… ล›cieลผkฤ™** (takฤ… jak `def root(): ...` powyลผej). +* Uruchom serwer deweloperski (`uvicorn main:app --reload`). diff --git a/docs/pl/mkdocs.yml b/docs/pl/mkdocs.yml index 0c3d100e7..86383d985 100644 --- a/docs/pl/mkdocs.yml +++ b/docs/pl/mkdocs.yml @@ -58,6 +58,7 @@ nav: - zh: /zh/ - Samouczek: - tutorial/index.md + - tutorial/first-steps.md markdown_extensions: - toc: permalink: true From fb26c1ee70c271edb0796c20ccf4c187d1d536e9 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 14 Jul 2022 11:30:45 +0000 Subject: [PATCH 144/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 3fe585e72..b43845e06 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐ŸŒ๐Ÿ‡ต๐Ÿ‡ฑ Add Polish translation for `docs/pl/docs/tutorial/first-steps.md`. PR [#5024](https://github.com/tiangolo/fastapi/pull/5024) by [@Valaraucoo](https://github.com/Valaraucoo). * โฌ† Bump actions/checkout from 2 to 3. PR [#5133](https://github.com/tiangolo/fastapi/pull/5133) by [@dependabot[bot]](https://github.com/apps/dependabot). * โฌ† [pre-commit.ci] pre-commit autoupdate. PR [#5030](https://github.com/tiangolo/fastapi/pull/5030) by [@pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci). * โฌ† Bump nwtgck/actions-netlify from 1.1.5 to 1.2.3. PR [#5132](https://github.com/tiangolo/fastapi/pull/5132) by [@dependabot[bot]](https://github.com/apps/dependabot). From 80cb57e4b22ca81708129da3ee79beea5b574f23 Mon Sep 17 00:00:00 2001 From: wakabame <35513518+wakabame@users.noreply.github.com> Date: Thu, 14 Jul 2022 20:34:38 +0900 Subject: [PATCH 145/168] =?UTF-8?q?=F0=9F=8C=90=20Add=20Japanese=20transla?= =?UTF-8?q?tion=20for=20`docs/ja/docs/advanced/index.md`=20(#5043)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Amazyra Co-authored-by: tokusumi <41147016+tokusumi@users.noreply.github.com> Co-authored-by: Sebastiรกn Ramรญrez --- docs/ja/docs/advanced/index.md | 24 ++++++++++++++++++++++++ docs/ja/mkdocs.yml | 1 + 2 files changed, 25 insertions(+) create mode 100644 docs/ja/docs/advanced/index.md diff --git a/docs/ja/docs/advanced/index.md b/docs/ja/docs/advanced/index.md new file mode 100644 index 000000000..676f60359 --- /dev/null +++ b/docs/ja/docs/advanced/index.md @@ -0,0 +1,24 @@ +# ใƒฆใƒผใ‚ถใƒผใ‚ฌใ‚คใƒ‰ ๅฟœ็”จ็ทจ + +## ใ•ใ‚‰ใชใ‚‹ๆฉŸ่ƒฝ + +[ใƒใƒฅใƒผใƒˆใƒชใ‚ขใƒซ - ใƒฆใƒผใ‚ถใƒผใ‚ฌใ‚คใƒ‰](../tutorial/){.internal-link target=_blank}ใซใ‚ˆใ‚Šใ€**FastAPI**ใฎไธป่ฆใชๆฉŸ่ƒฝใฏๅๅˆ†ใซ็†่งฃใงใใŸใ“ใจใงใ—ใ‚‡ใ†ใ€‚ + +ไปฅ้™ใฎใ‚ปใ‚ฏใ‚ทใƒงใƒณใงใฏใ€ใƒใƒฅใƒผใƒˆใƒชใ‚ขใƒซใงใฏ่ชฌๆ˜Žใ—ใใ‚Œใชใ‹ใฃใŸใ‚ชใƒ—ใ‚ทใƒงใƒณใ‚„่จญๅฎšใ€ใŠใ‚ˆใณๆฉŸ่ƒฝใซใคใ„ใฆ่ชฌๆ˜Žใ—ใพใ™ใ€‚ + +!!! tip "่ฑ†็Ÿฅ่ญ˜" + ไปฅ้™ใฎใ‚ปใ‚ฏใ‚ทใƒงใƒณใฏใ€ **ๅฟ…ใšใ—ใ‚‚"ๅฟœ็”จ็ทจ"ใงใฏใ‚ใ‚Šใพใ›ใ‚“**ใ€‚ + + ใƒฆใƒผใ‚นใ‚ฑใƒผใ‚นใซใ‚ˆใฃใฆใฏใ€ใใฎไธญใ‹ใ‚‰่งฃๆฑบ็ญ–ใ‚’่ฆ‹ใคใ‘ใ‚‰ใ‚Œใ‚‹ใ‹ใ‚‚ใ—ใ‚Œใพใ›ใ‚“ใ€‚ + +## ๅ…ˆใซใƒใƒฅใƒผใƒˆใƒชใ‚ขใƒซใ‚’่ชญใ‚€ + +[ใƒใƒฅใƒผใƒˆใƒชใ‚ขใƒซ - ใƒฆใƒผใ‚ถใƒผใ‚ฌใ‚คใƒ‰](../tutorial/){.internal-link target=_blank}ใฎ็Ÿฅ่ญ˜ใŒใ‚ใ‚Œใฐใ€**FastAPI**ใฎไธป่ฆใชๆฉŸ่ƒฝใ‚’ๅˆฉ็”จใ™ใ‚‹ใ“ใจใŒใงใใพใ™ใ€‚ + +ไปฅ้™ใฎใ‚ปใ‚ฏใ‚ทใƒงใƒณใฏใ€ใ™ใงใซใƒใƒฅใƒผใƒˆใƒชใ‚ขใƒซใ‚’่ชญใ‚“ใงใ€ใใฎไธป่ฆใชใ‚ขใ‚คใƒ‡ใ‚ขใ‚’็†่งฃใงใใฆใ„ใ‚‹ใ“ใจใ‚’ๅ‰ๆใจใ—ใฆใ„ใพใ™ใ€‚ + +## ใƒ†ใ‚นใƒˆ้ง†ๅ‹•้–‹็™บใฎใ‚ณใƒผใ‚น + +ใ“ใฎใ‚ปใ‚ฏใ‚ทใƒงใƒณใฎๅ†…ๅฎนใ‚’่ฃœๅฎŒใ™ใ‚‹ใŸใ‚ใซ่„ฑๅˆๅฟƒ่€…็”จใ‚ณใƒผใ‚นใ‚’ๅ—ใ‘ใŸใ„ๅ ดๅˆใฏใ€**TestDriven.io**ใซใ‚ˆใ‚‹ใ€Test-Driven Development with FastAPI and Dockerใ‚’็ขบ่ชใ™ใ‚‹ใฎใŒใ‚ˆใ„ใ‹ใ‚‚ใ—ใ‚Œใพใ›ใ‚“ใ€‚ + +็พๅœจใ€ใ“ใฎใ‚ณใƒผใ‚นใงๅพ—ใ‚‰ใ‚ŒใŸๅˆฉ็›Šใฎ10%ใŒ**FastAPI**ใฎ้–‹็™บใฎใŸใ‚ใซๅฏ„ไป˜ใ•ใ‚Œใฆใ„ใพใ™ใ€‚๐ŸŽ‰ ๐Ÿ˜„ diff --git a/docs/ja/mkdocs.yml b/docs/ja/mkdocs.yml index 055404fea..1548b1905 100644 --- a/docs/ja/mkdocs.yml +++ b/docs/ja/mkdocs.yml @@ -78,6 +78,7 @@ nav: - tutorial/testing.md - tutorial/debugging.md - ้ซ˜ๅบฆใชใƒฆใƒผใ‚ถใƒผใ‚ฌใ‚คใƒ‰: + - advanced/index.md - advanced/path-operation-advanced-configuration.md - advanced/additional-status-codes.md - advanced/response-directly.md From c5954d3bc0852a0b0450a54dea014733c63413f5 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 14 Jul 2022 11:35:16 +0000 Subject: [PATCH 146/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index b43845e06..eb078f165 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐ŸŒ Add Japanese translation for `docs/ja/docs/advanced/index.md`. PR [#5043](https://github.com/tiangolo/fastapi/pull/5043) by [@wakabame](https://github.com/wakabame). * ๐ŸŒ๐Ÿ‡ต๐Ÿ‡ฑ Add Polish translation for `docs/pl/docs/tutorial/first-steps.md`. PR [#5024](https://github.com/tiangolo/fastapi/pull/5024) by [@Valaraucoo](https://github.com/Valaraucoo). * โฌ† Bump actions/checkout from 2 to 3. PR [#5133](https://github.com/tiangolo/fastapi/pull/5133) by [@dependabot[bot]](https://github.com/apps/dependabot). * โฌ† [pre-commit.ci] pre-commit autoupdate. PR [#5030](https://github.com/tiangolo/fastapi/pull/5030) by [@pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci). From b4a98a7224b642e9a728366137cc5675269a731d Mon Sep 17 00:00:00 2001 From: Robin <51365552+MrRawbin@users.noreply.github.com> Date: Thu, 14 Jul 2022 13:45:01 +0200 Subject: [PATCH 147/168] =?UTF-8?q?=F0=9F=8C=90=20Start=20of=20Swedish=20t?= =?UTF-8?q?ranslation=20(#5062)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastiรกn Ramรญrez --- docs/az/mkdocs.yml | 7 +- docs/de/mkdocs.yml | 7 +- docs/en/mkdocs.yml | 7 +- docs/es/mkdocs.yml | 7 +- docs/fa/mkdocs.yml | 7 +- docs/fr/mkdocs.yml | 7 +- docs/id/mkdocs.yml | 7 +- docs/it/mkdocs.yml | 7 +- docs/ja/mkdocs.yml | 7 +- docs/ko/mkdocs.yml | 7 +- docs/nl/mkdocs.yml | 7 +- docs/pl/mkdocs.yml | 7 +- docs/pt/mkdocs.yml | 7 +- docs/ru/mkdocs.yml | 7 +- docs/sq/mkdocs.yml | 7 +- docs/sv/docs/index.md | 468 +++++++++++++++++++++++++++++++++++ docs/sv/mkdocs.yml | 140 +++++++++++ docs/sv/overrides/.gitignore | 0 docs/tr/mkdocs.yml | 7 +- docs/uk/mkdocs.yml | 7 +- docs/zh/mkdocs.yml | 7 +- 21 files changed, 698 insertions(+), 36 deletions(-) create mode 100644 docs/sv/docs/index.md create mode 100644 docs/sv/mkdocs.yml create mode 100644 docs/sv/overrides/.gitignore diff --git a/docs/az/mkdocs.yml b/docs/az/mkdocs.yml index 60bd8eaad..7ebf94384 100644 --- a/docs/az/mkdocs.yml +++ b/docs/az/mkdocs.yml @@ -5,14 +5,14 @@ theme: name: material custom_dir: overrides palette: - - media: "(prefers-color-scheme: light)" + - media: '(prefers-color-scheme: light)' scheme: default primary: teal accent: amber toggle: icon: material/lightbulb name: Switch to light mode - - media: "(prefers-color-scheme: dark)" + - media: '(prefers-color-scheme: dark)' scheme: slate primary: teal accent: amber @@ -53,6 +53,7 @@ nav: - pt: /pt/ - ru: /ru/ - sq: /sq/ + - sv: /sv/ - tr: /tr/ - uk: /uk/ - zh: /zh/ @@ -123,6 +124,8 @@ extra: name: ru - ั€ัƒััะบะธะน ัะทั‹ะบ - link: /sq/ name: sq - shqip + - link: /sv/ + name: sv - svenska - link: /tr/ name: tr - Tรผrkรงe - link: /uk/ diff --git a/docs/de/mkdocs.yml b/docs/de/mkdocs.yml index c72f325f6..c617e55af 100644 --- a/docs/de/mkdocs.yml +++ b/docs/de/mkdocs.yml @@ -5,14 +5,14 @@ theme: name: material custom_dir: overrides palette: - - media: "(prefers-color-scheme: light)" + - media: '(prefers-color-scheme: light)' scheme: default primary: teal accent: amber toggle: icon: material/lightbulb name: Switch to light mode - - media: "(prefers-color-scheme: dark)" + - media: '(prefers-color-scheme: dark)' scheme: slate primary: teal accent: amber @@ -53,6 +53,7 @@ nav: - pt: /pt/ - ru: /ru/ - sq: /sq/ + - sv: /sv/ - tr: /tr/ - uk: /uk/ - zh: /zh/ @@ -124,6 +125,8 @@ extra: name: ru - ั€ัƒััะบะธะน ัะทั‹ะบ - link: /sq/ name: sq - shqip + - link: /sv/ + name: sv - svenska - link: /tr/ name: tr - Tรผrkรงe - link: /uk/ diff --git a/docs/en/mkdocs.yml b/docs/en/mkdocs.yml index 322de0f2f..04639200d 100644 --- a/docs/en/mkdocs.yml +++ b/docs/en/mkdocs.yml @@ -5,14 +5,14 @@ theme: name: material custom_dir: overrides palette: - - media: "(prefers-color-scheme: light)" + - media: '(prefers-color-scheme: light)' scheme: default primary: teal accent: amber toggle: icon: material/lightbulb name: Switch to light mode - - media: "(prefers-color-scheme: dark)" + - media: '(prefers-color-scheme: dark)' scheme: slate primary: teal accent: amber @@ -53,6 +53,7 @@ nav: - pt: /pt/ - ru: /ru/ - sq: /sq/ + - sv: /sv/ - tr: /tr/ - uk: /uk/ - zh: /zh/ @@ -230,6 +231,8 @@ extra: name: ru - ั€ัƒััะบะธะน ัะทั‹ะบ - link: /sq/ name: sq - shqip + - link: /sv/ + name: sv - svenska - link: /tr/ name: tr - Tรผrkรงe - link: /uk/ diff --git a/docs/es/mkdocs.yml b/docs/es/mkdocs.yml index b544f9b38..cd1c04ed3 100644 --- a/docs/es/mkdocs.yml +++ b/docs/es/mkdocs.yml @@ -5,14 +5,14 @@ theme: name: material custom_dir: overrides palette: - - media: "(prefers-color-scheme: light)" + - media: '(prefers-color-scheme: light)' scheme: default primary: teal accent: amber toggle: icon: material/lightbulb name: Switch to light mode - - media: "(prefers-color-scheme: dark)" + - media: '(prefers-color-scheme: dark)' scheme: slate primary: teal accent: amber @@ -53,6 +53,7 @@ nav: - pt: /pt/ - ru: /ru/ - sq: /sq/ + - sv: /sv/ - tr: /tr/ - uk: /uk/ - zh: /zh/ @@ -133,6 +134,8 @@ extra: name: ru - ั€ัƒััะบะธะน ัะทั‹ะบ - link: /sq/ name: sq - shqip + - link: /sv/ + name: sv - svenska - link: /tr/ name: tr - Tรผrkรงe - link: /uk/ diff --git a/docs/fa/mkdocs.yml b/docs/fa/mkdocs.yml index 3966a6026..79975288a 100644 --- a/docs/fa/mkdocs.yml +++ b/docs/fa/mkdocs.yml @@ -5,14 +5,14 @@ theme: name: material custom_dir: overrides palette: - - media: "(prefers-color-scheme: light)" + - media: '(prefers-color-scheme: light)' scheme: default primary: teal accent: amber toggle: icon: material/lightbulb name: Switch to light mode - - media: "(prefers-color-scheme: dark)" + - media: '(prefers-color-scheme: dark)' scheme: slate primary: teal accent: amber @@ -53,6 +53,7 @@ nav: - pt: /pt/ - ru: /ru/ - sq: /sq/ + - sv: /sv/ - tr: /tr/ - uk: /uk/ - zh: /zh/ @@ -123,6 +124,8 @@ extra: name: ru - ั€ัƒััะบะธะน ัะทั‹ะบ - link: /sq/ name: sq - shqip + - link: /sv/ + name: sv - svenska - link: /tr/ name: tr - Tรผrkรงe - link: /uk/ diff --git a/docs/fr/mkdocs.yml b/docs/fr/mkdocs.yml index bf0d2b21c..69a323cec 100644 --- a/docs/fr/mkdocs.yml +++ b/docs/fr/mkdocs.yml @@ -5,14 +5,14 @@ theme: name: material custom_dir: overrides palette: - - media: "(prefers-color-scheme: light)" + - media: '(prefers-color-scheme: light)' scheme: default primary: teal accent: amber toggle: icon: material/lightbulb name: Switch to light mode - - media: "(prefers-color-scheme: dark)" + - media: '(prefers-color-scheme: dark)' scheme: slate primary: teal accent: amber @@ -53,6 +53,7 @@ nav: - pt: /pt/ - ru: /ru/ - sq: /sq/ + - sv: /sv/ - tr: /tr/ - uk: /uk/ - zh: /zh/ @@ -138,6 +139,8 @@ extra: name: ru - ั€ัƒััะบะธะน ัะทั‹ะบ - link: /sq/ name: sq - shqip + - link: /sv/ + name: sv - svenska - link: /tr/ name: tr - Tรผrkรงe - link: /uk/ diff --git a/docs/id/mkdocs.yml b/docs/id/mkdocs.yml index 769547d11..6c9f88c90 100644 --- a/docs/id/mkdocs.yml +++ b/docs/id/mkdocs.yml @@ -5,14 +5,14 @@ theme: name: material custom_dir: overrides palette: - - media: "(prefers-color-scheme: light)" + - media: '(prefers-color-scheme: light)' scheme: default primary: teal accent: amber toggle: icon: material/lightbulb name: Switch to light mode - - media: "(prefers-color-scheme: dark)" + - media: '(prefers-color-scheme: dark)' scheme: slate primary: teal accent: amber @@ -53,6 +53,7 @@ nav: - pt: /pt/ - ru: /ru/ - sq: /sq/ + - sv: /sv/ - tr: /tr/ - uk: /uk/ - zh: /zh/ @@ -123,6 +124,8 @@ extra: name: ru - ั€ัƒััะบะธะน ัะทั‹ะบ - link: /sq/ name: sq - shqip + - link: /sv/ + name: sv - svenska - link: /tr/ name: tr - Tรผrkรงe - link: /uk/ diff --git a/docs/it/mkdocs.yml b/docs/it/mkdocs.yml index ebec9a642..5f0b7c73b 100644 --- a/docs/it/mkdocs.yml +++ b/docs/it/mkdocs.yml @@ -5,14 +5,14 @@ theme: name: material custom_dir: overrides palette: - - media: "(prefers-color-scheme: light)" + - media: '(prefers-color-scheme: light)' scheme: default primary: teal accent: amber toggle: icon: material/lightbulb name: Switch to light mode - - media: "(prefers-color-scheme: dark)" + - media: '(prefers-color-scheme: dark)' scheme: slate primary: teal accent: amber @@ -53,6 +53,7 @@ nav: - pt: /pt/ - ru: /ru/ - sq: /sq/ + - sv: /sv/ - tr: /tr/ - uk: /uk/ - zh: /zh/ @@ -123,6 +124,8 @@ extra: name: ru - ั€ัƒััะบะธะน ัะทั‹ะบ - link: /sq/ name: sq - shqip + - link: /sv/ + name: sv - svenska - link: /tr/ name: tr - Tรผrkรงe - link: /uk/ diff --git a/docs/ja/mkdocs.yml b/docs/ja/mkdocs.yml index 1548b1905..66694ef36 100644 --- a/docs/ja/mkdocs.yml +++ b/docs/ja/mkdocs.yml @@ -5,14 +5,14 @@ theme: name: material custom_dir: overrides palette: - - media: "(prefers-color-scheme: light)" + - media: '(prefers-color-scheme: light)' scheme: default primary: teal accent: amber toggle: icon: material/lightbulb name: Switch to light mode - - media: "(prefers-color-scheme: dark)" + - media: '(prefers-color-scheme: dark)' scheme: slate primary: teal accent: amber @@ -53,6 +53,7 @@ nav: - pt: /pt/ - ru: /ru/ - sq: /sq/ + - sv: /sv/ - tr: /tr/ - uk: /uk/ - zh: /zh/ @@ -165,6 +166,8 @@ extra: name: ru - ั€ัƒััะบะธะน ัะทั‹ะบ - link: /sq/ name: sq - shqip + - link: /sv/ + name: sv - svenska - link: /tr/ name: tr - Tรผrkรงe - link: /uk/ diff --git a/docs/ko/mkdocs.yml b/docs/ko/mkdocs.yml index 60cf7d30a..ddadebe7b 100644 --- a/docs/ko/mkdocs.yml +++ b/docs/ko/mkdocs.yml @@ -5,14 +5,14 @@ theme: name: material custom_dir: overrides palette: - - media: "(prefers-color-scheme: light)" + - media: '(prefers-color-scheme: light)' scheme: default primary: teal accent: amber toggle: icon: material/lightbulb name: Switch to light mode - - media: "(prefers-color-scheme: dark)" + - media: '(prefers-color-scheme: dark)' scheme: slate primary: teal accent: amber @@ -53,6 +53,7 @@ nav: - pt: /pt/ - ru: /ru/ - sq: /sq/ + - sv: /sv/ - tr: /tr/ - uk: /uk/ - zh: /zh/ @@ -133,6 +134,8 @@ extra: name: ru - ั€ัƒััะบะธะน ัะทั‹ะบ - link: /sq/ name: sq - shqip + - link: /sv/ + name: sv - svenska - link: /tr/ name: tr - Tรผrkรงe - link: /uk/ diff --git a/docs/nl/mkdocs.yml b/docs/nl/mkdocs.yml index 9cd1e0401..620a4b25f 100644 --- a/docs/nl/mkdocs.yml +++ b/docs/nl/mkdocs.yml @@ -5,14 +5,14 @@ theme: name: material custom_dir: overrides palette: - - media: "(prefers-color-scheme: light)" + - media: '(prefers-color-scheme: light)' scheme: default primary: teal accent: amber toggle: icon: material/lightbulb name: Switch to light mode - - media: "(prefers-color-scheme: dark)" + - media: '(prefers-color-scheme: dark)' scheme: slate primary: teal accent: amber @@ -53,6 +53,7 @@ nav: - pt: /pt/ - ru: /ru/ - sq: /sq/ + - sv: /sv/ - tr: /tr/ - uk: /uk/ - zh: /zh/ @@ -123,6 +124,8 @@ extra: name: ru - ั€ัƒััะบะธะน ัะทั‹ะบ - link: /sq/ name: sq - shqip + - link: /sv/ + name: sv - svenska - link: /tr/ name: tr - Tรผrkรงe - link: /uk/ diff --git a/docs/pl/mkdocs.yml b/docs/pl/mkdocs.yml index 86383d985..c04f3c1c6 100644 --- a/docs/pl/mkdocs.yml +++ b/docs/pl/mkdocs.yml @@ -5,14 +5,14 @@ theme: name: material custom_dir: overrides palette: - - media: "(prefers-color-scheme: light)" + - media: '(prefers-color-scheme: light)' scheme: default primary: teal accent: amber toggle: icon: material/lightbulb name: Switch to light mode - - media: "(prefers-color-scheme: dark)" + - media: '(prefers-color-scheme: dark)' scheme: slate primary: teal accent: amber @@ -53,6 +53,7 @@ nav: - pt: /pt/ - ru: /ru/ - sq: /sq/ + - sv: /sv/ - tr: /tr/ - uk: /uk/ - zh: /zh/ @@ -126,6 +127,8 @@ extra: name: ru - ั€ัƒััะบะธะน ัะทั‹ะบ - link: /sq/ name: sq - shqip + - link: /sv/ + name: sv - svenska - link: /tr/ name: tr - Tรผrkรงe - link: /uk/ diff --git a/docs/pt/mkdocs.yml b/docs/pt/mkdocs.yml index 2bb0b568d..51d448c95 100644 --- a/docs/pt/mkdocs.yml +++ b/docs/pt/mkdocs.yml @@ -5,14 +5,14 @@ theme: name: material custom_dir: overrides palette: - - media: "(prefers-color-scheme: light)" + - media: '(prefers-color-scheme: light)' scheme: default primary: teal accent: amber toggle: icon: material/lightbulb name: Switch to light mode - - media: "(prefers-color-scheme: dark)" + - media: '(prefers-color-scheme: dark)' scheme: slate primary: teal accent: amber @@ -53,6 +53,7 @@ nav: - pt: /pt/ - ru: /ru/ - sq: /sq/ + - sv: /sv/ - tr: /tr/ - uk: /uk/ - zh: /zh/ @@ -148,6 +149,8 @@ extra: name: ru - ั€ัƒััะบะธะน ัะทั‹ะบ - link: /sq/ name: sq - shqip + - link: /sv/ + name: sv - svenska - link: /tr/ name: tr - Tรผrkรงe - link: /uk/ diff --git a/docs/ru/mkdocs.yml b/docs/ru/mkdocs.yml index bb0702489..816a0d3a0 100644 --- a/docs/ru/mkdocs.yml +++ b/docs/ru/mkdocs.yml @@ -5,14 +5,14 @@ theme: name: material custom_dir: overrides palette: - - media: "(prefers-color-scheme: light)" + - media: '(prefers-color-scheme: light)' scheme: default primary: teal accent: amber toggle: icon: material/lightbulb name: Switch to light mode - - media: "(prefers-color-scheme: dark)" + - media: '(prefers-color-scheme: dark)' scheme: slate primary: teal accent: amber @@ -53,6 +53,7 @@ nav: - pt: /pt/ - ru: /ru/ - sq: /sq/ + - sv: /sv/ - tr: /tr/ - uk: /uk/ - zh: /zh/ @@ -124,6 +125,8 @@ extra: name: ru - ั€ัƒััะบะธะน ัะทั‹ะบ - link: /sq/ name: sq - shqip + - link: /sv/ + name: sv - svenska - link: /tr/ name: tr - Tรผrkรงe - link: /uk/ diff --git a/docs/sq/mkdocs.yml b/docs/sq/mkdocs.yml index 8914395fe..4df6d5b1f 100644 --- a/docs/sq/mkdocs.yml +++ b/docs/sq/mkdocs.yml @@ -5,14 +5,14 @@ theme: name: material custom_dir: overrides palette: - - media: "(prefers-color-scheme: light)" + - media: '(prefers-color-scheme: light)' scheme: default primary: teal accent: amber toggle: icon: material/lightbulb name: Switch to light mode - - media: "(prefers-color-scheme: dark)" + - media: '(prefers-color-scheme: dark)' scheme: slate primary: teal accent: amber @@ -53,6 +53,7 @@ nav: - pt: /pt/ - ru: /ru/ - sq: /sq/ + - sv: /sv/ - tr: /tr/ - uk: /uk/ - zh: /zh/ @@ -123,6 +124,8 @@ extra: name: ru - ั€ัƒััะบะธะน ัะทั‹ะบ - link: /sq/ name: sq - shqip + - link: /sv/ + name: sv - svenska - link: /tr/ name: tr - Tรผrkรงe - link: /uk/ diff --git a/docs/sv/docs/index.md b/docs/sv/docs/index.md new file mode 100644 index 000000000..fd52f994c --- /dev/null +++ b/docs/sv/docs/index.md @@ -0,0 +1,468 @@ + +{!../../../docs/missing-translation.md!} + + +

+ FastAPI +

+

+ FastAPI framework, high performance, easy to learn, fast to code, ready for production +

+

+ + Test + + + Coverage + + + Package version + + + Supported Python versions + +

+ +--- + +**Documentation**: https://fastapi.tiangolo.com + +**Source Code**: https://github.com/tiangolo/fastapi + +--- + +FastAPI is a modern, fast (high-performance), web framework for building APIs with Python 3.6+ based on standard Python type hints. + +The key features are: + +* **Fast**: Very high performance, on par with **NodeJS** and **Go** (thanks to Starlette and Pydantic). [One of the fastest Python frameworks available](#performance). + +* **Fast to code**: Increase the speed to develop features by about 200% to 300%. * +* **Fewer bugs**: Reduce about 40% of human (developer) induced errors. * +* **Intuitive**: Great editor support. Completion everywhere. Less time debugging. +* **Easy**: Designed to be easy to use and learn. Less time reading docs. +* **Short**: Minimize code duplication. Multiple features from each parameter declaration. Fewer bugs. +* **Robust**: Get production-ready code. With automatic interactive documentation. +* **Standards-based**: Based on (and fully compatible with) the open standards for APIs: OpenAPI (previously known as Swagger) and JSON Schema. + +* estimation based on tests on an internal development team, building production applications. + +## Sponsors + + + +{% if sponsors %} +{% for sponsor in sponsors.gold -%} + +{% endfor -%} +{%- for sponsor in sponsors.silver -%} + +{% endfor %} +{% endif %} + + + +Other sponsors + +## Opinions + +"_[...] I'm using **FastAPI** a ton these days. [...] I'm actually planning to use it for all of my team's **ML services at Microsoft**. Some of them are getting integrated into the core **Windows** product and some **Office** products._" + +
Kabir Khan - Microsoft (ref)
+ +--- + +"_We adopted the **FastAPI** library to spawn a **REST** server that can be queried to obtain **predictions**. [for Ludwig]_" + +
Piero Molino, Yaroslav Dudin, and Sai Sumanth Miryala - Uber (ref)
+ +--- + +"_**Netflix** is pleased to announce the open-source release of our **crisis management** orchestration framework: **Dispatch**! [built with **FastAPI**]_" + +
Kevin Glisson, Marc Vilanova, Forest Monsen - Netflix (ref)
+ +--- + +"_Iโ€™m over the moon excited about **FastAPI**. Itโ€™s so fun!_" + +
Brian Okken - Python Bytes podcast host (ref)
+ +--- + +"_Honestly, what you've built looks super solid and polished. In many ways, it's what I wanted **Hug** to be - it's really inspiring to see someone build that._" + +
Timothy Crosley - Hug creator (ref)
+ +--- + +"_If you're looking to learn one **modern framework** for building REST APIs, check out **FastAPI** [...] It's fast, easy to use and easy to learn [...]_" + +"_We've switched over to **FastAPI** for our **APIs** [...] I think you'll like it [...]_" + +
Ines Montani - Matthew Honnibal - Explosion AI founders - spaCy creators (ref) - (ref)
+ +--- + +## **Typer**, the FastAPI of CLIs + + + +If you are building a CLI app to be used in the terminal instead of a web API, check out **Typer**. + +**Typer** is FastAPI's little sibling. And it's intended to be the **FastAPI of CLIs**. โŒจ๏ธ ๐Ÿš€ + +## Requirements + +Python 3.6+ + +FastAPI stands on the shoulders of giants: + +* Starlette for the web parts. +* Pydantic for the data parts. + +## Installation + +
+ +```console +$ pip install fastapi + +---> 100% +``` + +
+ +You will also need an ASGI server, for production such as Uvicorn or Hypercorn. + +
+ +```console +$ pip install "uvicorn[standard]" + +---> 100% +``` + +
+ +## Example + +### Create it + +* Create a file `main.py` with: + +```Python +from typing import Union + +from fastapi import FastAPI + +app = FastAPI() + + +@app.get("/") +def read_root(): + return {"Hello": "World"} + + +@app.get("/items/{item_id}") +def read_item(item_id: int, q: Union[str, None] = None): + return {"item_id": item_id, "q": q} +``` + +
+Or use async def... + +If your code uses `async` / `await`, use `async def`: + +```Python hl_lines="9 14" +from typing import Union + +from fastapi import FastAPI + +app = FastAPI() + + +@app.get("/") +async def read_root(): + return {"Hello": "World"} + + +@app.get("/items/{item_id}") +async def read_item(item_id: int, q: Union[str, None] = None): + return {"item_id": item_id, "q": q} +``` + +**Note**: + +If you don't know, check the _"In a hurry?"_ section about `async` and `await` in the docs. + +
+ +### Run it + +Run the server with: + +
+ +```console +$ uvicorn main:app --reload + +INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit) +INFO: Started reloader process [28720] +INFO: Started server process [28722] +INFO: Waiting for application startup. +INFO: Application startup complete. +``` + +
+ +
+About the command uvicorn main:app --reload... + +The command `uvicorn main:app` refers to: + +* `main`: the file `main.py` (the Python "module"). +* `app`: the object created inside of `main.py` with the line `app = FastAPI()`. +* `--reload`: make the server restart after code changes. Only do this for development. + +
+ +### Check it + +Open your browser at http://127.0.0.1:8000/items/5?q=somequery. + +You will see the JSON response as: + +```JSON +{"item_id": 5, "q": "somequery"} +``` + +You already created an API that: + +* Receives HTTP requests in the _paths_ `/` and `/items/{item_id}`. +* Both _paths_ take `GET` operations (also known as HTTP _methods_). +* The _path_ `/items/{item_id}` has a _path parameter_ `item_id` that should be an `int`. +* The _path_ `/items/{item_id}` has an optional `str` _query parameter_ `q`. + +### Interactive API docs + +Now go to http://127.0.0.1:8000/docs. + +You will see the automatic interactive API documentation (provided by Swagger UI): + +![Swagger UI](https://fastapi.tiangolo.com/img/index/index-01-swagger-ui-simple.png) + +### Alternative API docs + +And now, go to http://127.0.0.1:8000/redoc. + +You will see the alternative automatic documentation (provided by ReDoc): + +![ReDoc](https://fastapi.tiangolo.com/img/index/index-02-redoc-simple.png) + +## Example upgrade + +Now modify the file `main.py` to receive a body from a `PUT` request. + +Declare the body using standard Python types, thanks to Pydantic. + +```Python hl_lines="4 9-12 25-27" +from typing import Union + +from fastapi import FastAPI +from pydantic import BaseModel + +app = FastAPI() + + +class Item(BaseModel): + name: str + price: float + is_offer: Union[bool, None] = None + + +@app.get("/") +def read_root(): + return {"Hello": "World"} + + +@app.get("/items/{item_id}") +def read_item(item_id: int, q: Union[str, None] = None): + return {"item_id": item_id, "q": q} + + +@app.put("/items/{item_id}") +def update_item(item_id: int, item: Item): + return {"item_name": item.name, "item_id": item_id} +``` + +The server should reload automatically (because you added `--reload` to the `uvicorn` command above). + +### Interactive API docs upgrade + +Now go to http://127.0.0.1:8000/docs. + +* The interactive API documentation will be automatically updated, including the new body: + +![Swagger UI](https://fastapi.tiangolo.com/img/index/index-03-swagger-02.png) + +* Click on the button "Try it out", it allows you to fill the parameters and directly interact with the API: + +![Swagger UI interaction](https://fastapi.tiangolo.com/img/index/index-04-swagger-03.png) + +* Then click on the "Execute" button, the user interface will communicate with your API, send the parameters, get the results and show them on the screen: + +![Swagger UI interaction](https://fastapi.tiangolo.com/img/index/index-05-swagger-04.png) + +### Alternative API docs upgrade + +And now, go to http://127.0.0.1:8000/redoc. + +* The alternative documentation will also reflect the new query parameter and body: + +![ReDoc](https://fastapi.tiangolo.com/img/index/index-06-redoc-02.png) + +### Recap + +In summary, you declare **once** the types of parameters, body, etc. as function parameters. + +You do that with standard modern Python types. + +You don't have to learn a new syntax, the methods or classes of a specific library, etc. + +Just standard **Python 3.6+**. + +For example, for an `int`: + +```Python +item_id: int +``` + +or for a more complex `Item` model: + +```Python +item: Item +``` + +...and with that single declaration you get: + +* Editor support, including: + * Completion. + * Type checks. +* Validation of data: + * Automatic and clear errors when the data is invalid. + * Validation even for deeply nested JSON objects. +* Conversion of input data: coming from the network to Python data and types. Reading from: + * JSON. + * Path parameters. + * Query parameters. + * Cookies. + * Headers. + * Forms. + * Files. +* Conversion of output data: converting from Python data and types to network data (as JSON): + * Convert Python types (`str`, `int`, `float`, `bool`, `list`, etc). + * `datetime` objects. + * `UUID` objects. + * Database models. + * ...and many more. +* Automatic interactive API documentation, including 2 alternative user interfaces: + * Swagger UI. + * ReDoc. + +--- + +Coming back to the previous code example, **FastAPI** will: + +* Validate that there is an `item_id` in the path for `GET` and `PUT` requests. +* Validate that the `item_id` is of type `int` for `GET` and `PUT` requests. + * If it is not, the client will see a useful, clear error. +* Check if there is an optional query parameter named `q` (as in `http://127.0.0.1:8000/items/foo?q=somequery`) for `GET` requests. + * As the `q` parameter is declared with `= None`, it is optional. + * Without the `None` it would be required (as is the body in the case with `PUT`). +* For `PUT` requests to `/items/{item_id}`, Read the body as JSON: + * Check that it has a required attribute `name` that should be a `str`. + * Check that it has a required attribute `price` that has to be a `float`. + * Check that it has an optional attribute `is_offer`, that should be a `bool`, if present. + * All this would also work for deeply nested JSON objects. +* Convert from and to JSON automatically. +* Document everything with OpenAPI, that can be used by: + * Interactive documentation systems. + * Automatic client code generation systems, for many languages. +* Provide 2 interactive documentation web interfaces directly. + +--- + +We just scratched the surface, but you already get the idea of how it all works. + +Try changing the line with: + +```Python + return {"item_name": item.name, "item_id": item_id} +``` + +...from: + +```Python + ... "item_name": item.name ... +``` + +...to: + +```Python + ... "item_price": item.price ... +``` + +...and see how your editor will auto-complete the attributes and know their types: + +![editor support](https://fastapi.tiangolo.com/img/vscode-completion.png) + +For a more complete example including more features, see the Tutorial - User Guide. + +**Spoiler alert**: the tutorial - user guide includes: + +* Declaration of **parameters** from other different places as: **headers**, **cookies**, **form fields** and **files**. +* How to set **validation constraints** as `maximum_length` or `regex`. +* A very powerful and easy to use **Dependency Injection** system. +* Security and authentication, including support for **OAuth2** with **JWT tokens** and **HTTP Basic** auth. +* More advanced (but equally easy) techniques for declaring **deeply nested JSON models** (thanks to Pydantic). +* **GraphQL** integration with Strawberry and other libraries. +* Many extra features (thanks to Starlette) as: + * **WebSockets** + * extremely easy tests based on `requests` and `pytest` + * **CORS** + * **Cookie Sessions** + * ...and more. + +## Performance + +Independent TechEmpower benchmarks show **FastAPI** applications running under Uvicorn as one of the fastest Python frameworks available, only below Starlette and Uvicorn themselves (used internally by FastAPI). (*) + +To understand more about it, see the section Benchmarks. + +## Optional Dependencies + +Used by Pydantic: + +* ujson - for faster JSON "parsing". +* email_validator - for email validation. + +Used by Starlette: + +* requests - Required if you want to use the `TestClient`. +* jinja2 - Required if you want to use the default template configuration. +* python-multipart - Required if you want to support form "parsing", with `request.form()`. +* itsdangerous - Required for `SessionMiddleware` support. +* pyyaml - Required for Starlette's `SchemaGenerator` support (you probably don't need it with FastAPI). +* ujson - Required if you want to use `UJSONResponse`. + +Used by FastAPI / Starlette: + +* uvicorn - for the server that loads and serves your application. +* orjson - Required if you want to use `ORJSONResponse`. + +You can install all of these with `pip install "fastapi[all]"`. + +## License + +This project is licensed under the terms of the MIT license. diff --git a/docs/sv/mkdocs.yml b/docs/sv/mkdocs.yml new file mode 100644 index 000000000..fa0296d5c --- /dev/null +++ b/docs/sv/mkdocs.yml @@ -0,0 +1,140 @@ +site_name: FastAPI +site_description: FastAPI framework, high performance, easy to learn, fast to code, ready for production +site_url: https://fastapi.tiangolo.com/sv/ +theme: + name: material + custom_dir: overrides + palette: + - media: '(prefers-color-scheme: light)' + scheme: default + primary: teal + accent: amber + toggle: + icon: material/lightbulb + name: Switch to light mode + - media: '(prefers-color-scheme: dark)' + scheme: slate + primary: teal + accent: amber + toggle: + icon: material/lightbulb-outline + name: Switch to dark mode + features: + - search.suggest + - search.highlight + - content.tabs.link + icon: + repo: fontawesome/brands/github-alt + logo: https://fastapi.tiangolo.com/img/icon-white.svg + favicon: https://fastapi.tiangolo.com/img/favicon.png + language: sv +repo_name: tiangolo/fastapi +repo_url: https://github.com/tiangolo/fastapi +edit_uri: '' +plugins: +- search +- markdownextradata: + data: data +nav: +- FastAPI: index.md +- Languages: + - en: / + - az: /az/ + - de: /de/ + - es: /es/ + - fa: /fa/ + - fr: /fr/ + - id: /id/ + - it: /it/ + - ja: /ja/ + - ko: /ko/ + - nl: /nl/ + - pl: /pl/ + - pt: /pt/ + - ru: /ru/ + - sq: /sq/ + - sv: /sv/ + - tr: /tr/ + - uk: /uk/ + - zh: /zh/ +markdown_extensions: +- toc: + permalink: true +- markdown.extensions.codehilite: + guess_lang: false +- mdx_include: + base_path: docs +- admonition +- codehilite +- extra +- pymdownx.superfences: + custom_fences: + - name: mermaid + class: mermaid + format: !!python/name:pymdownx.superfences.fence_code_format '' +- pymdownx.tabbed: + alternate_style: true +extra: + analytics: + provider: google + property: UA-133183413-1 + social: + - icon: fontawesome/brands/github-alt + link: https://github.com/tiangolo/fastapi + - icon: fontawesome/brands/discord + link: https://discord.gg/VQjSZaeJmf + - icon: fontawesome/brands/twitter + link: https://twitter.com/fastapi + - icon: fontawesome/brands/linkedin + link: https://www.linkedin.com/in/tiangolo + - icon: fontawesome/brands/dev + link: https://dev.to/tiangolo + - icon: fontawesome/brands/medium + link: https://medium.com/@tiangolo + - icon: fontawesome/solid/globe + link: https://tiangolo.com + alternate: + - link: / + name: en - English + - link: /az/ + name: az + - link: /de/ + name: de + - link: /es/ + name: es - espaรฑol + - link: /fa/ + name: fa + - link: /fr/ + name: fr - franรงais + - link: /id/ + name: id + - link: /it/ + name: it - italiano + - link: /ja/ + name: ja - ๆ—ฅๆœฌ่ชž + - link: /ko/ + name: ko - ํ•œ๊ตญ์–ด + - link: /nl/ + name: nl + - link: /pl/ + name: pl + - link: /pt/ + name: pt - portuguรชs + - link: /ru/ + name: ru - ั€ัƒััะบะธะน ัะทั‹ะบ + - link: /sq/ + name: sq - shqip + - link: /sv/ + name: sv - svenska + - link: /tr/ + name: tr - Tรผrkรงe + - link: /uk/ + name: uk - ัƒะบั€ะฐั—ะฝััŒะบะฐ ะผะพะฒะฐ + - link: /zh/ + name: zh - ๆฑ‰่ฏญ +extra_css: +- https://fastapi.tiangolo.com/css/termynal.css +- https://fastapi.tiangolo.com/css/custom.css +extra_javascript: +- https://fastapi.tiangolo.com/js/termynal.js +- https://fastapi.tiangolo.com/js/custom.js diff --git a/docs/sv/overrides/.gitignore b/docs/sv/overrides/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/docs/tr/mkdocs.yml b/docs/tr/mkdocs.yml index 74186033c..5371cb71f 100644 --- a/docs/tr/mkdocs.yml +++ b/docs/tr/mkdocs.yml @@ -5,14 +5,14 @@ theme: name: material custom_dir: overrides palette: - - media: "(prefers-color-scheme: light)" + - media: '(prefers-color-scheme: light)' scheme: default primary: teal accent: amber toggle: icon: material/lightbulb name: Switch to light mode - - media: "(prefers-color-scheme: dark)" + - media: '(prefers-color-scheme: dark)' scheme: slate primary: teal accent: amber @@ -53,6 +53,7 @@ nav: - pt: /pt/ - ru: /ru/ - sq: /sq/ + - sv: /sv/ - tr: /tr/ - uk: /uk/ - zh: /zh/ @@ -126,6 +127,8 @@ extra: name: ru - ั€ัƒััะบะธะน ัะทั‹ะบ - link: /sq/ name: sq - shqip + - link: /sv/ + name: sv - svenska - link: /tr/ name: tr - Tรผrkรงe - link: /uk/ diff --git a/docs/uk/mkdocs.yml b/docs/uk/mkdocs.yml index ddf299d8b..fd371765a 100644 --- a/docs/uk/mkdocs.yml +++ b/docs/uk/mkdocs.yml @@ -5,14 +5,14 @@ theme: name: material custom_dir: overrides palette: - - media: "(prefers-color-scheme: light)" + - media: '(prefers-color-scheme: light)' scheme: default primary: teal accent: amber toggle: icon: material/lightbulb name: Switch to light mode - - media: "(prefers-color-scheme: dark)" + - media: '(prefers-color-scheme: dark)' scheme: slate primary: teal accent: amber @@ -53,6 +53,7 @@ nav: - pt: /pt/ - ru: /ru/ - sq: /sq/ + - sv: /sv/ - tr: /tr/ - uk: /uk/ - zh: /zh/ @@ -123,6 +124,8 @@ extra: name: ru - ั€ัƒััะบะธะน ัะทั‹ะบ - link: /sq/ name: sq - shqip + - link: /sv/ + name: sv - svenska - link: /tr/ name: tr - Tรผrkรงe - link: /uk/ diff --git a/docs/zh/mkdocs.yml b/docs/zh/mkdocs.yml index a72ecb657..c1c35c6ed 100644 --- a/docs/zh/mkdocs.yml +++ b/docs/zh/mkdocs.yml @@ -5,14 +5,14 @@ theme: name: material custom_dir: overrides palette: - - media: "(prefers-color-scheme: light)" + - media: '(prefers-color-scheme: light)' scheme: default primary: teal accent: amber toggle: icon: material/lightbulb name: Switch to light mode - - media: "(prefers-color-scheme: dark)" + - media: '(prefers-color-scheme: dark)' scheme: slate primary: teal accent: amber @@ -53,6 +53,7 @@ nav: - pt: /pt/ - ru: /ru/ - sq: /sq/ + - sv: /sv/ - tr: /tr/ - uk: /uk/ - zh: /zh/ @@ -174,6 +175,8 @@ extra: name: ru - ั€ัƒััะบะธะน ัะทั‹ะบ - link: /sq/ name: sq - shqip + - link: /sv/ + name: sv - svenska - link: /tr/ name: tr - Tรผrkรงe - link: /uk/ From 2226f962ffffeae09d959ab96f65d6692c1ec87a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Thu, 14 Jul 2022 13:45:26 +0200 Subject: [PATCH 148/168] =?UTF-8?q?=F0=9F=94=A7=20Add=20config=20for=20Swe?= =?UTF-8?q?dish=20translations=20notification=20(#5147)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/actions/notify-translations/app/translations.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/notify-translations/app/translations.yml b/.github/actions/notify-translations/app/translations.yml index 0e5093f3a..a68167ff8 100644 --- a/.github/actions/notify-translations/app/translations.yml +++ b/.github/actions/notify-translations/app/translations.yml @@ -15,3 +15,4 @@ id: 3717 az: 3994 nl: 4701 uz: 4883 +sv: 5146 From 86fb017aadf973200e7a0f79281d73fb5bc4ccc8 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 14 Jul 2022 11:45:51 +0000 Subject: [PATCH 149/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index eb078f165..0c97db5ca 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐ŸŒ Start of Swedish translation. PR [#5062](https://github.com/tiangolo/fastapi/pull/5062) by [@MrRawbin](https://github.com/MrRawbin). * ๐ŸŒ Add Japanese translation for `docs/ja/docs/advanced/index.md`. PR [#5043](https://github.com/tiangolo/fastapi/pull/5043) by [@wakabame](https://github.com/wakabame). * ๐ŸŒ๐Ÿ‡ต๐Ÿ‡ฑ Add Polish translation for `docs/pl/docs/tutorial/first-steps.md`. PR [#5024](https://github.com/tiangolo/fastapi/pull/5024) by [@Valaraucoo](https://github.com/Valaraucoo). * โฌ† Bump actions/checkout from 2 to 3. PR [#5133](https://github.com/tiangolo/fastapi/pull/5133) by [@dependabot[bot]](https://github.com/apps/dependabot). From 801e90863a51108ea4e363d3836b095a48c264df Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 14 Jul 2022 11:46:23 +0000 Subject: [PATCH 150/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 0c97db5ca..714401fde 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐Ÿ”ง Add config for Swedish translations notification. PR [#5147](https://github.com/tiangolo/fastapi/pull/5147) by [@tiangolo](https://github.com/tiangolo). * ๐ŸŒ Start of Swedish translation. PR [#5062](https://github.com/tiangolo/fastapi/pull/5062) by [@MrRawbin](https://github.com/MrRawbin). * ๐ŸŒ Add Japanese translation for `docs/ja/docs/advanced/index.md`. PR [#5043](https://github.com/tiangolo/fastapi/pull/5043) by [@wakabame](https://github.com/wakabame). * ๐ŸŒ๐Ÿ‡ต๐Ÿ‡ฑ Add Polish translation for `docs/pl/docs/tutorial/first-steps.md`. PR [#5024](https://github.com/tiangolo/fastapi/pull/5024) by [@Valaraucoo](https://github.com/Valaraucoo). From 85dc173d192b5514cd81bc1e6f62dc3b867930fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Thu, 14 Jul 2022 14:37:37 +0200 Subject: [PATCH 151/168] =?UTF-8?q?=F0=9F=94=A7=20Update=20Jina=20sponsor?= =?UTF-8?q?=20badges=20(#5151)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ๐Ÿฑ Update Jina badges * ๐Ÿ’„ Tweak sponsors badge CSS * ๐Ÿ”ง Update Jina sponsor * ๐Ÿ“ Re-generate README --- README.md | 2 +- docs/en/data/sponsors.yml | 6 +++--- docs/en/docs/css/custom.css | 2 +- docs/en/docs/img/sponsors/jina-ai-banner.png | Bin 0 -> 14153 bytes docs/en/docs/img/sponsors/jina-ai.png | Bin 0 -> 26112 bytes docs/en/overrides/main.html | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 docs/en/docs/img/sponsors/jina-ai-banner.png create mode 100644 docs/en/docs/img/sponsors/jina-ai.png diff --git a/README.md b/README.md index 505005ae9..bcea9fe73 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ The key features are: - + diff --git a/docs/en/data/sponsors.yml b/docs/en/data/sponsors.yml index c99c4b57a..efd0f00f8 100644 --- a/docs/en/data/sponsors.yml +++ b/docs/en/data/sponsors.yml @@ -1,7 +1,7 @@ gold: - - url: https://bit.ly/2QSouzH - title: "Jina: build neural search-as-a-service for any kind of data in just minutes." - img: https://fastapi.tiangolo.com/img/sponsors/jina.svg + - url: https://bit.ly/3PjOZqc + title: "DiscoArt: Create compelling Disco Diffusion artworks in just one line" + img: https://fastapi.tiangolo.com/img/sponsors/jina-ai.png - url: https://cryptapi.io/ title: "CryptAPI: Your easy to use, secure and privacy oriented payment gateway." img: https://fastapi.tiangolo.com/img/sponsors/cryptapi.svg diff --git a/docs/en/docs/css/custom.css b/docs/en/docs/css/custom.css index 7d3503e49..42b752bcf 100644 --- a/docs/en/docs/css/custom.css +++ b/docs/en/docs/css/custom.css @@ -94,7 +94,7 @@ a.announce-link:hover { .announce-wrapper .sponsor-badge { display: block; position: absolute; - top: -5px; + top: -10px; right: 0; font-size: 0.5rem; color: #999; diff --git a/docs/en/docs/img/sponsors/jina-ai-banner.png b/docs/en/docs/img/sponsors/jina-ai-banner.png new file mode 100644 index 0000000000000000000000000000000000000000..3ac6b44adcf4b0c28df130ca0e16c674ea43e229 GIT binary patch literal 14153 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 T7SUJA00000NkvXXu0mjfJ5Bsy literal 0 HcmV?d00001 diff --git a/docs/en/docs/img/sponsors/jina-ai.png b/docs/en/docs/img/sponsors/jina-ai.png new file mode 100644 index 0000000000000000000000000000000000000000..d6b0bfb4ec24acce9ab9cb4ca46740bb16c702ae GIT binary patch literal 26112 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 X@XdfIPq1E700000NkvXXu0mjfyQ^GY literal 0 HcmV?d00001 diff --git a/docs/en/overrides/main.html b/docs/en/overrides/main.html index 9bed0253f..5c7029b85 100644 --- a/docs/en/overrides/main.html +++ b/docs/en/overrides/main.html @@ -29,9 +29,9 @@
From e3339f6770eaaa35e89ec6c1df917a5fd02d6f39 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 14 Jul 2022 12:38:22 +0000 Subject: [PATCH 152/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 714401fde..84b511c0a 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐Ÿ”ง Update Jina sponsor badges. PR [#5151](https://github.com/tiangolo/fastapi/pull/5151) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ”ง Add config for Swedish translations notification. PR [#5147](https://github.com/tiangolo/fastapi/pull/5147) by [@tiangolo](https://github.com/tiangolo). * ๐ŸŒ Start of Swedish translation. PR [#5062](https://github.com/tiangolo/fastapi/pull/5062) by [@MrRawbin](https://github.com/MrRawbin). * ๐ŸŒ Add Japanese translation for `docs/ja/docs/advanced/index.md`. PR [#5043](https://github.com/tiangolo/fastapi/pull/5043) by [@wakabame](https://github.com/wakabame). From ec2ec482930b0683b5dd6aa4f580c18f1bdd2f23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Thu, 14 Jul 2022 16:56:40 +0200 Subject: [PATCH 153/168] =?UTF-8?q?=F0=9F=91=A5=20Update=20FastAPI=20Peopl?= =?UTF-8?q?e=20(#5154)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: github-actions --- docs/en/data/github_sponsors.yml | 197 +++++++++++++++++-------- docs/en/data/people.yml | 246 +++++++++++++++++-------------- 2 files changed, 269 insertions(+), 174 deletions(-) diff --git a/docs/en/data/github_sponsors.yml b/docs/en/data/github_sponsors.yml index db4a9acc6..6c1efcbbd 100644 --- a/docs/en/data/github_sponsors.yml +++ b/docs/en/data/github_sponsors.yml @@ -1,16 +1,25 @@ sponsors: -- - login: cryptapi +- - login: github + avatarUrl: https://avatars.githubusercontent.com/u/9919?v=4 + url: https://github.com/github +- - login: Doist + avatarUrl: https://avatars.githubusercontent.com/u/2565372?v=4 + url: https://github.com/Doist + - login: cryptapi avatarUrl: https://avatars.githubusercontent.com/u/44925437?u=61369138589bc7fee6c417f3fbd50fbd38286cc4&v=4 url: https://github.com/cryptapi + - login: BLUE-DEVIL1134 + avatarUrl: https://avatars.githubusercontent.com/u/55914808?u=f283d674fce31be7fb3ed2665b0f20d89958e541&v=4 + url: https://github.com/BLUE-DEVIL1134 - login: jina-ai avatarUrl: https://avatars.githubusercontent.com/u/60539444?v=4 url: https://github.com/jina-ai - login: DropbaseHQ avatarUrl: https://avatars.githubusercontent.com/u/85367855?v=4 url: https://github.com/DropbaseHQ -- - login: sushi2all - avatarUrl: https://avatars.githubusercontent.com/u/1043732?v=4 - url: https://github.com/sushi2all +- - login: ObliviousAI + avatarUrl: https://avatars.githubusercontent.com/u/65656077?v=4 + url: https://github.com/ObliviousAI - login: chaserowbotham avatarUrl: https://avatars.githubusercontent.com/u/97751084?v=4 url: https://github.com/chaserowbotham @@ -32,9 +41,6 @@ sponsors: - login: VincentParedes avatarUrl: https://avatars.githubusercontent.com/u/103889729?v=4 url: https://github.com/VincentParedes -- - login: plocher - avatarUrl: https://avatars.githubusercontent.com/u/1082871?v=4 - url: https://github.com/plocher - - login: InesIvanova avatarUrl: https://avatars.githubusercontent.com/u/22920417?u=409882ec1df6dbd77455788bb383a8de223dbf6f&v=4 url: https://github.com/InesIvanova @@ -53,7 +59,10 @@ sponsors: - login: BoostryJP avatarUrl: https://avatars.githubusercontent.com/u/57932412?v=4 url: https://github.com/BoostryJP -- - login: johnadjei +- - login: nnfuzzy + avatarUrl: https://avatars.githubusercontent.com/u/687670?v=4 + url: https://github.com/nnfuzzy + - login: johnadjei avatarUrl: https://avatars.githubusercontent.com/u/767860?v=4 url: https://github.com/johnadjei - login: HiredScore @@ -68,9 +77,6 @@ sponsors: - login: RodneyU215 avatarUrl: https://avatars.githubusercontent.com/u/3329665?u=ec6a9adf8e7e8e306eed7d49687c398608d1604f&v=4 url: https://github.com/RodneyU215 - - login: grillazz - avatarUrl: https://avatars.githubusercontent.com/u/3415861?u=0b32b7073ae1ab8b7f6d2db0188c2e1e357ff451&v=4 - url: https://github.com/grillazz - login: tizz98 avatarUrl: https://avatars.githubusercontent.com/u/5739698?u=f095a3659e3a8e7c69ccd822696990b521ea25f9&v=4 url: https://github.com/tizz98 @@ -80,30 +86,36 @@ sponsors: - login: marutoraman avatarUrl: https://avatars.githubusercontent.com/u/33813153?u=2d0522bceba0b8b69adf1f2db866503bd96f944e&v=4 url: https://github.com/marutoraman + - login: leynier + avatarUrl: https://avatars.githubusercontent.com/u/36774373?u=2284831c821307de562ebde5b59014d5416c7e0d&v=4 + url: https://github.com/leynier - login: mainframeindustries avatarUrl: https://avatars.githubusercontent.com/u/55092103?v=4 url: https://github.com/mainframeindustries - login: A-Edge avatarUrl: https://avatars.githubusercontent.com/u/59514131?v=4 url: https://github.com/A-Edge + - login: DelfinaCare + avatarUrl: https://avatars.githubusercontent.com/u/83734439?v=4 + url: https://github.com/DelfinaCare +- - login: povilasb + avatarUrl: https://avatars.githubusercontent.com/u/1213442?u=b11f58ed6ceea6e8297c9b310030478ebdac894d&v=4 + url: https://github.com/povilasb - - login: Kludex avatarUrl: https://avatars.githubusercontent.com/u/7353520?u=62adc405ef418f4b6c8caa93d3eb8ab107bc4927&v=4 url: https://github.com/Kludex - login: samuelcolvin avatarUrl: https://avatars.githubusercontent.com/u/4039449?u=807390ba9cfe23906c3bf8a0d56aaca3cf2bfa0d&v=4 url: https://github.com/samuelcolvin - - login: jokull - avatarUrl: https://avatars.githubusercontent.com/u/701?u=0532b62166893d5160ef795c4c8b7512d971af05&v=4 - url: https://github.com/jokull - login: jefftriplett avatarUrl: https://avatars.githubusercontent.com/u/50527?u=af1ddfd50f6afd6d99f333ba2ac8d0a5b245ea74&v=4 url: https://github.com/jefftriplett + - login: medecau + avatarUrl: https://avatars.githubusercontent.com/u/59870?u=f9341c95adaba780828162fd4c7442357ecfcefa&v=4 + url: https://github.com/medecau - login: kamalgill avatarUrl: https://avatars.githubusercontent.com/u/133923?u=0df9181d97436ce330e9acf90ab8a54b7022efe7&v=4 url: https://github.com/kamalgill - - login: jsutton - avatarUrl: https://avatars.githubusercontent.com/u/280777?v=4 - url: https://github.com/jsutton - login: deserat avatarUrl: https://avatars.githubusercontent.com/u/299332?v=4 url: https://github.com/deserat @@ -117,14 +129,17 @@ sponsors: avatarUrl: https://avatars.githubusercontent.com/u/630670?u=507d8577b4b3670546b449c4c2ccbc5af40d72f7&v=4 url: https://github.com/koxudaxi - login: jqueguiner - avatarUrl: https://avatars.githubusercontent.com/u/690878?u=e4835b2a985a0f2d52018e4926cb5a58c26a62e8&v=4 + avatarUrl: https://avatars.githubusercontent.com/u/690878?u=bd65cc1f228ce6455e56dfaca3ef47c33bc7c3b0&v=4 url: https://github.com/jqueguiner + - login: alexsantos + avatarUrl: https://avatars.githubusercontent.com/u/932219?v=4 + url: https://github.com/alexsantos + - login: tcsmith + avatarUrl: https://avatars.githubusercontent.com/u/989034?u=7d8d741552b3279e8f4d3878679823a705a46f8f&v=4 + url: https://github.com/tcsmith - login: ltieman avatarUrl: https://avatars.githubusercontent.com/u/1084689?u=e69b17de17cb3ca141a17daa7ccbe173ceb1eb17&v=4 url: https://github.com/ltieman - - login: westonsteimel - avatarUrl: https://avatars.githubusercontent.com/u/1593939?u=0f2c0e3647f916fe295d62fa70da7a4c177115e3&v=4 - url: https://github.com/westonsteimel - login: corleyma avatarUrl: https://avatars.githubusercontent.com/u/2080732?u=aed2ff652294a87d666b1c3f6dbe98104db76d26&v=4 url: https://github.com/corleyma @@ -140,6 +155,9 @@ sponsors: - login: Shark009 avatarUrl: https://avatars.githubusercontent.com/u/3163309?u=0c6f4091b0eda05c44c390466199826e6dc6e431&v=4 url: https://github.com/Shark009 + - login: grillazz + avatarUrl: https://avatars.githubusercontent.com/u/3415861?u=0b32b7073ae1ab8b7f6d2db0188c2e1e357ff451&v=4 + url: https://github.com/grillazz - login: dblackrun avatarUrl: https://avatars.githubusercontent.com/u/3528486?v=4 url: https://github.com/dblackrun @@ -152,6 +170,9 @@ sponsors: - login: peterHoburg avatarUrl: https://avatars.githubusercontent.com/u/3860655?u=f55f47eb2d6a9b495e806ac5a044e3ae01ccc1fa&v=4 url: https://github.com/peterHoburg + - login: gorhack + avatarUrl: https://avatars.githubusercontent.com/u/4141690?u=ec119ebc4bdf00a7bc84657a71aa17834f4f27f3&v=4 + url: https://github.com/gorhack - login: jaredtrog avatarUrl: https://avatars.githubusercontent.com/u/4381365?v=4 url: https://github.com/jaredtrog @@ -182,6 +203,9 @@ sponsors: - login: pkucmus avatarUrl: https://avatars.githubusercontent.com/u/6347418?u=98f5918b32e214a168a2f5d59b0b8ebdf57dca0d&v=4 url: https://github.com/pkucmus + - login: ioalloc + avatarUrl: https://avatars.githubusercontent.com/u/6737824?u=6c3a31449f1c92064287171aa9ebe6363a0c9b7b&v=4 + url: https://github.com/ioalloc - login: s3ich4n avatarUrl: https://avatars.githubusercontent.com/u/6926298?u=ba3025d698e1c986655e776ae383a3d60d9d578e&v=4 url: https://github.com/s3ich4n @@ -200,6 +224,9 @@ sponsors: - login: Ge0f3 avatarUrl: https://avatars.githubusercontent.com/u/11887760?u=ccd80f1ac36dcb8517ef5c4e702e8cc5a80cad2f&v=4 url: https://github.com/Ge0f3 + - login: svats2k + avatarUrl: https://avatars.githubusercontent.com/u/12378398?u=ecf28c19f61052e664bdfeb2391f8107d137915c&v=4 + url: https://github.com/svats2k - login: gokulyc avatarUrl: https://avatars.githubusercontent.com/u/13468848?u=269f269d3e70407b5fb80138c52daba7af783997&v=4 url: https://github.com/gokulyc @@ -215,9 +242,6 @@ sponsors: - login: wedwardbeck avatarUrl: https://avatars.githubusercontent.com/u/19333237?u=1de4ae2bf8d59eb4c013f21d863cbe0f2010575f&v=4 url: https://github.com/wedwardbeck - - login: linusg - avatarUrl: https://avatars.githubusercontent.com/u/19366641?u=125e390abef8fff3b3b0d370c369cba5d7fd4c67&v=4 - url: https://github.com/linusg - login: stradivari96 avatarUrl: https://avatars.githubusercontent.com/u/19752586?u=255f5f06a768f518b20cebd6963e840ac49294fd&v=4 url: https://github.com/stradivari96 @@ -230,6 +254,9 @@ sponsors: - login: shuheng-liu avatarUrl: https://avatars.githubusercontent.com/u/22414322?u=813c45f30786c6b511b21a661def025d8f7b609e&v=4 url: https://github.com/shuheng-liu + - login: Joeriksson + avatarUrl: https://avatars.githubusercontent.com/u/25037079?v=4 + url: https://github.com/Joeriksson - login: cometa-haley avatarUrl: https://avatars.githubusercontent.com/u/25950317?u=cec1a3e0643b785288ae8260cc295a85ab344995&v=4 url: https://github.com/cometa-haley @@ -258,23 +285,32 @@ sponsors: avatarUrl: https://avatars.githubusercontent.com/u/35070513?u=b48c05f669d1ea1d329f90dc70e45f10b569ef55&v=4 url: https://github.com/guligon90 - login: ybressler - avatarUrl: https://avatars.githubusercontent.com/u/40807730?u=6621dc9ab53b697912ab2a32211bb29ae90a9112&v=4 + avatarUrl: https://avatars.githubusercontent.com/u/40807730?u=41e2c00f1eebe3c402635f0325e41b4e6511462c&v=4 url: https://github.com/ybressler - - login: iamkarshe - avatarUrl: https://avatars.githubusercontent.com/u/43641892?u=d08c901b359c931784501740610d416558ff3e24&v=4 - url: https://github.com/iamkarshe + - login: ddilidili + avatarUrl: https://avatars.githubusercontent.com/u/42176885?u=c0a849dde06987434653197b5f638d3deb55fc6c&v=4 + url: https://github.com/ddilidili - login: dbanty avatarUrl: https://avatars.githubusercontent.com/u/43723790?u=9bcce836bbce55835291c5b2ac93a4e311f4b3c3&v=4 url: https://github.com/dbanty + - login: VictorCalderon + avatarUrl: https://avatars.githubusercontent.com/u/44529243?u=cea69884f826a29aff1415493405209e0706d07a&v=4 + url: https://github.com/VictorCalderon + - login: arthuRHD + avatarUrl: https://avatars.githubusercontent.com/u/48015496?u=05a0d5b8b9320eeb7990d35c9337b823f269d2ff&v=4 + url: https://github.com/arthuRHD - login: rafsaf - avatarUrl: https://avatars.githubusercontent.com/u/51059348?u=be9f06b8ced2d2b677297decc781fa8ce4f7ddbd&v=4 + avatarUrl: https://avatars.githubusercontent.com/u/51059348?u=f8f0d6d6e90fac39fa786228158ba7f013c74271&v=4 url: https://github.com/rafsaf - login: dudikbender avatarUrl: https://avatars.githubusercontent.com/u/53487583?u=494f85229115076121b3639a3806bbac1c6ae7f6&v=4 url: https://github.com/dudikbender - login: daisuke8000 - avatarUrl: https://avatars.githubusercontent.com/u/55035595?u=5025e379cd3655ae1a96039efc85223a873d2e38&v=4 + avatarUrl: https://avatars.githubusercontent.com/u/55035595?u=23a3f2f2925ad3efc27c7420041622b7f5fd2b79&v=4 url: https://github.com/daisuke8000 + - login: dazeddd + avatarUrl: https://avatars.githubusercontent.com/u/59472056?u=7a1b668449bf8b448db13e4c575576d24d7d658b&v=4 + url: https://github.com/dazeddd - login: yakkonaut avatarUrl: https://avatars.githubusercontent.com/u/60633704?u=90a71fd631aa998ba4a96480788f017c9904e07b&v=4 url: https://github.com/yakkonaut @@ -291,11 +327,8 @@ sponsors: avatarUrl: https://avatars.githubusercontent.com/u/70378377?u=6d1814195c0de7162820eaad95a25b423a3869c0&v=4 url: https://github.com/daverin - login: anthonycepeda - avatarUrl: https://avatars.githubusercontent.com/u/72019805?u=892f700c79f9732211bd5221bf16eec32356a732&v=4 + avatarUrl: https://avatars.githubusercontent.com/u/72019805?u=4252c6b6dc5024af502a823a3ac5e7a03a69963f&v=4 url: https://github.com/anthonycepeda - - login: NinaHwang - avatarUrl: https://avatars.githubusercontent.com/u/79563565?u=1741703bd6c8f491503354b363a86e879b4c1cab&v=4 - url: https://github.com/NinaHwang - login: dotlas avatarUrl: https://avatars.githubusercontent.com/u/88832003?v=4 url: https://github.com/dotlas @@ -347,27 +380,27 @@ sponsors: - login: hardbyte avatarUrl: https://avatars.githubusercontent.com/u/855189?u=aa29e92f34708814d6b67fcd47ca4cf2ce1c04ed&v=4 url: https://github.com/hardbyte + - login: browniebroke + avatarUrl: https://avatars.githubusercontent.com/u/861044?u=5abfca5588f3e906b31583d7ee62f6de4b68aa24&v=4 + url: https://github.com/browniebroke - login: janfilips avatarUrl: https://avatars.githubusercontent.com/u/870699?u=6034d81731ecb41ae5c717e56a901ed46fc039a8&v=4 url: https://github.com/janfilips - - login: scari - avatarUrl: https://avatars.githubusercontent.com/u/964251?v=4 - url: https://github.com/scari + - login: woodrad + avatarUrl: https://avatars.githubusercontent.com/u/1410765?u=86707076bb03d143b3b11afc1743d2aa496bd8bf&v=4 + url: https://github.com/woodrad - login: Pytlicek avatarUrl: https://avatars.githubusercontent.com/u/1430522?u=169dba3bfbc04ed214a914640ff435969f19ddb3&v=4 url: https://github.com/Pytlicek - - login: Celeborn2BeAlive - avatarUrl: https://avatars.githubusercontent.com/u/1659465?u=944517e4db0f6df65070074e81cabdad9c8a434b&v=4 - url: https://github.com/Celeborn2BeAlive + - login: allen0125 + avatarUrl: https://avatars.githubusercontent.com/u/1448456?u=d4feb3d06a61baa4a69857ce371cc53fb4dffd2c&v=4 + url: https://github.com/allen0125 - login: WillHogan avatarUrl: https://avatars.githubusercontent.com/u/1661551?u=7036c064cf29781470573865264ec8e60b6b809f&v=4 url: https://github.com/WillHogan - login: cbonoz avatarUrl: https://avatars.githubusercontent.com/u/2351087?u=fd3e8030b2cc9fbfbb54a65e9890c548a016f58b&v=4 url: https://github.com/cbonoz - - login: Abbe98 - avatarUrl: https://avatars.githubusercontent.com/u/2631719?u=8a064aba9a710229ad28c616549d81a24191a5df&v=4 - url: https://github.com/Abbe98 - login: rglsk avatarUrl: https://avatars.githubusercontent.com/u/2768101?u=e349c88673f2155fe021331377c656a9d74bcc25&v=4 url: https://github.com/rglsk @@ -386,6 +419,9 @@ sponsors: - login: Alisa-lisa avatarUrl: https://avatars.githubusercontent.com/u/4137964?u=e7e393504f554f4ff15863a1e01a5746863ef9ce&v=4 url: https://github.com/Alisa-lisa + - login: danielunderwood + avatarUrl: https://avatars.githubusercontent.com/u/4472301?v=4 + url: https://github.com/danielunderwood - login: unredundant avatarUrl: https://avatars.githubusercontent.com/u/5607577?u=57dd0023365bec03f4fc566df6b81bc0a264a47d&v=4 url: https://github.com/unredundant @@ -401,9 +437,6 @@ sponsors: - login: yenchenLiu avatarUrl: https://avatars.githubusercontent.com/u/9199638?u=8cdf5ae507448430d90f6f3518d1665a23afe99b&v=4 url: https://github.com/yenchenLiu - - login: VivianSolide - avatarUrl: https://avatars.githubusercontent.com/u/9358572?u=4a38ef72dd39e8b262bd5ab819992128b55c52b4&v=4 - url: https://github.com/VivianSolide - login: xncbf avatarUrl: https://avatars.githubusercontent.com/u/9462045?u=866a1311e4bd3ec5ae84185c4fcc99f397c883d7&v=4 url: https://github.com/xncbf @@ -425,12 +458,24 @@ sponsors: - login: logan-connolly avatarUrl: https://avatars.githubusercontent.com/u/16244943?u=8ae66dfbba936463cc8aa0dd7a6d2b4c0cc757eb&v=4 url: https://github.com/logan-connolly + - login: sanghunka + avatarUrl: https://avatars.githubusercontent.com/u/16280020?u=960f5426ae08303229f045b9cc2ed463dcd41c15&v=4 + url: https://github.com/sanghunka + - login: stevenayers + avatarUrl: https://avatars.githubusercontent.com/u/16361214?u=098b797d8d48afb8cd964b717847943b61d24a6d&v=4 + url: https://github.com/stevenayers - login: cdsre avatarUrl: https://avatars.githubusercontent.com/u/16945936?v=4 url: https://github.com/cdsre + - login: aprilcoskun + avatarUrl: https://avatars.githubusercontent.com/u/17393603?u=29145243b4c7fadc80c7099471309cc2c04b6bcc&v=4 + url: https://github.com/aprilcoskun - login: jangia avatarUrl: https://avatars.githubusercontent.com/u/17927101?u=9261b9bb0c3e3bb1ecba43e8915dc58d8c9a077e&v=4 url: https://github.com/jangia + - login: yannicschroeer + avatarUrl: https://avatars.githubusercontent.com/u/22749683?u=4df05a7296c207b91c5d7c7a11c29df5ab313e2b&v=4 + url: https://github.com/yannicschroeer - login: ghandic avatarUrl: https://avatars.githubusercontent.com/u/23500353?u=e2e1d736f924d9be81e8bfc565b6d8836ba99773&v=4 url: https://github.com/ghandic @@ -440,9 +485,12 @@ sponsors: - login: mertguvencli avatarUrl: https://avatars.githubusercontent.com/u/29762151?u=16a906d90df96c8cff9ea131a575c4bc171b1523&v=4 url: https://github.com/mertguvencli - - login: dwreeves - avatarUrl: https://avatars.githubusercontent.com/u/31971762?u=69732aba05aa5cf0780866349ebe109cf632b047&v=4 - url: https://github.com/dwreeves + - login: elisoncrum + avatarUrl: https://avatars.githubusercontent.com/u/30413278?u=531190845bb0935dbc1e4f017cda3cb7b4dd0e54&v=4 + url: https://github.com/elisoncrum + - login: HosamAlmoghraby + avatarUrl: https://avatars.githubusercontent.com/u/32025281?u=aa1b09feabccbf9dc506b81c71155f32d126cefa&v=4 + url: https://github.com/HosamAlmoghraby - login: kitaramu0401 avatarUrl: https://avatars.githubusercontent.com/u/33246506?u=929e6efa2c518033b8097ba524eb5347a069bb3b&v=4 url: https://github.com/kitaramu0401 @@ -452,45 +500,72 @@ sponsors: - login: declon avatarUrl: https://avatars.githubusercontent.com/u/36180226?v=4 url: https://github.com/declon + - login: alvarobartt + avatarUrl: https://avatars.githubusercontent.com/u/36760800?u=ac9ccb8b9164eb5fe7d5276142591aa1b8080daf&v=4 + url: https://github.com/alvarobartt - login: d-e-h-i-o avatarUrl: https://avatars.githubusercontent.com/u/36816716?v=4 url: https://github.com/d-e-h-i-o + - login: ww-daniel-mora + avatarUrl: https://avatars.githubusercontent.com/u/38921751?u=ae14bc1e40f2dd5a9c5741fc0b0dffbd416a5fa9&v=4 + url: https://github.com/ww-daniel-mora + - login: rwxd + avatarUrl: https://avatars.githubusercontent.com/u/40308458?u=9ddf8023ca3326381ba8fb77285ae36598a15de3&v=4 + url: https://github.com/rwxd - login: ilias-ant avatarUrl: https://avatars.githubusercontent.com/u/42189572?u=a2d6121bac4d125d92ec207460fa3f1842d37e66&v=4 url: https://github.com/ilias-ant - login: arrrrrmin avatarUrl: https://avatars.githubusercontent.com/u/43553423?u=fee5739394fea074cb0b66929d070114a5067aae&v=4 url: https://github.com/arrrrrmin - - login: Nephilim-Jack - avatarUrl: https://avatars.githubusercontent.com/u/48372168?u=6f2bb405238d7efc467536fe01f58df6779c58a9&v=4 - url: https://github.com/Nephilim-Jack + - login: BomGard + avatarUrl: https://avatars.githubusercontent.com/u/47395385?u=8e9052f54e0b8dc7285099c438fa29c55a7d6407&v=4 + url: https://github.com/BomGard - login: akanz1 avatarUrl: https://avatars.githubusercontent.com/u/51492342?u=2280f57134118714645e16b535c1a37adf6b369b&v=4 url: https://github.com/akanz1 - - login: rooflexx - avatarUrl: https://avatars.githubusercontent.com/u/58993673?u=f8ba450460f1aea18430ed1e4a3889049a3b4dfa&v=4 - url: https://github.com/rooflexx - - login: denisyao1 - avatarUrl: https://avatars.githubusercontent.com/u/60019356?v=4 - url: https://github.com/denisyao1 + - login: shidenko97 + avatarUrl: https://avatars.githubusercontent.com/u/54946990?u=3fdc0caea36af9217dacf1cc7760c7ed9d67dcfe&v=4 + url: https://github.com/shidenko97 + - login: data-djinn + avatarUrl: https://avatars.githubusercontent.com/u/56449985?u=42146e140806908d49bd59ccc96f222abf587886&v=4 + url: https://github.com/data-djinn + - login: leo-jp-edwards + avatarUrl: https://avatars.githubusercontent.com/u/58213433?u=2c128e8b0794b7a66211cd7d8ebe05db20b7e9c0&v=4 + url: https://github.com/leo-jp-edwards - login: apar-tiwari avatarUrl: https://avatars.githubusercontent.com/u/61064197?v=4 url: https://github.com/apar-tiwari + - login: Vyvy-vi + avatarUrl: https://avatars.githubusercontent.com/u/62864373?u=1a9b0b28779abc2bc9b62cb4d2e44d453973c9c3&v=4 + url: https://github.com/Vyvy-vi - login: 0417taehyun avatarUrl: https://avatars.githubusercontent.com/u/63915557?u=47debaa860fd52c9b98c97ef357ddcec3b3fb399&v=4 url: https://github.com/0417taehyun + - login: realabja + avatarUrl: https://avatars.githubusercontent.com/u/66185192?u=001e2dd9297784f4218997981b4e6fa8357bb70b&v=4 + url: https://github.com/realabja - login: alessio-proietti avatarUrl: https://avatars.githubusercontent.com/u/67370599?u=8ac73db1e18e946a7681f173abdb640516f88515&v=4 url: https://github.com/alessio-proietti + - login: Mr-Sunglasses + avatarUrl: https://avatars.githubusercontent.com/u/81439109?u=a5d0762fdcec26e18a028aef05323de3c6fb195c&v=4 + url: https://github.com/Mr-Sunglasses - - login: backbord avatarUrl: https://avatars.githubusercontent.com/u/6814946?v=4 url: https://github.com/backbord - - login: sadikkuzu - avatarUrl: https://avatars.githubusercontent.com/u/23168063?u=765ed469c44c004560079210ccdad5b29938eaa9&v=4 - url: https://github.com/sadikkuzu - login: gabrielmbmb avatarUrl: https://avatars.githubusercontent.com/u/29572918?u=6d1e00b5d558e96718312ff910a2318f47cc3145&v=4 url: https://github.com/gabrielmbmb - login: danburonline avatarUrl: https://avatars.githubusercontent.com/u/34251194?u=2cad4388c1544e539ecb732d656e42fb07b4ff2d&v=4 url: https://github.com/danburonline + - login: zachspar + avatarUrl: https://avatars.githubusercontent.com/u/41600414?u=edf29c197137f51bace3f19a2ba759662640771f&v=4 + url: https://github.com/zachspar + - login: sownt + avatarUrl: https://avatars.githubusercontent.com/u/44340502?u=c06e3c45fb00a403075172770805fe57ff17b1cf&v=4 + url: https://github.com/sownt + - login: aahouzi + avatarUrl: https://avatars.githubusercontent.com/u/75032370?u=82677ee9cd86b3ccf4e13d9cb6765d8de5713e1e&v=4 + url: https://github.com/aahouzi diff --git a/docs/en/data/people.yml b/docs/en/data/people.yml index 92aab109f..031c1ca4d 100644 --- a/docs/en/data/people.yml +++ b/docs/en/data/people.yml @@ -1,12 +1,12 @@ maintainers: - login: tiangolo - answers: 1243 - prs: 300 - avatarUrl: https://avatars.githubusercontent.com/u/1326112?u=5cad72c846b7aba2e960546af490edc7375dafc4&v=4 + answers: 1248 + prs: 318 + avatarUrl: https://avatars.githubusercontent.com/u/1326112?u=740f11212a731f56798f558ceddb0bd07642afa7&v=4 url: https://github.com/tiangolo experts: - login: Kludex - count: 335 + count: 352 avatarUrl: https://avatars.githubusercontent.com/u/7353520?u=62adc405ef418f4b6c8caa93d3eb8ab107bc4927&v=4 url: https://github.com/Kludex - login: dmontagu @@ -30,19 +30,23 @@ experts: avatarUrl: https://avatars.githubusercontent.com/u/331403?v=4 url: https://github.com/phy25 - login: raphaelauv - count: 71 + count: 77 avatarUrl: https://avatars.githubusercontent.com/u/10202690?u=e6f86f5c0c3026a15d6b51792fa3e532b12f1371&v=4 url: https://github.com/raphaelauv - login: ArcLightSlavik count: 71 avatarUrl: https://avatars.githubusercontent.com/u/31127044?u=b0f2c37142f4b762e41ad65dc49581813422bd71&v=4 url: https://github.com/ArcLightSlavik +- login: JarroVGIT + count: 68 + avatarUrl: https://avatars.githubusercontent.com/u/13659033?u=e8bea32d07a5ef72f7dde3b2079ceb714923ca05&v=4 + url: https://github.com/JarroVGIT - login: falkben count: 58 avatarUrl: https://avatars.githubusercontent.com/u/653031?u=0c8d8f33d87f1aa1a6488d3f02105e9abc838105&v=4 url: https://github.com/falkben - login: sm-Fifteen - count: 48 + count: 49 avatarUrl: https://avatars.githubusercontent.com/u/516999?u=437c0c5038558c67e887ccd863c1ba0f846c03da&v=4 url: https://github.com/sm-Fifteen - login: insomnes @@ -53,22 +57,22 @@ experts: count: 43 avatarUrl: https://avatars.githubusercontent.com/u/27180793?u=5cf2877f50b3eb2bc55086089a78a36f07042889&v=4 url: https://github.com/Dustyposa +- login: adriangb + count: 40 + avatarUrl: https://avatars.githubusercontent.com/u/1755071?u=81f0262df34e1460ca546fbd0c211169c2478532&v=4 + url: https://github.com/adriangb +- login: jgould22 + count: 40 + avatarUrl: https://avatars.githubusercontent.com/u/4335847?u=ed77f67e0bb069084639b24d812dbb2a2b1dc554&v=4 + url: https://github.com/jgould22 - login: includeamin count: 39 avatarUrl: https://avatars.githubusercontent.com/u/11836741?u=8bd5ef7e62fe6a82055e33c4c0e0a7879ff8cfb6&v=4 url: https://github.com/includeamin -- login: jgould22 - count: 38 - avatarUrl: https://avatars.githubusercontent.com/u/4335847?u=ed77f67e0bb069084639b24d812dbb2a2b1dc554&v=4 - url: https://github.com/jgould22 - login: STeveShary count: 37 avatarUrl: https://avatars.githubusercontent.com/u/5167622?u=de8f597c81d6336fcebc37b32dfd61a3f877160c&v=4 url: https://github.com/STeveShary -- login: adriangb - count: 36 - avatarUrl: https://avatars.githubusercontent.com/u/1755071?u=81f0262df34e1460ca546fbd0c211169c2478532&v=4 - url: https://github.com/adriangb - login: prostomarkeloff count: 33 avatarUrl: https://avatars.githubusercontent.com/u/28061158?u=72309cc1f2e04e40fa38b29969cb4e9d3f722e7b&v=4 @@ -81,18 +85,22 @@ experts: count: 31 avatarUrl: https://avatars.githubusercontent.com/u/31960541?u=47f4829c77f4962ab437ffb7995951e41eeebe9b&v=4 url: https://github.com/krishnardt +- login: chbndrhnns + count: 30 + avatarUrl: https://avatars.githubusercontent.com/u/7534547?v=4 + url: https://github.com/chbndrhnns - login: wshayes count: 29 avatarUrl: https://avatars.githubusercontent.com/u/365303?u=07ca03c5ee811eb0920e633cc3c3db73dbec1aa5&v=4 url: https://github.com/wshayes -- login: chbndrhnns - count: 28 - avatarUrl: https://avatars.githubusercontent.com/u/7534547?v=4 - url: https://github.com/chbndrhnns - login: panla - count: 26 + count: 27 avatarUrl: https://avatars.githubusercontent.com/u/41326348?u=ba2fda6b30110411ecbf406d187907e2b420ac19&v=4 url: https://github.com/panla +- login: acidjunk + count: 25 + avatarUrl: https://avatars.githubusercontent.com/u/685002?u=b5094ab4527fc84b006c0ac9ff54367bdebb2267&v=4 + url: https://github.com/acidjunk - login: ghandic count: 25 avatarUrl: https://avatars.githubusercontent.com/u/23500353?u=e2e1d736f924d9be81e8bfc565b6d8836ba99773&v=4 @@ -121,14 +129,18 @@ experts: count: 19 avatarUrl: https://avatars.githubusercontent.com/u/24581770?v=4 url: https://github.com/retnikt -- login: acidjunk - count: 18 - avatarUrl: https://avatars.githubusercontent.com/u/685002?u=b5094ab4527fc84b006c0ac9ff54367bdebb2267&v=4 - url: https://github.com/acidjunk +- login: odiseo0 + count: 19 + avatarUrl: https://avatars.githubusercontent.com/u/87550035?u=ab724eae71c3fe1cf81e8dc76e73415da926ef7d&v=4 + url: https://github.com/odiseo0 - login: Hultner count: 18 avatarUrl: https://avatars.githubusercontent.com/u/2669034?u=115e53df959309898ad8dc9443fbb35fee71df07&v=4 url: https://github.com/Hultner +- login: rafsaf + count: 18 + avatarUrl: https://avatars.githubusercontent.com/u/51059348?u=f8f0d6d6e90fac39fa786228158ba7f013c74271&v=4 + url: https://github.com/rafsaf - login: jorgerpo count: 17 avatarUrl: https://avatars.githubusercontent.com/u/12537771?u=7444d20019198e34911082780cc7ad73f2b97cb3&v=4 @@ -141,10 +153,6 @@ experts: count: 17 avatarUrl: https://avatars.githubusercontent.com/u/1765494?u=5b1ab7c582db4b4016fa31affe977d10af108ad4&v=4 url: https://github.com/harunyasar -- login: rafsaf - count: 17 - avatarUrl: https://avatars.githubusercontent.com/u/51059348?u=be9f06b8ced2d2b677297decc781fa8ce4f7ddbd&v=4 - url: https://github.com/rafsaf - login: waynerv count: 16 avatarUrl: https://avatars.githubusercontent.com/u/39515546?u=ec35139777597cdbbbddda29bf8b9d4396b429a9&v=4 @@ -153,6 +161,14 @@ experts: count: 16 avatarUrl: https://avatars.githubusercontent.com/u/41964673?u=9f2174f9d61c15c6e3a4c9e3aeee66f711ce311f&v=4 url: https://github.com/dstlny +- login: jonatasoli + count: 15 + avatarUrl: https://avatars.githubusercontent.com/u/26334101?u=071c062d2861d3dd127f6b4a5258cd8ef55d4c50&v=4 + url: https://github.com/jonatasoli +- login: hellocoldworld + count: 14 + avatarUrl: https://avatars.githubusercontent.com/u/47581948?u=3d2186796434c507a6cb6de35189ab0ad27c356f&v=4 + url: https://github.com/hellocoldworld - login: haizaar count: 13 avatarUrl: https://avatars.githubusercontent.com/u/58201?u=4f1f9843d69433ca0d380d95146cfe119e5fdac4&v=4 @@ -161,10 +177,6 @@ experts: count: 13 avatarUrl: https://avatars.githubusercontent.com/u/42819267?u=fdeeaa9242a59b243f8603496b00994f6951d5a2&v=4 url: https://github.com/valentin994 -- login: hellocoldworld - count: 12 - avatarUrl: https://avatars.githubusercontent.com/u/47581948?v=4 - url: https://github.com/hellocoldworld - login: David-Lor count: 12 avatarUrl: https://avatars.githubusercontent.com/u/17401854?u=474680c02b94cba810cb9032fb7eb787d9cc9d22&v=4 @@ -173,10 +185,10 @@ experts: count: 12 avatarUrl: https://avatars.githubusercontent.com/u/37829370?v=4 url: https://github.com/yinziyan1206 -- login: jonatasoli +- login: n8sty count: 12 - avatarUrl: https://avatars.githubusercontent.com/u/26334101?u=071c062d2861d3dd127f6b4a5258cd8ef55d4c50&v=4 - url: https://github.com/jonatasoli + avatarUrl: https://avatars.githubusercontent.com/u/2964996?v=4 + url: https://github.com/n8sty - login: lowercase00 count: 11 avatarUrl: https://avatars.githubusercontent.com/u/21188280?v=4 @@ -185,39 +197,31 @@ experts: count: 11 avatarUrl: https://avatars.githubusercontent.com/u/40475662?u=e58ef61034e8d0d6a312cc956fb09b9c3332b449&v=4 url: https://github.com/zamiramir -- login: juntatalor - count: 11 - avatarUrl: https://avatars.githubusercontent.com/u/8134632?v=4 - url: https://github.com/juntatalor -- login: n8sty - count: 11 - avatarUrl: https://avatars.githubusercontent.com/u/2964996?v=4 - url: https://github.com/n8sty -- login: aalifadv - count: 11 - avatarUrl: https://avatars.githubusercontent.com/u/78442260?v=4 - url: https://github.com/aalifadv last_month_active: -- login: jgould22 - count: 15 - avatarUrl: https://avatars.githubusercontent.com/u/4335847?u=ed77f67e0bb069084639b24d812dbb2a2b1dc554&v=4 - url: https://github.com/jgould22 -- login: accelleon +- login: JarroVGIT + count: 30 + avatarUrl: https://avatars.githubusercontent.com/u/13659033?u=e8bea32d07a5ef72f7dde3b2079ceb714923ca05&v=4 + url: https://github.com/JarroVGIT +- login: zoliknemet + count: 9 + avatarUrl: https://avatars.githubusercontent.com/u/22326718?u=31ba446ac290e23e56eea8e4f0c558aaf0b40779&v=4 + url: https://github.com/zoliknemet +- login: iudeen count: 5 - avatarUrl: https://avatars.githubusercontent.com/u/5001614?v=4 - url: https://github.com/accelleon -- login: jonatasoli - count: 4 - avatarUrl: https://avatars.githubusercontent.com/u/26334101?u=071c062d2861d3dd127f6b4a5258cd8ef55d4c50&v=4 - url: https://github.com/jonatasoli + avatarUrl: https://avatars.githubusercontent.com/u/10519440?u=2843b3303282bff8b212dcd4d9d6689452e4470c&v=4 + url: https://github.com/iudeen - login: Kludex - count: 4 + count: 5 avatarUrl: https://avatars.githubusercontent.com/u/7353520?u=62adc405ef418f4b6c8caa93d3eb8ab107bc4927&v=4 url: https://github.com/Kludex -- login: yinziyan1206 +- login: odiseo0 + count: 4 + avatarUrl: https://avatars.githubusercontent.com/u/87550035?u=ab724eae71c3fe1cf81e8dc76e73415da926ef7d&v=4 + url: https://github.com/odiseo0 +- login: jonatasoli count: 3 - avatarUrl: https://avatars.githubusercontent.com/u/37829370?v=4 - url: https://github.com/yinziyan1206 + avatarUrl: https://avatars.githubusercontent.com/u/26334101?u=071c062d2861d3dd127f6b4a5258cd8ef55d4c50&v=4 + url: https://github.com/jonatasoli top_contributors: - login: waynerv count: 25 @@ -243,21 +247,21 @@ top_contributors: count: 12 avatarUrl: https://avatars.githubusercontent.com/u/11489395?u=4adb6986bf3debfc2b8216ae701f2bd47d73da7d&v=4 url: https://github.com/mariacamilagl +- login: Kludex + count: 11 + avatarUrl: https://avatars.githubusercontent.com/u/7353520?u=62adc405ef418f4b6c8caa93d3eb8ab107bc4927&v=4 + url: https://github.com/Kludex - login: Smlep - count: 9 + count: 10 avatarUrl: https://avatars.githubusercontent.com/u/16785985?v=4 url: https://github.com/Smlep - login: Serrones count: 8 avatarUrl: https://avatars.githubusercontent.com/u/22691749?u=4795b880e13ca33a73e52fc0ef7dc9c60c8fce47&v=4 url: https://github.com/Serrones -- login: Kludex - count: 8 - avatarUrl: https://avatars.githubusercontent.com/u/7353520?u=62adc405ef418f4b6c8caa93d3eb8ab107bc4927&v=4 - url: https://github.com/Kludex - login: RunningIkkyu count: 7 - avatarUrl: https://avatars.githubusercontent.com/u/31848542?u=706e1ee3f248245f2d68b976d149d06fd5a2010d&v=4 + avatarUrl: https://avatars.githubusercontent.com/u/31848542?u=efb5b45b55584450507834f279ce48d4d64dea2f&v=4 url: https://github.com/RunningIkkyu - login: hard-coders count: 7 @@ -275,6 +279,10 @@ top_contributors: count: 5 avatarUrl: https://avatars.githubusercontent.com/u/1175560?v=4 url: https://github.com/Attsun1031 +- login: dependabot + count: 5 + avatarUrl: https://avatars.githubusercontent.com/in/29110?v=4 + url: https://github.com/apps/dependabot - login: jekirl count: 4 avatarUrl: https://avatars.githubusercontent.com/u/2546697?u=a027452387d85bd4a14834e19d716c99255fb3b7&v=4 @@ -291,15 +299,31 @@ top_contributors: count: 4 avatarUrl: https://avatars.githubusercontent.com/u/39375566?u=260ad6b1a4b34c07dbfa728da5e586f16f6d1824&v=4 url: https://github.com/komtaki +- login: hitrust + count: 4 + avatarUrl: https://avatars.githubusercontent.com/u/3360631?u=5fa1f475ad784d64eb9666bdd43cc4d285dcc773&v=4 + url: https://github.com/hitrust +- login: lsglucas + count: 4 + avatarUrl: https://avatars.githubusercontent.com/u/61513630?u=320e43fe4dc7bc6efc64e9b8f325f8075634fd20&v=4 + url: https://github.com/lsglucas +- login: ComicShrimp + count: 4 + avatarUrl: https://avatars.githubusercontent.com/u/43503750?u=b3e4d9a14d9a65d429ce62c566aef73178b7111d&v=4 + url: https://github.com/ComicShrimp - login: NinaHwang count: 4 avatarUrl: https://avatars.githubusercontent.com/u/79563565?u=1741703bd6c8f491503354b363a86e879b4c1cab&v=4 url: https://github.com/NinaHwang top_reviewers: - login: Kludex - count: 93 + count: 95 avatarUrl: https://avatars.githubusercontent.com/u/7353520?u=62adc405ef418f4b6c8caa93d3eb8ab107bc4927&v=4 url: https://github.com/Kludex +- login: tokusumi + count: 49 + avatarUrl: https://avatars.githubusercontent.com/u/41147016?u=55010621aece725aa702270b54fed829b6a1fe60&v=4 + url: https://github.com/tokusumi - login: waynerv count: 47 avatarUrl: https://avatars.githubusercontent.com/u/39515546?u=ec35139777597cdbbbddda29bf8b9d4396b429a9&v=4 @@ -308,10 +332,10 @@ top_reviewers: count: 47 avatarUrl: https://avatars.githubusercontent.com/u/59285379?v=4 url: https://github.com/Laineyzhang55 -- login: tokusumi - count: 46 - avatarUrl: https://avatars.githubusercontent.com/u/41147016?u=55010621aece725aa702270b54fed829b6a1fe60&v=4 - url: https://github.com/tokusumi +- login: BilalAlpaslan + count: 45 + avatarUrl: https://avatars.githubusercontent.com/u/47563997?u=63ed66e304fe8d765762c70587d61d9196e5c82d&v=4 + url: https://github.com/BilalAlpaslan - login: ycd count: 45 avatarUrl: https://avatars.githubusercontent.com/u/62724709?u=826f228edf0bab0d19ad1d5c4ba4df1047ccffef&v=4 @@ -320,13 +344,13 @@ top_reviewers: count: 41 avatarUrl: https://avatars.githubusercontent.com/u/24587499?u=e772190a051ab0eaa9c8542fcff1892471638f2b&v=4 url: https://github.com/cikay -- login: BilalAlpaslan - count: 40 - avatarUrl: https://avatars.githubusercontent.com/u/47563997?u=63ed66e304fe8d765762c70587d61d9196e5c82d&v=4 - url: https://github.com/BilalAlpaslan +- login: yezz123 + count: 34 + avatarUrl: https://avatars.githubusercontent.com/u/52716203?u=636b4f79645176df4527dd45c12d5dbb5a4193cf&v=4 + url: https://github.com/yezz123 - login: AdrianDeAnda count: 33 - avatarUrl: https://avatars.githubusercontent.com/u/1024932?u=bb7f8a0d6c9de4e9d0320a9f271210206e202250&v=4 + avatarUrl: https://avatars.githubusercontent.com/u/1024932?u=b2ea249c6b41ddf98679c8d110d0f67d4a3ebf93&v=4 url: https://github.com/AdrianDeAnda - login: ArcLightSlavik count: 31 @@ -344,10 +368,6 @@ top_reviewers: count: 21 avatarUrl: https://avatars.githubusercontent.com/u/39375566?u=260ad6b1a4b34c07dbfa728da5e586f16f6d1824&v=4 url: https://github.com/komtaki -- login: yezz123 - count: 19 - avatarUrl: https://avatars.githubusercontent.com/u/52716203?u=636b4f79645176df4527dd45c12d5dbb5a4193cf&v=4 - url: https://github.com/yezz123 - login: hard-coders count: 19 avatarUrl: https://avatars.githubusercontent.com/u/9651103?u=95db33927bbff1ed1c07efddeb97ac2ff33068ed&v=4 @@ -356,6 +376,14 @@ top_reviewers: count: 19 avatarUrl: https://avatars.githubusercontent.com/u/63915557?u=47debaa860fd52c9b98c97ef357ddcec3b3fb399&v=4 url: https://github.com/0417taehyun +- login: lsglucas + count: 18 + avatarUrl: https://avatars.githubusercontent.com/u/61513630?u=320e43fe4dc7bc6efc64e9b8f325f8075634fd20&v=4 + url: https://github.com/lsglucas +- login: JarroVGIT + count: 18 + avatarUrl: https://avatars.githubusercontent.com/u/13659033?u=e8bea32d07a5ef72f7dde3b2079ceb714923ca05&v=4 + url: https://github.com/JarroVGIT - login: zy7y count: 17 avatarUrl: https://avatars.githubusercontent.com/u/67154681?u=5d634834cc514028ea3f9115f7030b99a1f4d5a4&v=4 @@ -364,14 +392,14 @@ top_reviewers: count: 16 avatarUrl: https://avatars.githubusercontent.com/u/21978760?v=4 url: https://github.com/yanever -- login: lsglucas - count: 16 - avatarUrl: https://avatars.githubusercontent.com/u/61513630?u=320e43fe4dc7bc6efc64e9b8f325f8075634fd20&v=4 - url: https://github.com/lsglucas - login: SwftAlpc count: 16 avatarUrl: https://avatars.githubusercontent.com/u/52768429?u=6a3aa15277406520ad37f6236e89466ed44bc5b8&v=4 url: https://github.com/SwftAlpc +- login: rjNemo + count: 16 + avatarUrl: https://avatars.githubusercontent.com/u/56785022?u=d5c3a02567c8649e146fcfc51b6060ccaf8adef8&v=4 + url: https://github.com/rjNemo - login: Smlep count: 16 avatarUrl: https://avatars.githubusercontent.com/u/16785985?v=4 @@ -388,18 +416,18 @@ top_reviewers: count: 15 avatarUrl: https://avatars.githubusercontent.com/u/63476957?u=6c86e59b48e0394d4db230f37fc9ad4d7e2c27c7&v=4 url: https://github.com/delhi09 -- login: rjNemo - count: 14 - avatarUrl: https://avatars.githubusercontent.com/u/56785022?u=d5c3a02567c8649e146fcfc51b6060ccaf8adef8&v=4 - url: https://github.com/rjNemo -- login: RunningIkkyu - count: 12 - avatarUrl: https://avatars.githubusercontent.com/u/31848542?u=706e1ee3f248245f2d68b976d149d06fd5a2010d&v=4 - url: https://github.com/RunningIkkyu - login: sh0nk - count: 12 + count: 13 avatarUrl: https://avatars.githubusercontent.com/u/6478810?u=af15d724875cec682ed8088a86d36b2798f981c0&v=4 url: https://github.com/sh0nk +- login: RunningIkkyu + count: 12 + avatarUrl: https://avatars.githubusercontent.com/u/31848542?u=efb5b45b55584450507834f279ce48d4d64dea2f&v=4 + url: https://github.com/RunningIkkyu +- login: solomein-sv + count: 11 + avatarUrl: https://avatars.githubusercontent.com/u/46193920?u=46acfb4aeefb1d7b9fdc5a8cbd9eb8744683c47a&v=4 + url: https://github.com/solomein-sv - login: mariacamilagl count: 10 avatarUrl: https://avatars.githubusercontent.com/u/11489395?u=4adb6986bf3debfc2b8216ae701f2bd47d73da7d&v=4 @@ -412,10 +440,10 @@ top_reviewers: count: 10 avatarUrl: https://avatars.githubusercontent.com/u/7887703?v=4 url: https://github.com/maoyibo -- login: solomein-sv +- login: odiseo0 count: 10 - avatarUrl: https://avatars.githubusercontent.com/u/46193920?u=46acfb4aeefb1d7b9fdc5a8cbd9eb8744683c47a&v=4 - url: https://github.com/solomein-sv + avatarUrl: https://avatars.githubusercontent.com/u/87550035?u=ab724eae71c3fe1cf81e8dc76e73415da926ef7d&v=4 + url: https://github.com/odiseo0 - login: graingert count: 9 avatarUrl: https://avatars.githubusercontent.com/u/413772?v=4 @@ -432,6 +460,10 @@ top_reviewers: count: 9 avatarUrl: https://avatars.githubusercontent.com/u/69092910?u=4ac58eab99bd37d663f3d23551df96d4fbdbf760&v=4 url: https://github.com/bezaca +- login: raphaelauv + count: 8 + avatarUrl: https://avatars.githubusercontent.com/u/10202690?u=e6f86f5c0c3026a15d6b51792fa3e532b12f1371&v=4 + url: https://github.com/raphaelauv - login: blt232018 count: 8 avatarUrl: https://avatars.githubusercontent.com/u/43393471?u=172b0e0391db1aa6c1706498d6dfcb003c8a4857&v=4 @@ -460,10 +492,6 @@ top_reviewers: count: 7 avatarUrl: https://avatars.githubusercontent.com/u/36391432?u=094eec0cfddd5013f76f31e55e56147d78b19553&v=4 url: https://github.com/ryuckel -- login: raphaelauv - count: 7 - avatarUrl: https://avatars.githubusercontent.com/u/10202690?u=e6f86f5c0c3026a15d6b51792fa3e532b12f1371&v=4 - url: https://github.com/raphaelauv - login: NastasiaSaby count: 7 avatarUrl: https://avatars.githubusercontent.com/u/8245071?u=b3afd005f9e4bf080c219ef61a592b3a8004b764&v=4 @@ -472,6 +500,10 @@ top_reviewers: count: 7 avatarUrl: https://avatars.githubusercontent.com/u/1405026?v=4 url: https://github.com/Mause +- login: wakabame + count: 7 + avatarUrl: https://avatars.githubusercontent.com/u/35513518?v=4 + url: https://github.com/wakabame - login: AlexandreBiguet count: 7 avatarUrl: https://avatars.githubusercontent.com/u/1483079?u=ff926455cd4cab03c6c49441aa5dc2b21df3e266&v=4 @@ -480,15 +512,3 @@ top_reviewers: count: 7 avatarUrl: https://avatars.githubusercontent.com/u/34248814?v=4 url: https://github.com/krocdort -- login: jovicon - count: 6 - avatarUrl: https://avatars.githubusercontent.com/u/21287303?u=b049eac3e51a4c0473c2efe66b4d28a7d8f2b572&v=4 - url: https://github.com/jovicon -- login: LorhanSohaky - count: 6 - avatarUrl: https://avatars.githubusercontent.com/u/16273730?u=095b66f243a2cd6a0aadba9a095009f8aaf18393&v=4 - url: https://github.com/LorhanSohaky -- login: peidrao - count: 6 - avatarUrl: https://avatars.githubusercontent.com/u/32584628?u=88c2cb42a99e0f50cdeae3606992568184783ee5&v=4 - url: https://github.com/peidrao From 21fd708c6e9d9be470e287760e324e970fda7b35 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 14 Jul 2022 14:57:21 +0000 Subject: [PATCH 154/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 84b511c0a..230d501c2 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐Ÿ‘ฅ Update FastAPI People. PR [#5154](https://github.com/tiangolo/fastapi/pull/5154) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ”ง Update Jina sponsor badges. PR [#5151](https://github.com/tiangolo/fastapi/pull/5151) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ”ง Add config for Swedish translations notification. PR [#5147](https://github.com/tiangolo/fastapi/pull/5147) by [@tiangolo](https://github.com/tiangolo). * ๐ŸŒ Start of Swedish translation. PR [#5062](https://github.com/tiangolo/fastapi/pull/5062) by [@MrRawbin](https://github.com/MrRawbin). From 169af0217ed771698f518713b12a0f5a74ca3a19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Thu, 14 Jul 2022 17:04:37 +0200 Subject: [PATCH 155/168] =?UTF-8?q?=F0=9F=94=A7=20Update=20sponsors=20badg?= =?UTF-8?q?e=20configs=20(#5155)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/data/sponsors_badge.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/en/data/sponsors_badge.yml b/docs/en/data/sponsors_badge.yml index 10a31b86a..a8bfb0b1b 100644 --- a/docs/en/data/sponsors_badge.yml +++ b/docs/en/data/sponsors_badge.yml @@ -11,3 +11,5 @@ logins: - DropbaseHQ - VincentParedes - BLUE-DEVIL1134 + - ObliviousAI + - Doist From 0be244ad5273b074109b980cae7ba8e83b223fad Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 14 Jul 2022 15:05:19 +0000 Subject: [PATCH 156/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 230d501c2..160518644 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐Ÿ”ง Update sponsors badge configs. PR [#5155](https://github.com/tiangolo/fastapi/pull/5155) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ‘ฅ Update FastAPI People. PR [#5154](https://github.com/tiangolo/fastapi/pull/5154) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ”ง Update Jina sponsor badges. PR [#5151](https://github.com/tiangolo/fastapi/pull/5151) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ”ง Add config for Swedish translations notification. PR [#5147](https://github.com/tiangolo/fastapi/pull/5147) by [@tiangolo](https://github.com/tiangolo). From 35244ee83bb94b4f663ffa957f87ef432c137761 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Jul 2022 18:14:54 +0200 Subject: [PATCH 157/168] =?UTF-8?q?=E2=AC=86=20Bump=20actions/cache=20from?= =?UTF-8?q?=202=20to=203=20(#5149)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [actions/cache](https://github.com/actions/cache) from 2 to 3. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build-docs.yml | 2 +- .github/workflows/publish.yml | 2 +- .github/workflows/test.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 512d70078..a0d895911 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -18,7 +18,7 @@ jobs: uses: actions/setup-python@v4 with: python-version: "3.7" - - uses: actions/cache@v2 + - uses: actions/cache@v3 id: cache with: path: ${{ env.pythonLocation }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4686fd0d4..02846cefd 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -18,7 +18,7 @@ jobs: uses: actions/setup-python@v4 with: python-version: "3.6" - - uses: actions/cache@v2 + - uses: actions/cache@v3 id: cache with: path: ${{ env.pythonLocation }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 763dbc44b..14dc141d9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,7 +21,7 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - uses: actions/cache@v2 + - uses: actions/cache@v3 id: cache with: path: ${{ env.pythonLocation }} From ec3b6e975c33530343bbbcacaebc6288bdb9466a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Jul 2022 18:15:08 +0200 Subject: [PATCH 158/168] =?UTF-8?q?=E2=AC=86=20Bump=20actions/upload-artif?= =?UTF-8?q?act=20from=202=20to=203=20(#5148)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index a0d895911..0d666b82a 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -36,7 +36,7 @@ jobs: run: python3.7 ./scripts/docs.py build-all - name: Zip docs run: bash ./scripts/zip-docs.sh - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: docs-zip path: ./docs.zip From 84f6a030114bccdcfd49546b12d73423b4db1782 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 14 Jul 2022 16:15:31 +0000 Subject: [PATCH 159/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 160518644..802079cd4 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* โฌ† Bump actions/cache from 2 to 3. PR [#5149](https://github.com/tiangolo/fastapi/pull/5149) by [@dependabot[bot]](https://github.com/apps/dependabot). * ๐Ÿ”ง Update sponsors badge configs. PR [#5155](https://github.com/tiangolo/fastapi/pull/5155) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ‘ฅ Update FastAPI People. PR [#5154](https://github.com/tiangolo/fastapi/pull/5154) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ”ง Update Jina sponsor badges. PR [#5151](https://github.com/tiangolo/fastapi/pull/5151) by [@tiangolo](https://github.com/tiangolo). From 49619c0180c40dfb5039874dfbd279e4fed19479 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 14 Jul 2022 16:15:55 +0000 Subject: [PATCH 160/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 802079cd4..e3265c704 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* โฌ† Bump actions/upload-artifact from 2 to 3. PR [#5148](https://github.com/tiangolo/fastapi/pull/5148) by [@dependabot[bot]](https://github.com/apps/dependabot). * โฌ† Bump actions/cache from 2 to 3. PR [#5149](https://github.com/tiangolo/fastapi/pull/5149) by [@dependabot[bot]](https://github.com/apps/dependabot). * ๐Ÿ”ง Update sponsors badge configs. PR [#5155](https://github.com/tiangolo/fastapi/pull/5155) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ‘ฅ Update FastAPI People. PR [#5154](https://github.com/tiangolo/fastapi/pull/5154) by [@tiangolo](https://github.com/tiangolo). From 71b10e58904aa1543a8761bcf4028eee155c1af9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Thu, 14 Jul 2022 19:04:20 +0200 Subject: [PATCH 161/168] =?UTF-8?q?=F0=9F=94=A7=20Update=20Dependabot=20co?= =?UTF-8?q?mmit=20message=20(#5156)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/dependabot.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 946f2358c..cd972a0ba 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,8 +5,12 @@ updates: directory: "/" schedule: interval: "daily" + commit-message: + prefix: โฌ† # Python - package-ecosystem: "pip" directory: "/" schedule: interval: "daily" + commit-message: + prefix: โฌ† From f30b6c6001186794950eca0553d0466c0b59eaa6 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 14 Jul 2022 17:05:01 +0000 Subject: [PATCH 162/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index e3265c704..4dce21b64 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐Ÿ”ง Update Dependabot commit message. PR [#5156](https://github.com/tiangolo/fastapi/pull/5156) by [@tiangolo](https://github.com/tiangolo). * โฌ† Bump actions/upload-artifact from 2 to 3. PR [#5148](https://github.com/tiangolo/fastapi/pull/5148) by [@dependabot[bot]](https://github.com/apps/dependabot). * โฌ† Bump actions/cache from 2 to 3. PR [#5149](https://github.com/tiangolo/fastapi/pull/5149) by [@dependabot[bot]](https://github.com/apps/dependabot). * ๐Ÿ”ง Update sponsors badge configs. PR [#5155](https://github.com/tiangolo/fastapi/pull/5155) by [@tiangolo](https://github.com/tiangolo). From 9197cbd36cc2a275ecffb231ade6200dbea62326 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Thu, 14 Jul 2022 19:14:53 +0200 Subject: [PATCH 163/168] =?UTF-8?q?=F0=9F=94=A7=20Update=20translations=20?= =?UTF-8?q?notification=20for=20Hebrew=20(#5158)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/actions/notify-translations/app/translations.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/notify-translations/app/translations.yml b/.github/actions/notify-translations/app/translations.yml index a68167ff8..ac15978a9 100644 --- a/.github/actions/notify-translations/app/translations.yml +++ b/.github/actions/notify-translations/app/translations.yml @@ -16,3 +16,4 @@ az: 3994 nl: 4701 uz: 4883 sv: 5146 +he: 5157 From ee182c6a0ad86083a2855321a51690cf597efd7b Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 14 Jul 2022 17:15:39 +0000 Subject: [PATCH 164/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 4dce21b64..714696529 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐Ÿ”ง Update translations notification for Hebrew. PR [#5158](https://github.com/tiangolo/fastapi/pull/5158) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ”ง Update Dependabot commit message. PR [#5156](https://github.com/tiangolo/fastapi/pull/5156) by [@tiangolo](https://github.com/tiangolo). * โฌ† Bump actions/upload-artifact from 2 to 3. PR [#5148](https://github.com/tiangolo/fastapi/pull/5148) by [@dependabot[bot]](https://github.com/apps/dependabot). * โฌ† Bump actions/cache from 2 to 3. PR [#5149](https://github.com/tiangolo/fastapi/pull/5149) by [@dependabot[bot]](https://github.com/apps/dependabot). From 59d154fa6f7b7345c4a8e2650954f1cc67230974 Mon Sep 17 00:00:00 2001 From: Itay Raveh <83612679+itay-raveh@users.noreply.github.com> Date: Thu, 14 Jul 2022 17:16:28 +0000 Subject: [PATCH 165/168] =?UTF-8?q?=F0=9F=8C=90=20Start=20of=20Hebrew=20tr?= =?UTF-8?q?anslation=20(#5050)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastiรกn Ramรญrez --- docs/az/mkdocs.yml | 3 + docs/de/mkdocs.yml | 3 + docs/en/mkdocs.yml | 3 + docs/es/mkdocs.yml | 3 + docs/fa/mkdocs.yml | 3 + docs/fr/mkdocs.yml | 3 + docs/he/docs/index.md | 464 +++++++++++++++++++++++++++++++++++ docs/he/mkdocs.yml | 140 +++++++++++ docs/he/overrides/.gitignore | 0 docs/id/mkdocs.yml | 3 + docs/it/mkdocs.yml | 3 + docs/ja/mkdocs.yml | 3 + docs/ko/mkdocs.yml | 3 + docs/nl/mkdocs.yml | 3 + docs/pl/mkdocs.yml | 3 + docs/pt/mkdocs.yml | 3 + docs/ru/mkdocs.yml | 3 + docs/sq/mkdocs.yml | 3 + docs/tr/mkdocs.yml | 3 + docs/uk/mkdocs.yml | 3 + docs/zh/mkdocs.yml | 3 + 21 files changed, 658 insertions(+) create mode 100644 docs/he/docs/index.md create mode 100644 docs/he/mkdocs.yml create mode 100644 docs/he/overrides/.gitignore diff --git a/docs/az/mkdocs.yml b/docs/az/mkdocs.yml index 7ebf94384..90ee0bb82 100644 --- a/docs/az/mkdocs.yml +++ b/docs/az/mkdocs.yml @@ -44,6 +44,7 @@ nav: - es: /es/ - fa: /fa/ - fr: /fr/ + - he: /he/ - id: /id/ - it: /it/ - ja: /ja/ @@ -106,6 +107,8 @@ extra: name: fa - link: /fr/ name: fr - franรงais + - link: /he/ + name: he - link: /id/ name: id - link: /it/ diff --git a/docs/de/mkdocs.yml b/docs/de/mkdocs.yml index c617e55af..6009dd2fe 100644 --- a/docs/de/mkdocs.yml +++ b/docs/de/mkdocs.yml @@ -44,6 +44,7 @@ nav: - es: /es/ - fa: /fa/ - fr: /fr/ + - he: /he/ - id: /id/ - it: /it/ - ja: /ja/ @@ -107,6 +108,8 @@ extra: name: fa - link: /fr/ name: fr - franรงais + - link: /he/ + name: he - link: /id/ name: id - link: /it/ diff --git a/docs/en/mkdocs.yml b/docs/en/mkdocs.yml index 04639200d..7adfae0f9 100644 --- a/docs/en/mkdocs.yml +++ b/docs/en/mkdocs.yml @@ -44,6 +44,7 @@ nav: - es: /es/ - fa: /fa/ - fr: /fr/ + - he: /he/ - id: /id/ - it: /it/ - ja: /ja/ @@ -213,6 +214,8 @@ extra: name: fa - link: /fr/ name: fr - franรงais + - link: /he/ + name: he - link: /id/ name: id - link: /it/ diff --git a/docs/es/mkdocs.yml b/docs/es/mkdocs.yml index cd1c04ed3..511ea0255 100644 --- a/docs/es/mkdocs.yml +++ b/docs/es/mkdocs.yml @@ -44,6 +44,7 @@ nav: - es: /es/ - fa: /fa/ - fr: /fr/ + - he: /he/ - id: /id/ - it: /it/ - ja: /ja/ @@ -116,6 +117,8 @@ extra: name: fa - link: /fr/ name: fr - franรงais + - link: /he/ + name: he - link: /id/ name: id - link: /it/ diff --git a/docs/fa/mkdocs.yml b/docs/fa/mkdocs.yml index 79975288a..7d74e0407 100644 --- a/docs/fa/mkdocs.yml +++ b/docs/fa/mkdocs.yml @@ -44,6 +44,7 @@ nav: - es: /es/ - fa: /fa/ - fr: /fr/ + - he: /he/ - id: /id/ - it: /it/ - ja: /ja/ @@ -106,6 +107,8 @@ extra: name: fa - link: /fr/ name: fr - franรงais + - link: /he/ + name: he - link: /id/ name: id - link: /it/ diff --git a/docs/fr/mkdocs.yml b/docs/fr/mkdocs.yml index 69a323cec..f790c0299 100644 --- a/docs/fr/mkdocs.yml +++ b/docs/fr/mkdocs.yml @@ -44,6 +44,7 @@ nav: - es: /es/ - fa: /fa/ - fr: /fr/ + - he: /he/ - id: /id/ - it: /it/ - ja: /ja/ @@ -121,6 +122,8 @@ extra: name: fa - link: /fr/ name: fr - franรงais + - link: /he/ + name: he - link: /id/ name: id - link: /it/ diff --git a/docs/he/docs/index.md b/docs/he/docs/index.md new file mode 100644 index 000000000..fa63d8cb7 --- /dev/null +++ b/docs/he/docs/index.md @@ -0,0 +1,464 @@ +

+ FastAPI +

+

+ ืชืฉืชื™ืช FastAPI, ื‘ื™ืฆื•ืขื™ื ื’ื‘ื•ื”ื™ื, ืงืœื” ืœืœืžื™ื“ื”, ืžื”ื™ืจื” ืœืชื›ื ื•ืช, ืžื•ื›ื ื” ืœืกื‘ื™ื‘ืช ื™ื™ืฆื•ืจ +

+

+ + Test + + + Coverage + + + Package version + + + Supported Python versions + +

+ +--- + +**ืชื™ืขื•ื“**: https://fastapi.tiangolo.com + +**ืงื•ื“**: https://github.com/tiangolo/fastapi + +--- + +FastAPI ื”ื™ื ืชืฉืชื™ืช ืจืฉืช ืžื•ื“ืจื ื™ืช ื•ืžื”ื™ืจื” (ื‘ื™ืฆื•ืขื™ื ื’ื‘ื•ื”ื™ื) ืœื‘ื ื™ื™ืช ืžืžืฉืงื™ ืชื›ื ื•ืช ื™ื™ืฉื•ืžื™ื (API) ืขื ืคื™ื™ืชื•ืŸ 3.6+ ื‘ื”ืชื‘ืกืก ืขืœ ืจืžื–ื™ ื˜ื™ืคื•ืกื™ื ืกื˜ื ื“ืจื˜ื™ื™ื. + +ืชื›ื•ื ื•ืช ื”ืžืคืชื— ื”ืŸ: + +- **ืžื”ื™ืจื”**: ื‘ื™ืฆื•ืขื™ื ื’ื‘ื•ื”ื™ื ืžืื•ื“, ื‘ืงื ื” ืื—ื“ ืขื NodeJS ื• - Go (ืชื•ื“ื•ืช ืœ - Starlette ื• - Pydantic). [ืื—ืช ืžืชืฉืชื™ื•ืช ื”ืคื™ื™ืชื•ืŸ ื”ืžื”ื™ืจื•ืช ื‘ื™ื•ืชืจ](#performance). + +- **ืžื”ื™ืจื” ืœืชื›ื ื•ืช**: ื”ื’ื‘ื™ืจื• ืืช ืžื”ื™ืจื•ืช ืคื™ืชื•ื— ื”ืชื›ื•ื ื•ืช ื”ื—ื“ืฉื•ืช ื‘ื› - %200 ืขื“ %300. \* +- **ืคื—ื•ืช ืฉื’ื™ืื•ืช**: ืžื ืขื• ื› - %40 ืžืฉื’ื™ืื•ืช ืื ื•ืฉ (ืžืคืชื—ื™ื). \* +- **ืื™ื ื˜ื•ืื™ื˜ื™ื‘ื™ืช**: ืชืžื™ื›ืช ืขื•ืจืš ืžืขื•ืœื”. ื”ืฉืœืžื” ื‘ื›ืœ ืžืงื•ื. ืคื—ื•ืช ื–ืžืŸ ื ื™ืคื•ื™ ืฉื’ื™ืื•ืช. +- **ืงืœื”**: ืžืชื•ื›ื ื ืช ืœื”ื™ื•ืช ืงืœื” ืœืฉื™ืžื•ืฉ ื•ืœืœืžื™ื“ื”. ืคื—ื•ืช ื–ืžืŸ ืงืจื™ืืช ืชื™ืขื•ื“. +- **ืงืฆืจื”**: ืžื–ืขืจื• ืฉื›ืคื•ืœ ืงื•ื“. ืžืกืคืจ ืชื›ื•ื ื•ืช ืžื›ืœ ื”ื›ืจื–ืช ืคืจืžื˜ืจ. ืคื—ื•ืช ืฉื’ื™ืื•ืช. +- **ื—ืกื•ื ื”**: ืงื‘ืœื• ืงื•ื“ ืžื•ื›ืŸ ืœืกื‘ื™ื‘ืช ื™ื™ืฆื•ืจ. ืขื ืชื™ืขื•ื“ ืื™ื ื˜ืจืงื˜ื™ื‘ื™ ืื•ื˜ื•ืžื˜ื™. +- **ืžื‘ื•ืกืกืช ืกื˜ื ื“ืจื˜ื™ื**: ืžื‘ื•ืกืกืช ืขืœ (ื•ืชื•ืืžืช ืœื—ืœื•ื˜ื™ืŸ ืœ -) ื”ืกื˜ื“ื ืจื˜ื™ื ื”ืคืชื•ื—ื™ื ืœืžืžืฉืงื™ ืชื›ื ื•ืช ื™ื™ืฉื•ืžื™ื: OpenAPI (ื™ื“ื•ืขื™ื ืœืฉืขื‘ืจ ื› - Swagger) ื• - JSON Schema. + +\* ื”ืขืจื›ื” ืžื‘ื•ืกืกืช ืขืœ ื‘ื“ื™ืงื•ืช ืฉืœ ืฆื•ื•ืช ืคื™ืชื•ื— ืคื ื™ืžื™ ืฉื‘ื•ื ื” ืืคืœื™ืงืฆื™ื•ืช ื‘ืกื‘ื™ื‘ืช ื™ื™ืฆื•ืจ. + +## ื ื•ืชื ื™ ื—ืกื•ืช + + + +{% if sponsors %} +{% for sponsor in sponsors.gold -%} + +{% endfor -%} +{%- for sponsor in sponsors.silver -%} + +{% endfor %} +{% endif %} + + + +ื ื•ืชื ื™ ื—ืกื•ืช ืื—ืจื™ื + +## ื“ืขื•ืช + +"_[...] I'm using **FastAPI** a ton these days. [...] I'm actually planning to use it for all of my team's **ML services at Microsoft**. Some of them are getting integrated into the core **Windows** product and some **Office** products._" + +
Kabir Khan - Microsoft (ref)
+ +--- + +"_We adopted the **FastAPI** library to spawn a **REST** server that can be queried to obtain **predictions**. [for Ludwig]_" + +
Piero Molino, Yaroslav Dudin, and Sai Sumanth Miryala - Uber (ref)
+ +--- + +"_**Netflix** is pleased to announce the open-source release of our **crisis management** orchestration framework: **Dispatch**! [built with **FastAPI**]_" + +
Kevin Glisson, Marc Vilanova, Forest Monsen - Netflix (ref)
+ +--- + +"_Iโ€™m over the moon excited about **FastAPI**. Itโ€™s so fun!_" + +
Brian Okken - Python Bytes podcast host (ref)
+ +--- + +"_Honestly, what you've built looks super solid and polished. In many ways, it's what I wanted **Hug** to be - it's really inspiring to see someone build that._" + +
Timothy Crosley - Hug creator (ref)
+ +--- + +"_If you're looking to learn one **modern framework** for building REST APIs, check out **FastAPI** [...] It's fast, easy to use and easy to learn [...]_" + +"_We've switched over to **FastAPI** for our **APIs** [...] I think you'll like it [...]_" + +
Ines Montani - Matthew Honnibal - Explosion AI founders - spaCy creators (ref) - (ref)
+ +--- + +## **Typer**, ื” - FastAPI ืฉืœ ืžืžืฉืงื™ ืฉื•ืจืช ืคืงื•ื“ื” (CLI). + + + +ืื ืืชื ื‘ื•ื ื™ื ืืคืœื™ืงืฆื™ื™ืช CLI ืœืฉื™ืžื•ืฉ ื‘ืžืกื•ืฃ ื‘ืžืงื•ื ืžืžืฉืง ืจืฉืช, ื”ืขื™ืคื• ืžื‘ื˜ ืขืœ **Typer**. + +**Typer** ื”ื™ื ืื—ื•ืชื” ื”ืงื˜ื ื” ืฉืœ FastAPI. ื•ืžื˜ืจืชื” ื”ื™ื ืœื”ื™ื•ืช ื” - **FastAPI ืฉืœ ืžืžืฉืงื™ ืฉื•ืจืช ืคืงื•ื“ื”**. โŒจ๏ธ ๐Ÿš€ + +## ืชืœื•ื™ื•ืช + +ืคื™ื™ืชื•ืŸ 3.6+ + +FastAPI ืขื•ืžื“ืช ืขืœ ื›ืชืคื™ ืขื ืงื™ื•ืช: + +- Starlette ืœื—ืœืงื™ ื”ืจืฉืช. +- Pydantic ืœื—ืœืงื™ ื”ืžื™ื“ืข. + +## ื”ืชืงื ื” + +
+ +```console +$ pip install fastapi + +---> 100% +``` + +
+ +ืชืฆื˜ืจื›ื• ื’ื ืฉืจืช ASGI ื›ื’ื•ืŸ Uvicorn ืื• Hypercorn. + +
+ +```console +$ pip install "uvicorn[standard]" + +---> 100% +``` + +
+ +## ื“ื•ื’ืžื + +### ืฆืจื• ืื•ืชื” + +- ืฆืจื• ืงื•ื‘ืฅ ื‘ืฉื `main.py` ืขื: + +```Python +from typing import Union + +from fastapi import FastAPI + +app = FastAPI() + + +@app.get("/") +def read_root(): + return {"Hello": "World"} + + +@app.get("/items/{item_id}") +def read_item(item_id: int, q: Union[str, None] = None): + return {"item_id": item_id, "q": q} +``` + +
+ืื• ื”ืฉืชืžืฉื• ื‘ - async def... + +ืื ื”ืงื•ื“ ืฉืœื›ื ืžืฉืชืžืฉ ื‘ - `async` / `await`, ื”ืฉืชืžืฉื• ื‘ - `async def`: + +```Python hl_lines="9 14" +from typing import Union + +from fastapi import FastAPI + +app = FastAPI() + + +@app.get("/") +async def read_root(): + return {"Hello": "World"} + + +@app.get("/items/{item_id}") +async def read_item(item_id: int, q: Union[str, None] = None): + return {"item_id": item_id, "q": q} +``` + +**ืฉื™ืžื• ืœื‘**: + +ืื ืื™ื ื›ื ื™ื•ื“ืขื™ื, ื‘ื“ืงื• ืืช ืคืจืง "ืžืžื”ืจื™ื?" ืขืœ `async` ื• - `await` ื‘ืชื™ืขื•ื“. + +
+ +### ื”ืจื™ืฆื• ืื•ืชื” + +ื”ืชื—ื™ืœื• ืืช ื”ืฉืจืช ืขื: + +
+ +```console +$ uvicorn main:app --reload + +INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit) +INFO: Started reloader process [28720] +INFO: Started server process [28722] +INFO: Waiting for application startup. +INFO: Application startup complete. +``` + +
+ +
+ืขืœ ื”ืคืงื•ื“ื” uvicorn main:app --reload... + +ื”ืคืงื•ื“ื” `uvicorn main:app` ืžืชื™ื™ื—ืกืช ืœ: + +- `main`: ื”ืงื•ื‘ืฅ `main.py` (ืžื•ื“ื•ืœ ืคื™ื™ืชื•ืŸ). +- `app`: ื”ืื•ื‘ื™ื™ืงื˜ ืฉื ื•ืฆืจ ื‘ืชื•ืš `main.py` ืขื ื”ืฉื•ืจื” app = FastAPI(). +- --reload: ื’ืจืžื• ืœืฉืจืช ืœื”ืชืืชื—ืœ ืœืื—ืจ ืฉื™ื ื•ื™ื™ื ื‘ืงื•ื“. ืขืฉื• ื–ืืช ืจืง ื‘ืกื‘ื™ื‘ืช ืคื™ืชื•ื—. + +
+ +### ื‘ื“ืงื• ืื•ืชื” + +ืคืชื—ื• ืืช ื”ื“ืคื“ืคืŸ ืฉืœื›ื ื‘ื›ืชื•ื‘ืช http://127.0.0.1:8000/items/5?q=somequery. + +ืืชื ืชืจืื• ืชื’ื•ื‘ืช JSON: + +```JSON +{"item_id": 5, "q": "somequery"} +``` + +ื›ื‘ืจ ื™ืฆืจืชื API ืฉ: + +- ืžืงื‘ืœ ื‘ืงืฉื•ืช HTTP ื‘ื ืชื™ื‘ื™ื `/` ื• - /items/{item_id}. +- ืฉื ื™ ื” _ื ืชื™ื‘ื™ื_ ืžืงื‘ืœื™ื _ื‘ืงืฉื•ืช_ `GET` (ื™ื“ื•ืขื•ืช ื’ื ื›*ืžืชื•ื“ื•ืช* HTTP). +- ื” _ื ืชื™ื‘_ /items/{item_id} ื›ื•ืœืœ \*ืคืจืžื˜ืจ ื ืชื™ื‘\_ `item_id` ืฉืืžื•ืจ ืœื”ื™ื•ืช `int`. +- ื” _ื ืชื™ื‘_ /items/{item_id} \*ืคืจืžื˜ืจ ืฉืื™ืœืชื\_ ืื•ืคืฆื™ื•ื ืœื™ `q`. + +### ืชื™ืขื•ื“ API ืื™ื ื˜ืจืงื˜ื™ื‘ื™ + +ื›ืขืช ืคื ื• ืœื›ืชื•ื‘ืช http://127.0.0.1:8000/docs. + +ืืชื ืชืจืื• ืืช ื”ืชื™ืขื•ื“ ื”ืื•ื˜ื•ืžื˜ื™ (ืžืกื•ืคืง ืขืœ ื™ื“ื™ Swagger UI): + +![Swagger UI](https://fastapi.tiangolo.com/img/index/index-01-swagger-ui-simple.png) + +### ืชื™ืขื•ื“ ืืœื˜ืจื ื˜ื™ื‘ื™ + +ื›ืขืช ืคื ื• ืœื›ืชื•ื‘ืช http://127.0.0.1:8000/redoc. + +ืืชื ืชืจืื• ืชื™ืขื•ื“ ืืœื˜ืจื ื˜ื™ื‘ื™ (ืžืกื•ืคืง ืขืœ ื™ื“ื™ ReDoc): + +![ReDoc](https://fastapi.tiangolo.com/img/index/index-02-redoc-simple.png) + +## ืฉื“ืจื•ื’ ืœื“ื•ื’ืžื + +ื›ืขืช ืขืจื›ื• ืืช ื”ืงื•ื‘ืฅ `main.py` ื›ืš ืฉื™ื•ื›ืœ ืœืงื‘ืœ ื’ื•ืฃ ืžื‘ืงืฉืช `PUT`. + +ื”ื’ื“ื™ืจื• ืืช ื”ื’ื•ืฃ ื‘ืขื–ืจืช ืจืžื–ื™ ื˜ื™ืคื•ืกื™ื ืกื˜ื ื“ืจื˜ื™ื™ื, ื”ื•ื“ื•ืช ืœ - `Pydantic`. + +```Python hl_lines="4 9-12 25-27" +from typing import Union + +from fastapi import FastAPI +from pydantic import BaseModel + +app = FastAPI() + + +class Item(BaseModel): + name: str + price: float + is_offer: Union[bool, None] = None + + +@app.get("/") +def read_root(): + return {"Hello": "World"} + + +@app.get("/items/{item_id}") +def read_item(item_id: int, q: Union[str, None] = None): + return {"item_id": item_id, "q": q} + + +@app.put("/items/{item_id}") +def update_item(item_id: int, item: Item): + return {"item_name": item.name, "item_id": item_id} +``` + +ื”ืฉืจืช ืืžื•ืœ ืœื”ืชืืชื—ืœ ืื•ื˜ื•ืžื˜ื™ืช (ืžืื—ืจ ื•ื”ื•ืกืคืชื --reload ืœืคืงื•ื“ืช `uvicorn` ืฉืœืžืขืœื”). + +### ืฉื“ืจื•ื’ ื”ืชื™ืขื•ื“ ื”ืื™ื ื˜ืจืงื˜ื™ื‘ื™ + +ื›ืขืช ืคื ื• ืœื›ืชื•ื‘ืช http://127.0.0.1:8000/docs. + +- ื”ืชื™ืขื•ื“ ื”ืื•ื˜ื•ืžื˜ื™ ื™ืชืขื“ื›ืŸ, ื›ื•ืœืœ ื”ื’ื•ืฃ ื”ื—ื“ืฉ: + +![Swagger UI](https://fastapi.tiangolo.com/img/index/index-03-swagger-02.png) + +- ืœื—ืฆื• ืขืœ ื”ื›ืคืชื•ืจ "Try it out", ื”ื•ื ื™ืืคืฉืจ ืœื›ื ืœืžืœื ืืช ื”ืคืจืžื˜ืจื™ื ื•ืœืขื‘ื•ื“ ื™ืฉื™ืจื•ืช ืžื•ืœ ื” - API. + +![Swagger UI interaction](https://fastapi.tiangolo.com/img/index/index-04-swagger-03.png) + +- ืื—ืจ ื›ืš ืœื—ืฆื• ืขืœ ื”ื›ืคืชื•ืจ "Execute", ื”ืืชืจ ื™ืชืงืฉืจ ืขื ื” - API ืฉืœื›ื, ื™ืฉืœื— ืืช ื”ืคืจืžื˜ืจื™ื, ื™ืฉื™ื’ ืืช ื”ืชื•ืฆืื•ืช ื•ืื– ื™ืจืื” ืื•ืชืŸ ืขืœ ื”ืžืกืš: + +![Swagger UI interaction](https://fastapi.tiangolo.com/img/index/index-05-swagger-04.png) + +### ืฉื“ืจื•ื’ ื”ืชื™ืขื•ื“ ื”ืืœื˜ืจื ื˜ื™ื‘ื™ + +ื›ืขืช ืคื ื• ืœื›ืชื•ื‘ืช http://127.0.0.1:8000/redoc. + +- ื”ืชื™ืขื•ื“ ื”ืืœื˜ืจื ื˜ื™ื‘ื™ ื’ื ื™ืจืื” ืืช ืคืจืžื˜ืจ ื”ืฉืื™ืœืชื ื•ื”ื’ื•ืฃ ื”ื—ื“ืฉื™ื. + +![ReDoc](https://fastapi.tiangolo.com/img/index/index-06-redoc-02.png) + +### ืกื™ื›ื•ื + +ืœืกื™ื›ื•ื, ืืชื ืžื›ืจื™ื–ื™ื ** ืคืขื ืื—ืช** ืขืœ ื˜ื™ืคื•ืกื™ ื”ืคืจืžื˜ืจื™ื, ื’ื•ืฃ ื•ื›ื•' ื›ืคืจืžื˜ืจื™ื ืœืคื•ื ืงืฆื™ื”. + +ืืชื ืขื•ืฉื™ื ืืช ื–ื” ืขื ื˜ื™ืคื•ืกื™ ืคื™ื™ืชื•ืŸ ืžื•ื“ืจื ื™ื™ื. + +ืืชื ืœื ืฆืจื™ื›ื™ื ืœืœืžื•ื“ ืชื—ื‘ื™ืจ ื—ื“ืฉ, ืžืชื•ื“ื•ืช ืื• ืžื—ืœืงื•ืช ืฉืœ ืกืคืจื™ื™ื” ืกืคื™ืฆื™ืคื™ืช, ื•ื›ื•' + +ืจืง **ืคื™ื™ืชื•ืŸ 3.6+** ืกื˜ื ื“ืจื˜ื™. + +ืœื“ื•ื’ืžื, ืœ - `int`: + +```Python +item_id: int +``` + +ืื• ืœืžื•ื“ืœ `Item` ืžื•ืจื›ื‘ ื™ื•ืชืจ: + +```Python +item: Item +``` + +...ื•ืขื ื”ื›ืจื–ืช ื”ื˜ื™ืคื•ืก ื”ืื—ืช ื”ื–ื• ืืชื ืžืงื‘ืœื™ื: + +- ืชืžื™ื›ืช ืขื•ืจืš, ื›ื•ืœืœ: + - ื”ืฉืœืžื•ืช. + - ื‘ื“ื™ืงืช ื˜ื™ืคื•ืกื™ื. +- ืื™ืžื•ืช ืžื™ื“ืข: + - ืฉื’ื™ืื•ืช ื‘ืจื•ืจื•ืช ื•ืื˜ื•ืžื˜ื™ื•ืช ื›ืืฉืจ ืžื•ื›ื ืก ืžื™ื“ืข ืœื ื—ื•ืงื™ . + - ืื™ืžื•ืช ืืคื™ืœื• ืœืื•ื‘ื™ื™ืงื˜ื™ JSON ืžืงื•ื ื ื™ื. +- ื”ืžืจื” ืฉืœ ืžื™ื“ืข ืงืœื˜: ื”ืžืจื” ืฉืœ ืžื™ื“ืข ืฉืžื’ื™ืข ืžื”ืจืฉืช ืœืžื™ื“ืข ื•ื˜ื™ืคื•ืกื™ื ืฉืœ ืคื™ื™ืชื•ืŸ. ืงื•ืจื ืž: + - JSON. + - ืคืจืžื˜ืจื™ ื ืชื™ื‘. + - ืคืจืžื˜ืจื™ ืฉืื™ืœืชื. + - ืขื•ื’ื™ื•ืช. + - ื›ื•ืชืจื•ืช. + - ื˜ืคืกื™ื. + - ืงื‘ืฆื™ื. +- ื”ืžืจื” ืฉืœ ืžื™ื“ืข ืคืœื˜: ื”ืžืจื” ืฉืœ ืžื™ื“ืข ื•ื˜ื™ืคื•ืกื™ื ืžืคื™ื™ืชื•ืŸ ืœืžื™ื“ืข ืจืฉืช (ื› - JSON): + - ื”ืžื™ืจื• ื˜ื™ืคื•ืกื™ ืคื™ื™ืชื•ืŸ (`str`, `int`, `float`, `bool`, `list`, etc). + - ืขืฆืžื™ `datetime`. + - ืขืฆืžื™ `UUID`. + - ืžื•ื“ืœื™ ื‘ืกื™ืกื™ ื ืชื•ื ื™ื. + - ...ื•ืจื‘ื™ื ืื—ืจื™ื. +- ืชื™ืขื•ื“ API ืื•ื˜ื•ืžื˜ื™ ื•ืื™ื ื˜ืจืงื˜ื™ื‘ื™ืช ื›ื•ืœืœ ืฉืชื™ ืืœื˜ืจื ื˜ื™ื‘ื•ืช ืœืžืžืฉืง ื”ืžืฉืชืžืฉ: + - Swagger UI. + - ReDoc. + +--- + +ื‘ื—ื–ืจื” ืœื“ื•ื’ืžืืช ื”ืงื•ื“ ื”ืงื•ื“ืžืช, **FastAPI** ื™ื“ืื’: + +- ืœืืžืช ืฉื™ืฉ `item_id` ื‘ื ืชื™ื‘ ื‘ื‘ืงืฉื•ืช `GET` ื• - `PUT`. +- ืœืืžืช ืฉื” - `item_id` ื”ื•ื ืžื˜ื™ืคื•ืก `int` ื‘ื‘ืงืฉื•ืช `GET` ื• - `PUT`. + - ืื ื”ื•ื ืœื, ื”ืœืงื•ื— ื™ืจืื” ืฉื’ื™ืื” ื‘ืจื•ืจื” ื•ืฉื™ืžื•ืฉื™ืช. +- ืœื‘ื“ื•ืง ื”ืื ืงื™ื™ื ืคืจืžื˜ืจ ืฉืื™ืœืชื ื‘ืฉื `q` (ืงืจื™ `http://127.0.0.1:8000/items/foo?q=somequery`) ืœื‘ืงืฉื•ืช `GET`. + - ืžืื—ืจ ื•ื”ืคืจืžื˜ืจ `q` ืžื•ื’ื“ืจ ืขื = None, ื”ื•ื ืื•ืคืฆื™ื•ื ืœื™. + - ืœื•ืœื ื” - `None` ื”ื•ื ื”ื™ื” ื—ื•ื‘ื” (ื›ืžื• ื”ื’ื•ืฃ ื‘ืžืงืจื” ืฉืœ `PUT`). +- ืœื‘ืงืฉื•ืช `PUT` ืœื ืชื™ื‘ /items/{item_id}, ืœืงืจื•ื ืืช ื’ื•ืฃ ื”ื‘ืงืฉื” ื› - JSON: + - ืœืืžืช ืฉื”ื•ื ื›ื•ืœืœ ืืช ืžืืคื™ื™ืŸ ื”ื—ื•ื‘ื” `name` ืฉืืžื•ืจ ืœื”ื™ื•ืช ืžื˜ื™ืคื•ืก `str`. + - ืœืืžืช ืฉื”ื•ื ื›ื•ืœืœ ืืช ืžืืคื™ื™ืŸ ื”ื—ื•ื‘ื” `price` ืฉื—ื™ื™ื‘ ืœื”ื™ื•ืช ืžื˜ื™ืคื•ืก `float`. + - ืœื‘ื“ื•ืง ื”ืื ื”ื•ื ื›ื•ืœืœ ืืช ืžืืคื™ื™ืŸ ื”ืจืฉื•ืช `is_offer` ืฉืืžื•ืจ ืœื”ื™ื•ืช ืžื˜ื™ืคื•ืก `bool`, ืื ื”ื•ื ื ืžืฆื. + - ื›ืœ ื–ื” ื™ืขื‘ื•ื“ ื’ื ืœืื•ื‘ื™ื™ืงื˜ JSON ืžืงื•ื ืŸ. +- ืœื”ืžื™ืจ ืž - JSON ื•ืœ- JSON ืื•ื˜ื•ืžื˜ื™ืช. +- ืœืชืขื“ ื”ื›ืœ ื‘ืืžืฆืขื•ืช OpenAPI, ืชื™ืขื•ื“ ืฉื‘ื• ื™ื•ื›ืœื• ืœื”ืฉืชืžืฉ: + - ืžืขืจื›ื•ืช ืชื™ืขื•ื“ ืื™ื ื˜ืจืงื˜ื™ื‘ื™ื•ืช. + - ืžืขืจื›ื•ืช ื™ื™ืฆื•ืจ ืงื•ื“ ืื•ื˜ื•ืžื˜ื™ื•ืช, ืœื”ืจื‘ื” ืฉืคื•ืช. +- ืœืกืคืง ื™ืฉื™ืจื•ืช ืฉืชื™ ืžืขืจื›ื•ืช ืชื™ืขื•ื“ ืจืฉืชื™ื•ืช. + +--- + +ืจืง ื’ืจื“ื ื• ืืช ืงืฆื” ื”ืงืจื—ื•ืŸ, ืื‘ืœ ื›ื‘ืจ ื™ืฉ ืœื›ื ืจืขื™ื•ืŸ ืฉืœ ืื™ืš ื”ื›ืœ ืขื•ื‘ื“. + +ื ืกื• ืœืฉื ื•ืช ืืช ื”ืฉื•ืจื”: + +```Python + return {"item_name": item.name, "item_id": item_id} +``` + +...ืž: + +```Python + ... "item_name": item.name ... +``` + +...ืœ: + +```Python + ... "item_price": item.price ... +``` + +...ื•ืจืื• ืื™ืš ื”ืขื•ืจืš ืฉืœื›ื ืžืฉืœื™ื ืืช ื”ืžืืคื™ื™ื ื™ื ื•ื™ื•ื“ืข ืืช ื”ื˜ื™ืคื•ืกื™ื ืฉืœื”ื: + +![editor support](https://fastapi.tiangolo.com/img/vscode-completion.png) + +ืœื“ื•ื’ืžื ื™ื•ืชืจ ืฉืœืžื” ืฉื›ื•ืœืœืช ืขื•ื“ ืชื›ื•ื ื•ืช, ืจืื• ืืช ื”ืžื“ืจื™ืš - ืœืžืฉืชืžืฉ. + +**ื”ืชืจืืช ืกืคื•ื™ืœืจื™ื**: ื”ืžื“ืจื™ืš - ืœืžืฉืชืžืฉ ื›ื•ืœืœ: + +- ื”ื›ืจื–ื” ืขืœ **ืคืจืžื˜ืจื™ื** ืžืžืงื•ืจื•ืช ืื—ืจื™ื ื•ืฉื•ื ื™ื ื›ื’ื•ืŸ: **ื›ื•ืชืจื•ืช**, **ืขื•ื’ื™ื•ืช**, **ื˜ืคืกื™ื** ื• - **ืงื‘ืฆื™ื**. +- ืื™ืš ืœืงื‘ื•ืข **ืžื’ื‘ืœื•ืช ืื™ืžื•ืช** ื‘ืขื–ืจืช `maximum_length` ืื• `regex`. +- ื“ืจืš ื—ื–ืงื” ื•ืงืœื” ืœื”ืฉืชืžืฉ ื‘**ื”ื–ืจืงืช ืชืœื•ื™ื•ืช**. +- ืื‘ื˜ื—ื” ื•ื”ืชืืžืชื•ืช, ื›ื•ืœืœ ืชืžื™ื›ื” ื‘ - **OAuth2** ืขื **JWT** ื•ื”ืชืืžืชื•ืช **HTTP Basic**. +- ื˜ื›ื ื™ืงื•ืช ืžืชืงื“ืžื•ืช (ืื‘ืœ ืงืœื•ืช ื‘ืื•ืชื” ืžื™ื“ื”) ืœื”ื›ืจื–ืช ืื•ื‘ื™ื™ืงื˜ื™ JSON ืžืงื•ื ื ื™ื (ืชื•ื“ื•ืช ืœ - Pydantic). +- ืื™ื ื˜ืจืงืฆื™ื” ืขื **GraphQL** ื“ืจืš Strawberry ื•ืกืคืจื™ื•ืช ืื—ืจื•ืช. +- ืชื›ื•ื ื•ืช ื ื•ืกืคื•ืช ืจื‘ื•ืช (ืชื•ื“ื•ืช ืœ - Starlette) ื›ื’ื•ืŸ: + - **WebSockets** + - ื‘ื“ื™ืงื•ืช ืงืœื•ืช ื‘ืžื™ื•ื—ื“ ืžื‘ื•ืกืกื•ืช ืขืœ `requests` ื• - `pytest` + - **CORS** + - **Cookie Sessions** + - ...ื•ืขื•ื“. + +## ื‘ื™ืฆื•ืขื™ื + +ื‘ื“ื™ืงื•ืช ืขืฆืžืื™ื•ืช ืฉืœ TechEmpower ื”ืจืื• ืฉืืคืœื™ืงืฆื™ื•ืช **FastAPI** ืฉืจืฆื•ืช ืชื—ืช Uvicorn ื”ืŸ ืžืชืฉืชื™ื•ืช ื”ืคื™ื™ืชื•ืŸ ื”ืžื”ื™ืจื•ืช ื‘ื™ื•ืชืจ, ืจืง ืžืชื—ืช ืœ - Starlette ื• - Uvicorn ืขืฆืžืŸ (ืฉ - FastAPI ืžื‘ื•ืกืกืช ืขืœื™ื”ืŸ). (\*) + +ื›ื“ื™ ืœื”ื‘ื™ืŸ ืขื•ื“ ืขืœ ื”ื ื•ืฉื, ืจืื• ืืช ื”ืคืจืง Benchmarks. + +## ืชืœื•ื™ื•ืช ืื•ืคืฆื™ื•ื ืœื™ื•ืช + +ื‘ืฉื™ืžื•ืฉ Pydantic: + +- ujson - "ืคืจืกื•ืจ" JSON. +- email_validator - ืœืื™ืžื•ืช ื›ืชื•ื‘ื•ืช ืื™ืžื™ื™ืœ. + +ื‘ืฉื™ืžื•ืฉ Starlette: + +- requests - ื“ืจื•ืฉ ืื ื‘ืจืฆื•ื ื›ื ืœื”ืฉืชืžืฉ ื‘ - `TestClient`. +- jinja2 - ื“ืจื•ืฉ ืื ื‘ืจืฆื•ื ื›ื ืœื”ืฉืชืžืฉ ื‘ื‘ืจื™ืจืช ื”ืžื—ื“ืœ ืฉืœ ืชืฆื•ืจืช ื”ื˜ืžืคืœื™ื™ื˜ื™ื. +- python-multipart - ื“ืจื•ืฉ ืื ื‘ืจืฆื•ื ื›ื ืœืชืžื•ืš ื‘ "ืคืจืกื•ืจ" ื˜ืคืกื™ื, ื‘ืืฆืžืขื•ืช request.form(). +- itsdangerous - ื“ืจื•ืฉ ืื ื‘ืจืฆื•ื ื›ื ืœื”ืฉืชืžืฉ ื‘ - `SessionMiddleware`. +- pyyaml - ื“ืจื•ืฉ ืื ื‘ืจืฆื•ื ื›ื ืœื”ืฉืชืžืฉ ื‘ - `SchemaGenerator` ืฉืœ Starlette (ื›ื ืจืื” ืฉืืชื ืœื ืฆืจื™ื›ื™ื ืืช ื–ื” ืขื FastAPI). +- ujson - ื“ืจื•ืฉ ืื ื‘ืจืฆื•ื ื›ื ืœื”ืฉืชืžืฉ ื‘ - `UJSONResponse`. + +ื‘ืฉื™ืžื•ืฉ FastAPI / Starlette: + +- uvicorn - ืœืฉืจืช ืฉื˜ื•ืขืŸ ื•ืžื’ื™ืฉ ืืช ื”ืืคืœื™ืงืฆื™ื” ืฉืœื›ื. +- orjson - ื“ืจื•ืฉ ืื ื‘ืจืฆื•ื ื›ื ืœื”ืฉืชืžืฉ ื‘ - `ORJSONResponse`. + +ืชื•ื›ืœื• ืœื”ืชืงื™ืŸ ืืช ื›ืœ ืืœื• ื‘ืืžืฆืขื•ืช pip install "fastapi[all]". + +## ืจืฉื™ื•ืŸ + +ื”ืคืจื•ื™ืงื˜ ื”ื–ื” ื”ื•ื ืชื—ืช ื”ืชื ืื™ื ืฉืœ ืจืฉื™ื•ืŸ MIT. diff --git a/docs/he/mkdocs.yml b/docs/he/mkdocs.yml new file mode 100644 index 000000000..34a3b0e6a --- /dev/null +++ b/docs/he/mkdocs.yml @@ -0,0 +1,140 @@ +site_name: FastAPI +site_description: FastAPI framework, high performance, easy to learn, fast to code, ready for production +site_url: https://fastapi.tiangolo.com/he/ +theme: + name: material + custom_dir: overrides + palette: + - media: '(prefers-color-scheme: light)' + scheme: default + primary: teal + accent: amber + toggle: + icon: material/lightbulb + name: Switch to light mode + - media: '(prefers-color-scheme: dark)' + scheme: slate + primary: teal + accent: amber + toggle: + icon: material/lightbulb-outline + name: Switch to dark mode + features: + - search.suggest + - search.highlight + - content.tabs.link + icon: + repo: fontawesome/brands/github-alt + logo: https://fastapi.tiangolo.com/img/icon-white.svg + favicon: https://fastapi.tiangolo.com/img/favicon.png + language: he +repo_name: tiangolo/fastapi +repo_url: https://github.com/tiangolo/fastapi +edit_uri: '' +plugins: +- search +- markdownextradata: + data: data +nav: +- FastAPI: index.md +- Languages: + - en: / + - az: /az/ + - de: /de/ + - es: /es/ + - fa: /fa/ + - fr: /fr/ + - he: /he/ + - id: /id/ + - it: /it/ + - ja: /ja/ + - ko: /ko/ + - nl: /nl/ + - pl: /pl/ + - pt: /pt/ + - ru: /ru/ + - sq: /sq/ + - tr: /tr/ + - uk: /uk/ + - zh: /zh/ +markdown_extensions: +- toc: + permalink: true +- markdown.extensions.codehilite: + guess_lang: false +- mdx_include: + base_path: docs +- admonition +- codehilite +- extra +- pymdownx.superfences: + custom_fences: + - name: mermaid + class: mermaid + format: !!python/name:pymdownx.superfences.fence_code_format '' +- pymdownx.tabbed: + alternate_style: true +extra: + analytics: + provider: google + property: UA-133183413-1 + social: + - icon: fontawesome/brands/github-alt + link: https://github.com/tiangolo/fastapi + - icon: fontawesome/brands/discord + link: https://discord.gg/VQjSZaeJmf + - icon: fontawesome/brands/twitter + link: https://twitter.com/fastapi + - icon: fontawesome/brands/linkedin + link: https://www.linkedin.com/in/tiangolo + - icon: fontawesome/brands/dev + link: https://dev.to/tiangolo + - icon: fontawesome/brands/medium + link: https://medium.com/@tiangolo + - icon: fontawesome/solid/globe + link: https://tiangolo.com + alternate: + - link: / + name: en - English + - link: /az/ + name: az + - link: /de/ + name: de + - link: /es/ + name: es - espaรฑol + - link: /fa/ + name: fa + - link: /fr/ + name: fr - franรงais + - link: /he/ + name: he + - link: /id/ + name: id + - link: /it/ + name: it - italiano + - link: /ja/ + name: ja - ๆ—ฅๆœฌ่ชž + - link: /ko/ + name: ko - ํ•œ๊ตญ์–ด + - link: /nl/ + name: nl + - link: /pl/ + name: pl + - link: /pt/ + name: pt - portuguรชs + - link: /ru/ + name: ru - ั€ัƒััะบะธะน ัะทั‹ะบ + - link: /sq/ + name: sq - shqip + - link: /tr/ + name: tr - Tรผrkรงe + - link: /uk/ + name: uk - ัƒะบั€ะฐั—ะฝััŒะบะฐ ะผะพะฒะฐ + - link: /zh/ + name: zh - ๆฑ‰่ฏญ +extra_css: +- https://fastapi.tiangolo.com/css/termynal.css +- https://fastapi.tiangolo.com/css/custom.css +extra_javascript: +- https://fastapi.tiangolo.com/js/termynal.js +- https://fastapi.tiangolo.com/js/custom.js diff --git a/docs/he/overrides/.gitignore b/docs/he/overrides/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/docs/id/mkdocs.yml b/docs/id/mkdocs.yml index 6c9f88c90..697ecd4cb 100644 --- a/docs/id/mkdocs.yml +++ b/docs/id/mkdocs.yml @@ -44,6 +44,7 @@ nav: - es: /es/ - fa: /fa/ - fr: /fr/ + - he: /he/ - id: /id/ - it: /it/ - ja: /ja/ @@ -106,6 +107,8 @@ extra: name: fa - link: /fr/ name: fr - franรงais + - link: /he/ + name: he - link: /id/ name: id - link: /it/ diff --git a/docs/it/mkdocs.yml b/docs/it/mkdocs.yml index 5f0b7c73b..1f1d0016d 100644 --- a/docs/it/mkdocs.yml +++ b/docs/it/mkdocs.yml @@ -44,6 +44,7 @@ nav: - es: /es/ - fa: /fa/ - fr: /fr/ + - he: /he/ - id: /id/ - it: /it/ - ja: /ja/ @@ -106,6 +107,8 @@ extra: name: fa - link: /fr/ name: fr - franรงais + - link: /he/ + name: he - link: /id/ name: id - link: /it/ diff --git a/docs/ja/mkdocs.yml b/docs/ja/mkdocs.yml index 66694ef36..d96074ef1 100644 --- a/docs/ja/mkdocs.yml +++ b/docs/ja/mkdocs.yml @@ -44,6 +44,7 @@ nav: - es: /es/ - fa: /fa/ - fr: /fr/ + - he: /he/ - id: /id/ - it: /it/ - ja: /ja/ @@ -148,6 +149,8 @@ extra: name: fa - link: /fr/ name: fr - franรงais + - link: /he/ + name: he - link: /id/ name: id - link: /it/ diff --git a/docs/ko/mkdocs.yml b/docs/ko/mkdocs.yml index ddadebe7b..4a576baf2 100644 --- a/docs/ko/mkdocs.yml +++ b/docs/ko/mkdocs.yml @@ -44,6 +44,7 @@ nav: - es: /es/ - fa: /fa/ - fr: /fr/ + - he: /he/ - id: /id/ - it: /it/ - ja: /ja/ @@ -116,6 +117,8 @@ extra: name: fa - link: /fr/ name: fr - franรงais + - link: /he/ + name: he - link: /id/ name: id - link: /it/ diff --git a/docs/nl/mkdocs.yml b/docs/nl/mkdocs.yml index 620a4b25f..8831571dd 100644 --- a/docs/nl/mkdocs.yml +++ b/docs/nl/mkdocs.yml @@ -44,6 +44,7 @@ nav: - es: /es/ - fa: /fa/ - fr: /fr/ + - he: /he/ - id: /id/ - it: /it/ - ja: /ja/ @@ -106,6 +107,8 @@ extra: name: fa - link: /fr/ name: fr - franรงais + - link: /he/ + name: he - link: /id/ name: id - link: /it/ diff --git a/docs/pl/mkdocs.yml b/docs/pl/mkdocs.yml index c04f3c1c6..982b1a060 100644 --- a/docs/pl/mkdocs.yml +++ b/docs/pl/mkdocs.yml @@ -44,6 +44,7 @@ nav: - es: /es/ - fa: /fa/ - fr: /fr/ + - he: /he/ - id: /id/ - it: /it/ - ja: /ja/ @@ -109,6 +110,8 @@ extra: name: fa - link: /fr/ name: fr - franรงais + - link: /he/ + name: he - link: /id/ name: id - link: /it/ diff --git a/docs/pt/mkdocs.yml b/docs/pt/mkdocs.yml index 51d448c95..fb95bfe29 100644 --- a/docs/pt/mkdocs.yml +++ b/docs/pt/mkdocs.yml @@ -44,6 +44,7 @@ nav: - es: /es/ - fa: /fa/ - fr: /fr/ + - he: /he/ - id: /id/ - it: /it/ - ja: /ja/ @@ -131,6 +132,8 @@ extra: name: fa - link: /fr/ name: fr - franรงais + - link: /he/ + name: he - link: /id/ name: id - link: /it/ diff --git a/docs/ru/mkdocs.yml b/docs/ru/mkdocs.yml index 816a0d3a0..2eb8eb935 100644 --- a/docs/ru/mkdocs.yml +++ b/docs/ru/mkdocs.yml @@ -44,6 +44,7 @@ nav: - es: /es/ - fa: /fa/ - fr: /fr/ + - he: /he/ - id: /id/ - it: /it/ - ja: /ja/ @@ -107,6 +108,8 @@ extra: name: fa - link: /fr/ name: fr - franรงais + - link: /he/ + name: he - link: /id/ name: id - link: /it/ diff --git a/docs/sq/mkdocs.yml b/docs/sq/mkdocs.yml index 4df6d5b1f..1d8d9d04e 100644 --- a/docs/sq/mkdocs.yml +++ b/docs/sq/mkdocs.yml @@ -44,6 +44,7 @@ nav: - es: /es/ - fa: /fa/ - fr: /fr/ + - he: /he/ - id: /id/ - it: /it/ - ja: /ja/ @@ -106,6 +107,8 @@ extra: name: fa - link: /fr/ name: fr - franรงais + - link: /he/ + name: he - link: /id/ name: id - link: /it/ diff --git a/docs/tr/mkdocs.yml b/docs/tr/mkdocs.yml index 5371cb71f..bf66edd68 100644 --- a/docs/tr/mkdocs.yml +++ b/docs/tr/mkdocs.yml @@ -44,6 +44,7 @@ nav: - es: /es/ - fa: /fa/ - fr: /fr/ + - he: /he/ - id: /id/ - it: /it/ - ja: /ja/ @@ -109,6 +110,8 @@ extra: name: fa - link: /fr/ name: fr - franรงais + - link: /he/ + name: he - link: /id/ name: id - link: /it/ diff --git a/docs/uk/mkdocs.yml b/docs/uk/mkdocs.yml index fd371765a..3b8475907 100644 --- a/docs/uk/mkdocs.yml +++ b/docs/uk/mkdocs.yml @@ -44,6 +44,7 @@ nav: - es: /es/ - fa: /fa/ - fr: /fr/ + - he: /he/ - id: /id/ - it: /it/ - ja: /ja/ @@ -106,6 +107,8 @@ extra: name: fa - link: /fr/ name: fr - franรงais + - link: /he/ + name: he - link: /id/ name: id - link: /it/ diff --git a/docs/zh/mkdocs.yml b/docs/zh/mkdocs.yml index c1c35c6ed..f9bfd6875 100644 --- a/docs/zh/mkdocs.yml +++ b/docs/zh/mkdocs.yml @@ -44,6 +44,7 @@ nav: - es: /es/ - fa: /fa/ - fr: /fr/ + - he: /he/ - id: /id/ - it: /it/ - ja: /ja/ @@ -157,6 +158,8 @@ extra: name: fa - link: /fr/ name: fr - franรงais + - link: /he/ + name: he - link: /id/ name: id - link: /it/ From e35df688d55c93f92e31019a5652247082ae51b3 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 14 Jul 2022 17:17:09 +0000 Subject: [PATCH 166/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 714696529..542637032 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ๐ŸŒ Start of Hebrew translation. PR [#5050](https://github.com/tiangolo/fastapi/pull/5050) by [@itay-raveh](https://github.com/itay-raveh). * ๐Ÿ”ง Update translations notification for Hebrew. PR [#5158](https://github.com/tiangolo/fastapi/pull/5158) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ”ง Update Dependabot commit message. PR [#5156](https://github.com/tiangolo/fastapi/pull/5156) by [@tiangolo](https://github.com/tiangolo). * โฌ† Bump actions/upload-artifact from 2 to 3. PR [#5148](https://github.com/tiangolo/fastapi/pull/5148) by [@dependabot[bot]](https://github.com/apps/dependabot). From 2f21bef91b72dbd723fceb12a23ca5cf58540684 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Thu, 14 Jul 2022 19:34:25 +0200 Subject: [PATCH 167/168] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 542637032..5dece6163 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,7 +2,23 @@ ## Latest Changes +### Fixes - Breaking Changes + +* ๐Ÿ› Fix removing body from status codes that do not support it. PR [#5145](https://github.com/tiangolo/fastapi/pull/5145) by [@tiangolo](https://github.com/tiangolo). + * Setting `status_code` to `204`, `304`, or any code below `200` (1xx) will remove the body from the response. + * This fixes an error in Uvicorn that otherwise would be thrown: `RuntimeError: Response content longer than Content-Length`. + * This removes `fastapi.openapi.constants.STATUS_CODES_WITH_NO_BODY`, it is replaced by a function in utils. + +### Translations + * ๐ŸŒ Start of Hebrew translation. PR [#5050](https://github.com/tiangolo/fastapi/pull/5050) by [@itay-raveh](https://github.com/itay-raveh). +* ๐Ÿ”ง Add config for Swedish translations notification. PR [#5147](https://github.com/tiangolo/fastapi/pull/5147) by [@tiangolo](https://github.com/tiangolo). +* ๐ŸŒ Start of Swedish translation. PR [#5062](https://github.com/tiangolo/fastapi/pull/5062) by [@MrRawbin](https://github.com/MrRawbin). +* ๐ŸŒ Add Japanese translation for `docs/ja/docs/advanced/index.md`. PR [#5043](https://github.com/tiangolo/fastapi/pull/5043) by [@wakabame](https://github.com/wakabame). +* ๐ŸŒ๐Ÿ‡ต๐Ÿ‡ฑ Add Polish translation for `docs/pl/docs/tutorial/first-steps.md`. PR [#5024](https://github.com/tiangolo/fastapi/pull/5024) by [@Valaraucoo](https://github.com/Valaraucoo). + +### Internal + * ๐Ÿ”ง Update translations notification for Hebrew. PR [#5158](https://github.com/tiangolo/fastapi/pull/5158) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ”ง Update Dependabot commit message. PR [#5156](https://github.com/tiangolo/fastapi/pull/5156) by [@tiangolo](https://github.com/tiangolo). * โฌ† Bump actions/upload-artifact from 2 to 3. PR [#5148](https://github.com/tiangolo/fastapi/pull/5148) by [@dependabot[bot]](https://github.com/apps/dependabot). @@ -10,17 +26,12 @@ * ๐Ÿ”ง Update sponsors badge configs. PR [#5155](https://github.com/tiangolo/fastapi/pull/5155) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ‘ฅ Update FastAPI People. PR [#5154](https://github.com/tiangolo/fastapi/pull/5154) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ”ง Update Jina sponsor badges. PR [#5151](https://github.com/tiangolo/fastapi/pull/5151) by [@tiangolo](https://github.com/tiangolo). -* ๐Ÿ”ง Add config for Swedish translations notification. PR [#5147](https://github.com/tiangolo/fastapi/pull/5147) by [@tiangolo](https://github.com/tiangolo). -* ๐ŸŒ Start of Swedish translation. PR [#5062](https://github.com/tiangolo/fastapi/pull/5062) by [@MrRawbin](https://github.com/MrRawbin). -* ๐ŸŒ Add Japanese translation for `docs/ja/docs/advanced/index.md`. PR [#5043](https://github.com/tiangolo/fastapi/pull/5043) by [@wakabame](https://github.com/wakabame). -* ๐ŸŒ๐Ÿ‡ต๐Ÿ‡ฑ Add Polish translation for `docs/pl/docs/tutorial/first-steps.md`. PR [#5024](https://github.com/tiangolo/fastapi/pull/5024) by [@Valaraucoo](https://github.com/Valaraucoo). * โฌ† Bump actions/checkout from 2 to 3. PR [#5133](https://github.com/tiangolo/fastapi/pull/5133) by [@dependabot[bot]](https://github.com/apps/dependabot). * โฌ† [pre-commit.ci] pre-commit autoupdate. PR [#5030](https://github.com/tiangolo/fastapi/pull/5030) by [@pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci). * โฌ† Bump nwtgck/actions-netlify from 1.1.5 to 1.2.3. PR [#5132](https://github.com/tiangolo/fastapi/pull/5132) by [@dependabot[bot]](https://github.com/apps/dependabot). * โฌ† Bump codecov/codecov-action from 2 to 3. PR [#5131](https://github.com/tiangolo/fastapi/pull/5131) by [@dependabot[bot]](https://github.com/apps/dependabot). * โฌ† Bump dawidd6/action-download-artifact from 2.9.0 to 2.21.1. PR [#5130](https://github.com/tiangolo/fastapi/pull/5130) by [@dependabot[bot]](https://github.com/apps/dependabot). * โฌ† Bump actions/setup-python from 2 to 4. PR [#5129](https://github.com/tiangolo/fastapi/pull/5129) by [@dependabot[bot]](https://github.com/apps/dependabot). -* ๐Ÿ› Fix removing body from status codes that do not support it. PR [#5145](https://github.com/tiangolo/fastapi/pull/5145) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ‘ท Add Dependabot. PR [#5128](https://github.com/tiangolo/fastapi/pull/5128) by [@tiangolo](https://github.com/tiangolo). * โ™ป๏ธ Move from `Optional[X]` to `Union[X, None]` for internal utils. PR [#5124](https://github.com/tiangolo/fastapi/pull/5124) by [@tiangolo](https://github.com/tiangolo). * ๐Ÿ”ง Update sponsors, remove Dropbase, add Doist. PR [#5096](https://github.com/tiangolo/fastapi/pull/5096) by [@tiangolo](https://github.com/tiangolo). From 50fb34bf55c1711e3753363ab6427d77be25dbb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Thu, 14 Jul 2022 19:35:13 +0200 Subject: [PATCH 168/168] =?UTF-8?q?=F0=9F=94=96=20Release=20version=200.79?= =?UTF-8?q?.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 3 +++ fastapi/__init__.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 5dece6163..55df22c06 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,9 @@ ## Latest Changes + +## 0.79.0 + ### Fixes - Breaking Changes * ๐Ÿ› Fix removing body from status codes that do not support it. PR [#5145](https://github.com/tiangolo/fastapi/pull/5145) by [@tiangolo](https://github.com/tiangolo). diff --git a/fastapi/__init__.py b/fastapi/__init__.py index 2465e2c27..e5cdbeb09 100644 --- a/fastapi/__init__.py +++ b/fastapi/__init__.py @@ -1,6 +1,6 @@ """FastAPI framework, high performance, easy to learn, fast to code, ready for production""" -__version__ = "0.78.0" +__version__ = "0.79.0" from starlette import status as status