[{"data":1,"prerenderedAt":3762},["ShallowReactive",2],{"content-/jestep/2023-3/fastapi":3},{"article":4,"all":2878},{"_path":5,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":9,"description":10,"tags":11,"image":17,"excerpt":10,"publishDate":18,"body":19,"_type":2869,"_id":2870,"_source":2871,"_file":2872,"_stem":2873,"_extension":2874,"author":2875},"/jestep/2023-3/fastapi","2023-3",false,"","FastAPI: A High-Performance Python Framework for Rapid Web Development","FastAPI is a modern and high-performance Python web framework designed specifically for building APIs and web applications quickly and efficiently. Developed by Sebastián Ramírez and first released in 2018, FastAPI has rapidly gained traction in the developer community thanks to its focus on providing key features for API and web app development with excellent performance.",[12,13,14,15,16],"python","fastapi","django","flask","pyramid","/jestep/2023-3/img/header.png","2024-05-01",{"type":20,"children":21,"toc":2841},"root",[22,31,55,78,100,105,111,116,123,135,140,342,387,393,415,424,433,439,444,464,567,573,578,583,593,599,610,615,621,626,632,637,642,651,656,665,670,676,681,686,1166,1171,1345,1350,1593,1613,1619,1624,2236,2249,2255,2260,2525,2530,2536,2541,2547,2552,2558,2563,2569,2574,2580,2585,2591,2605,2611,2616,2622,2627,2633,2638,2694,2700,2705,2781,2786,2792,2797,2825,2830,2835],{"type":23,"tag":24,"props":25,"children":27},"element","h2",{"id":26},"introduction",[28],{"type":29,"value":30},"text","Introduction",{"type":23,"tag":32,"props":33,"children":34},"p",{},[35,44,46,53],{"type":23,"tag":36,"props":37,"children":41},"a",{"href":38,"rel":39},"https://fastapi.tiangolo.com/",[40],"nofollow",[42],{"type":29,"value":43},"FastAPI",{"type":29,"value":45}," is a modern and high-performance Python web framework designed specifically for building APIs and web applications quickly and efficiently. Developed by ",{"type":23,"tag":36,"props":47,"children":50},{"href":48,"rel":49},"https://tiangolo.com/",[40],[51],{"type":29,"value":52},"Sebastián Ramírez",{"type":29,"value":54}," and first released in 2018, FastAPI has rapidly gained traction in the developer community thanks to its focus on providing key features for API and web app development with excellent performance.",{"type":23,"tag":32,"props":56,"children":57},{},[58,60,67,69,76],{"type":29,"value":59},"FastAPI is built on top of ",{"type":23,"tag":36,"props":61,"children":64},{"href":62,"rel":63},"https://www.starlette.io/",[40],[65],{"type":29,"value":66},"Starlette",{"type":29,"value":68}," and ",{"type":23,"tag":36,"props":70,"children":73},{"href":71,"rel":72},"https://pydantic-docs.helpmanual.io/",[40],[74],{"type":29,"value":75},"Pydantic",{"type":29,"value":77},", both of which contribute to its ease of use and performance. Starlette provides a lightweight and fast ASGI framework foundation, while Pydantic enables data validation using Python type hints.",{"type":23,"tag":32,"props":79,"children":80},{},[81,83,90,91,98],{"type":29,"value":82},"Compared to well-established frameworks like ",{"type":23,"tag":36,"props":84,"children":87},{"href":85,"rel":86},"https://www.djangoproject.com/",[40],[88],{"type":29,"value":89},"Django",{"type":29,"value":68},{"type":23,"tag":36,"props":92,"children":95},{"href":93,"rel":94},"https://flask.palletsprojects.com/en/2.2.x/",[40],[96],{"type":29,"value":97},"Flask",{"type":29,"value":99},", FastAPI differentiates itself by emphasizing developer velocity, productivity, and maintainable code.",{"type":23,"tag":32,"props":101,"children":102},{},[103],{"type":29,"value":104},"In this post, we’ll look at FastAPI’s key features, compare it to alternatives like Django and Flask, and provide use cases where FastAPI shines. We’ll also share hands-on impressions of using the framework and offer suggestions on when FastAPI may be the right choice for your next project.",{"type":23,"tag":24,"props":106,"children":108},{"id":107},"fastapi-features-and-benefits",[109],{"type":29,"value":110},"FastAPI Features and Benefits",{"type":23,"tag":32,"props":112,"children":113},{},[114],{"type":29,"value":115},"FastAPI provides several features that make it well-suited for web development, especially APIs:",{"type":23,"tag":117,"props":118,"children":120},"h3",{"id":119},"automatic-data-validation",[121],{"type":29,"value":122},"Automatic Data Validation",{"type":23,"tag":32,"props":124,"children":125},{},[126,128,133],{"type":29,"value":127},"FastAPI leverages ",{"type":23,"tag":36,"props":129,"children":131},{"href":71,"rel":130},[40],[132],{"type":29,"value":75},{"type":29,"value":134}," and Python type hints to automatically validate data. This reduces boilerplate code and ensures that the API's inputs and outputs match the expected schemas.",{"type":23,"tag":32,"props":136,"children":137},{},[138],{"type":29,"value":139},"For example:",{"type":23,"tag":141,"props":142,"children":145},"pre",{"className":143,"code":144,"language":12,"meta":8,"style":8},"language-python shiki shiki-themes github-light github-dark","from pydantic import BaseModel\n\nclass User(BaseModel):\n    id: int\n    name: str\n    joined: date\n    \n@app.post(\"/users\")\nasync def create_user(user: User):\n    # user will be validated against the User model\n    return user\n",[146],{"type":23,"tag":147,"props":148,"children":149},"code",{"__ignoreMap":8},[150,178,188,218,238,252,261,270,294,318,328],{"type":23,"tag":151,"props":152,"children":155},"span",{"class":153,"line":154},"line",1,[156,162,168,173],{"type":23,"tag":151,"props":157,"children":159},{"style":158},"--shiki-default:#D73A49;--shiki-dark:#F97583",[160],{"type":29,"value":161},"from",{"type":23,"tag":151,"props":163,"children":165},{"style":164},"--shiki-default:#24292E;--shiki-dark:#E1E4E8",[166],{"type":29,"value":167}," pydantic ",{"type":23,"tag":151,"props":169,"children":170},{"style":158},[171],{"type":29,"value":172},"import",{"type":23,"tag":151,"props":174,"children":175},{"style":164},[176],{"type":29,"value":177}," BaseModel\n",{"type":23,"tag":151,"props":179,"children":181},{"class":153,"line":180},2,[182],{"type":23,"tag":151,"props":183,"children":185},{"emptyLinePlaceholder":184},true,[186],{"type":29,"value":187},"\n",{"type":23,"tag":151,"props":189,"children":191},{"class":153,"line":190},3,[192,197,203,208,213],{"type":23,"tag":151,"props":193,"children":194},{"style":158},[195],{"type":29,"value":196},"class",{"type":23,"tag":151,"props":198,"children":200},{"style":199},"--shiki-default:#6F42C1;--shiki-dark:#B392F0",[201],{"type":29,"value":202}," User",{"type":23,"tag":151,"props":204,"children":205},{"style":164},[206],{"type":29,"value":207},"(",{"type":23,"tag":151,"props":209,"children":210},{"style":199},[211],{"type":29,"value":212},"BaseModel",{"type":23,"tag":151,"props":214,"children":215},{"style":164},[216],{"type":29,"value":217},"):\n",{"type":23,"tag":151,"props":219,"children":221},{"class":153,"line":220},4,[222,228,233],{"type":23,"tag":151,"props":223,"children":225},{"style":224},"--shiki-default:#005CC5;--shiki-dark:#79B8FF",[226],{"type":29,"value":227},"    id",{"type":23,"tag":151,"props":229,"children":230},{"style":164},[231],{"type":29,"value":232},": ",{"type":23,"tag":151,"props":234,"children":235},{"style":224},[236],{"type":29,"value":237},"int\n",{"type":23,"tag":151,"props":239,"children":241},{"class":153,"line":240},5,[242,247],{"type":23,"tag":151,"props":243,"children":244},{"style":164},[245],{"type":29,"value":246},"    name: ",{"type":23,"tag":151,"props":248,"children":249},{"style":224},[250],{"type":29,"value":251},"str\n",{"type":23,"tag":151,"props":253,"children":255},{"class":153,"line":254},6,[256],{"type":23,"tag":151,"props":257,"children":258},{"style":164},[259],{"type":29,"value":260},"    joined: date\n",{"type":23,"tag":151,"props":262,"children":264},{"class":153,"line":263},7,[265],{"type":23,"tag":151,"props":266,"children":267},{"style":164},[268],{"type":29,"value":269},"    \n",{"type":23,"tag":151,"props":271,"children":273},{"class":153,"line":272},8,[274,279,283,289],{"type":23,"tag":151,"props":275,"children":276},{"style":199},[277],{"type":29,"value":278},"@app.post",{"type":23,"tag":151,"props":280,"children":281},{"style":164},[282],{"type":29,"value":207},{"type":23,"tag":151,"props":284,"children":286},{"style":285},"--shiki-default:#032F62;--shiki-dark:#9ECBFF",[287],{"type":29,"value":288},"\"/users\"",{"type":23,"tag":151,"props":290,"children":291},{"style":164},[292],{"type":29,"value":293},")\n",{"type":23,"tag":151,"props":295,"children":297},{"class":153,"line":296},9,[298,303,308,313],{"type":23,"tag":151,"props":299,"children":300},{"style":158},[301],{"type":29,"value":302},"async",{"type":23,"tag":151,"props":304,"children":305},{"style":158},[306],{"type":29,"value":307}," def",{"type":23,"tag":151,"props":309,"children":310},{"style":199},[311],{"type":29,"value":312}," create_user",{"type":23,"tag":151,"props":314,"children":315},{"style":164},[316],{"type":29,"value":317},"(user: User):\n",{"type":23,"tag":151,"props":319,"children":321},{"class":153,"line":320},10,[322],{"type":23,"tag":151,"props":323,"children":325},{"style":324},"--shiki-default:#6A737D;--shiki-dark:#6A737D",[326],{"type":29,"value":327},"    # user will be validated against the User model\n",{"type":23,"tag":151,"props":329,"children":331},{"class":153,"line":330},11,[332,337],{"type":23,"tag":151,"props":333,"children":334},{"style":158},[335],{"type":29,"value":336},"    return",{"type":23,"tag":151,"props":338,"children":339},{"style":164},[340],{"type":29,"value":341}," user\n",{"type":23,"tag":32,"props":343,"children":344},{},[345,347,353,355,361,363,369,371,377,379,385],{"type":29,"value":346},"Here, FastAPI automatically validates that the ",{"type":23,"tag":147,"props":348,"children":350},{"className":349},[],[351],{"type":29,"value":352},"user",{"type":29,"value":354}," object received matches the ",{"type":23,"tag":147,"props":356,"children":358},{"className":357},[],[359],{"type":29,"value":360},"User",{"type":29,"value":362}," model containing the expected types for ",{"type":23,"tag":147,"props":364,"children":366},{"className":365},[],[367],{"type":29,"value":368},"id",{"type":29,"value":370},", ",{"type":23,"tag":147,"props":372,"children":374},{"className":373},[],[375],{"type":29,"value":376},"name",{"type":29,"value":378},", and ",{"type":23,"tag":147,"props":380,"children":382},{"className":381},[],[383],{"type":29,"value":384},"joined",{"type":29,"value":386},".",{"type":23,"tag":117,"props":388,"children":390},{"id":389},"automatic-interactive-api-documentation",[391],{"type":29,"value":392},"Automatic Interactive API Documentation",{"type":23,"tag":32,"props":394,"children":395},{},[396,398,405,406,413],{"type":29,"value":397},"FastAPI integrates with ",{"type":23,"tag":36,"props":399,"children":402},{"href":400,"rel":401},"https://swagger.io/tools/swagger-ui/",[40],[403],{"type":29,"value":404},"Swagger UI",{"type":29,"value":68},{"type":23,"tag":36,"props":407,"children":410},{"href":408,"rel":409},"https://github.com/Redocly/redoc",[40],[411],{"type":29,"value":412},"ReDoc",{"type":29,"value":414}," to automatically generate interactive documentation for the API. This lets you quickly test endpoints and review parameters without additional work.",{"type":23,"tag":32,"props":416,"children":417},{},[418],{"type":23,"tag":419,"props":420,"children":423},"img",{"alt":421,"src":422},"Swagger UI docs example","/jestep/2023-3/img/index-03-swagger-02.png",[],{"type":23,"tag":32,"props":425,"children":426},{},[427],{"type":23,"tag":428,"props":429,"children":430},"em",{},[431],{"type":29,"value":432},"FastAPI Swagger UI interactive documentation",{"type":23,"tag":117,"props":434,"children":436},{"id":435},"modern-python-features",[437],{"type":29,"value":438},"Modern Python Features",{"type":23,"tag":32,"props":440,"children":441},{},[442],{"type":29,"value":443},"FastAPI takes advantage of modern Python features like type hints and asynchronous programming. This results in cleaner and more idiomatic code while improving performance.",{"type":23,"tag":32,"props":445,"children":446},{},[447,449,454,456,462],{"type":29,"value":448},"For example, FastAPI supports Python's ",{"type":23,"tag":147,"props":450,"children":452},{"className":451},[],[453],{"type":29,"value":302},{"type":29,"value":455},"/",{"type":23,"tag":147,"props":457,"children":459},{"className":458},[],[460],{"type":29,"value":461},"await",{"type":29,"value":463}," syntax:",{"type":23,"tag":141,"props":465,"children":467},{"className":143,"code":466,"language":12,"meta":8,"style":8},"@app.get(\"/items/{item_id}\")\nasync def read_item(item_id: int):\n    results = await async_database_call(item_id)\n    return results\n",[468],{"type":23,"tag":147,"props":469,"children":470},{"__ignoreMap":8},[471,502,532,555],{"type":23,"tag":151,"props":472,"children":473},{"class":153,"line":154},[474,479,483,488,493,498],{"type":23,"tag":151,"props":475,"children":476},{"style":199},[477],{"type":29,"value":478},"@app.get",{"type":23,"tag":151,"props":480,"children":481},{"style":164},[482],{"type":29,"value":207},{"type":23,"tag":151,"props":484,"children":485},{"style":285},[486],{"type":29,"value":487},"\"/items/",{"type":23,"tag":151,"props":489,"children":490},{"style":224},[491],{"type":29,"value":492},"{item_id}",{"type":23,"tag":151,"props":494,"children":495},{"style":285},[496],{"type":29,"value":497},"\"",{"type":23,"tag":151,"props":499,"children":500},{"style":164},[501],{"type":29,"value":293},{"type":23,"tag":151,"props":503,"children":504},{"class":153,"line":180},[505,509,513,518,523,528],{"type":23,"tag":151,"props":506,"children":507},{"style":158},[508],{"type":29,"value":302},{"type":23,"tag":151,"props":510,"children":511},{"style":158},[512],{"type":29,"value":307},{"type":23,"tag":151,"props":514,"children":515},{"style":199},[516],{"type":29,"value":517}," read_item",{"type":23,"tag":151,"props":519,"children":520},{"style":164},[521],{"type":29,"value":522},"(item_id: ",{"type":23,"tag":151,"props":524,"children":525},{"style":224},[526],{"type":29,"value":527},"int",{"type":23,"tag":151,"props":529,"children":530},{"style":164},[531],{"type":29,"value":217},{"type":23,"tag":151,"props":533,"children":534},{"class":153,"line":190},[535,540,545,550],{"type":23,"tag":151,"props":536,"children":537},{"style":164},[538],{"type":29,"value":539},"    results ",{"type":23,"tag":151,"props":541,"children":542},{"style":158},[543],{"type":29,"value":544},"=",{"type":23,"tag":151,"props":546,"children":547},{"style":158},[548],{"type":29,"value":549}," await",{"type":23,"tag":151,"props":551,"children":552},{"style":164},[553],{"type":29,"value":554}," async_database_call(item_id)\n",{"type":23,"tag":151,"props":556,"children":557},{"class":153,"line":220},[558,562],{"type":23,"tag":151,"props":559,"children":560},{"style":158},[561],{"type":29,"value":336},{"type":23,"tag":151,"props":563,"children":564},{"style":164},[565],{"type":29,"value":566}," results\n",{"type":23,"tag":117,"props":568,"children":570},{"id":569},"developer-friendly",[571],{"type":29,"value":572},"Developer Friendly",{"type":23,"tag":32,"props":574,"children":575},{},[576],{"type":29,"value":577},"FastAPI aims to provide a pleasant developer experience. It has an intuitive interface, helpful error messages, and encourages best practices that lead to maintainable code.",{"type":23,"tag":32,"props":579,"children":580},{},[581],{"type":29,"value":582},"For example, clear and explicit error messages help identify issues faster:",{"type":23,"tag":141,"props":584,"children":588},{"className":585,"code":587,"language":29},[586],"language-text","422 Unprocessable Entity\n\nbody validation error\nfield required (type=value_error.missing)\n\n> body\n  > item_id\n    field required (type=value_error.missing)\n",[589],{"type":23,"tag":147,"props":590,"children":591},{"__ignoreMap":8},[592],{"type":29,"value":587},{"type":23,"tag":117,"props":594,"children":596},{"id":595},"asgi",[597],{"type":29,"value":598},"ASGI",{"type":23,"tag":32,"props":600,"children":601},{},[602,608],{"type":23,"tag":36,"props":603,"children":606},{"href":604,"rel":605},"https://en.wikipedia.org/wiki/Asynchronous_Server_Gateway_Interface",[40],[607],{"type":29,"value":598},{"type":29,"value":609},", which stands for Asynchronous Server Gateway Interface, is a specification between web servers and Python web applications or frameworks to allow greater concurrency. It's a successor to WSGI, the Web Server Gateway Interface, which has been the standard for synchronous Python web applications.",{"type":23,"tag":32,"props":611,"children":612},{},[613],{"type":29,"value":614},"ASGI supports both synchronous and asynchronous communication, making it suitable for handling a large number of simultaneous incoming requests, particularly those that might spend a lot of time waiting, such as requests involving I/O operations.",{"type":23,"tag":24,"props":616,"children":618},{"id":617},"fastapi-vs-other-frameworks",[619],{"type":29,"value":620},"FastAPI vs Other Frameworks",{"type":23,"tag":32,"props":622,"children":623},{},[624],{"type":29,"value":625},"How does FastAPI compare to popular frameworks like Django and Flask? Let's take a look at some of the key differences.",{"type":23,"tag":117,"props":627,"children":629},{"id":628},"fastapi-vs-django",[630],{"type":29,"value":631},"FastAPI vs Django",{"type":23,"tag":32,"props":633,"children":634},{},[635],{"type":29,"value":636},"Django is a mature, full-featured framework with extensive documentation and an active community. However, it has a larger footprint and steeper learning curve than FastAPI.",{"type":23,"tag":32,"props":638,"children":639},{},[640],{"type":29,"value":641},"For example, Django's more complex project structure can make initial setup take longer, as well as requiring a deeper understanding of the framework's internals:",{"type":23,"tag":141,"props":643,"children":646},{"className":644,"code":645,"language":29},[586],"myproject/\n  manage.py\n  myproject/\n    __init__.py\n    settings.py\n    urls.py\n    asgi.py\n    wsgi.py\n  app/\n    __init__.py\n    admin.py\n    apps.py\n    models.py\n    tests.py\n    views.py\n",[647],{"type":23,"tag":147,"props":648,"children":649},{"__ignoreMap":8},[650],{"type":29,"value":645},{"type":23,"tag":32,"props":652,"children":653},{},[654],{"type":29,"value":655},"Whereas FastAPI can utilize a much simpler directory structure:",{"type":23,"tag":141,"props":657,"children":660},{"className":658,"code":659,"language":29},[586],"myapi/\n  main.py\n  models.py\n  schemas.py\n  api/\n    __init__.py\n    endpoints.py\n",[661],{"type":23,"tag":147,"props":662,"children":663},{"__ignoreMap":8},[664],{"type":29,"value":659},{"type":23,"tag":32,"props":666,"children":667},{},[668],{"type":29,"value":669},"Django's built-in ORM and admin interface are advantages for some projects. However, FastAPI's focus on API development makes it better suited for building lightweight, high-performance services. Django has a lot of features built-in that aren't needed in many applications. Django tries to give you everything a website COULD need, but that can be overkill for smaller projects or applications that require high performance, because you often don't NEED everything Django provides.",{"type":23,"tag":117,"props":671,"children":673},{"id":672},"fastapi-vs-flask",[674],{"type":29,"value":675},"FastAPI vs Flask",{"type":23,"tag":32,"props":677,"children":678},{},[679],{"type":29,"value":680},"Flask and FastAPI are more directly comparable compared to Django and FastAPI, as they are both microframeworks that don't have a lot of included bloat. Compared to Flask, FastAPI's built-in features make it easier to get started and maintain code. While Flask and FastAPI are both well-suited for building APIs, and both are similar in speed, with Flask being slightly faster, FastAPI's automatic data validation and documentation generation make it a better choice for API development, in my opinion. With Flask, validation and documentation generation requires extra libraries and boilerplate code.",{"type":23,"tag":32,"props":682,"children":683},{},[684],{"type":29,"value":685},"For example, validating a POST request in Flask:",{"type":23,"tag":141,"props":687,"children":689},{"className":143,"code":688,"language":12,"meta":8,"style":8},"from flask import request\nfrom werkzeug.exceptions import BadRequest\n\n@app.route(\"/users\", methods=[\"POST\"]) \ndef create_user():\n  data = request.get_json()\n\n  if not data:\n    return BadRequest(\"No JSON provided\")\n\n  if \"name\" not in data:\n    return BadRequest(\"Missing name\")\n\n  if not isinstance(data[\"name\"], str):\n    return BadRequest(\"Name must be a string\")\n\n  if \"age\" not in data:\n    return BadRequest(\"Missing age\")\n\n  if not isinstance(data[\"age\"], int):\n    return BadRequest(\"Age must be an integer\")\n\n  # ... etc for each field to be validated\n\n  # ... Create the user ...\n  \n  return user\n",[690],{"type":23,"tag":147,"props":691,"children":692},{"__ignoreMap":8},[693,714,735,742,787,804,821,828,846,867,874,899,920,928,969,990,998,1023,1044,1052,1089,1110,1118,1127,1135,1144,1153],{"type":23,"tag":151,"props":694,"children":695},{"class":153,"line":154},[696,700,705,709],{"type":23,"tag":151,"props":697,"children":698},{"style":158},[699],{"type":29,"value":161},{"type":23,"tag":151,"props":701,"children":702},{"style":164},[703],{"type":29,"value":704}," flask ",{"type":23,"tag":151,"props":706,"children":707},{"style":158},[708],{"type":29,"value":172},{"type":23,"tag":151,"props":710,"children":711},{"style":164},[712],{"type":29,"value":713}," request\n",{"type":23,"tag":151,"props":715,"children":716},{"class":153,"line":180},[717,721,726,730],{"type":23,"tag":151,"props":718,"children":719},{"style":158},[720],{"type":29,"value":161},{"type":23,"tag":151,"props":722,"children":723},{"style":164},[724],{"type":29,"value":725}," werkzeug.exceptions ",{"type":23,"tag":151,"props":727,"children":728},{"style":158},[729],{"type":29,"value":172},{"type":23,"tag":151,"props":731,"children":732},{"style":164},[733],{"type":29,"value":734}," BadRequest\n",{"type":23,"tag":151,"props":736,"children":737},{"class":153,"line":190},[738],{"type":23,"tag":151,"props":739,"children":740},{"emptyLinePlaceholder":184},[741],{"type":29,"value":187},{"type":23,"tag":151,"props":743,"children":744},{"class":153,"line":220},[745,750,754,758,762,768,772,777,782],{"type":23,"tag":151,"props":746,"children":747},{"style":199},[748],{"type":29,"value":749},"@app.route",{"type":23,"tag":151,"props":751,"children":752},{"style":164},[753],{"type":29,"value":207},{"type":23,"tag":151,"props":755,"children":756},{"style":285},[757],{"type":29,"value":288},{"type":23,"tag":151,"props":759,"children":760},{"style":164},[761],{"type":29,"value":370},{"type":23,"tag":151,"props":763,"children":765},{"style":764},"--shiki-default:#E36209;--shiki-dark:#FFAB70",[766],{"type":29,"value":767},"methods",{"type":23,"tag":151,"props":769,"children":770},{"style":158},[771],{"type":29,"value":544},{"type":23,"tag":151,"props":773,"children":774},{"style":164},[775],{"type":29,"value":776},"[",{"type":23,"tag":151,"props":778,"children":779},{"style":285},[780],{"type":29,"value":781},"\"POST\"",{"type":23,"tag":151,"props":783,"children":784},{"style":164},[785],{"type":29,"value":786},"]) \n",{"type":23,"tag":151,"props":788,"children":789},{"class":153,"line":240},[790,795,799],{"type":23,"tag":151,"props":791,"children":792},{"style":158},[793],{"type":29,"value":794},"def",{"type":23,"tag":151,"props":796,"children":797},{"style":199},[798],{"type":29,"value":312},{"type":23,"tag":151,"props":800,"children":801},{"style":164},[802],{"type":29,"value":803},"():\n",{"type":23,"tag":151,"props":805,"children":806},{"class":153,"line":254},[807,812,816],{"type":23,"tag":151,"props":808,"children":809},{"style":164},[810],{"type":29,"value":811},"  data ",{"type":23,"tag":151,"props":813,"children":814},{"style":158},[815],{"type":29,"value":544},{"type":23,"tag":151,"props":817,"children":818},{"style":164},[819],{"type":29,"value":820}," request.get_json()\n",{"type":23,"tag":151,"props":822,"children":823},{"class":153,"line":263},[824],{"type":23,"tag":151,"props":825,"children":826},{"emptyLinePlaceholder":184},[827],{"type":29,"value":187},{"type":23,"tag":151,"props":829,"children":830},{"class":153,"line":272},[831,836,841],{"type":23,"tag":151,"props":832,"children":833},{"style":158},[834],{"type":29,"value":835},"  if",{"type":23,"tag":151,"props":837,"children":838},{"style":158},[839],{"type":29,"value":840}," not",{"type":23,"tag":151,"props":842,"children":843},{"style":164},[844],{"type":29,"value":845}," data:\n",{"type":23,"tag":151,"props":847,"children":848},{"class":153,"line":296},[849,853,858,863],{"type":23,"tag":151,"props":850,"children":851},{"style":158},[852],{"type":29,"value":336},{"type":23,"tag":151,"props":854,"children":855},{"style":164},[856],{"type":29,"value":857}," BadRequest(",{"type":23,"tag":151,"props":859,"children":860},{"style":285},[861],{"type":29,"value":862},"\"No JSON provided\"",{"type":23,"tag":151,"props":864,"children":865},{"style":164},[866],{"type":29,"value":293},{"type":23,"tag":151,"props":868,"children":869},{"class":153,"line":320},[870],{"type":23,"tag":151,"props":871,"children":872},{"emptyLinePlaceholder":184},[873],{"type":29,"value":187},{"type":23,"tag":151,"props":875,"children":876},{"class":153,"line":330},[877,881,886,890,895],{"type":23,"tag":151,"props":878,"children":879},{"style":158},[880],{"type":29,"value":835},{"type":23,"tag":151,"props":882,"children":883},{"style":285},[884],{"type":29,"value":885}," \"name\"",{"type":23,"tag":151,"props":887,"children":888},{"style":158},[889],{"type":29,"value":840},{"type":23,"tag":151,"props":891,"children":892},{"style":158},[893],{"type":29,"value":894}," in",{"type":23,"tag":151,"props":896,"children":897},{"style":164},[898],{"type":29,"value":845},{"type":23,"tag":151,"props":900,"children":902},{"class":153,"line":901},12,[903,907,911,916],{"type":23,"tag":151,"props":904,"children":905},{"style":158},[906],{"type":29,"value":336},{"type":23,"tag":151,"props":908,"children":909},{"style":164},[910],{"type":29,"value":857},{"type":23,"tag":151,"props":912,"children":913},{"style":285},[914],{"type":29,"value":915},"\"Missing name\"",{"type":23,"tag":151,"props":917,"children":918},{"style":164},[919],{"type":29,"value":293},{"type":23,"tag":151,"props":921,"children":923},{"class":153,"line":922},13,[924],{"type":23,"tag":151,"props":925,"children":926},{"emptyLinePlaceholder":184},[927],{"type":29,"value":187},{"type":23,"tag":151,"props":929,"children":931},{"class":153,"line":930},14,[932,936,940,945,950,955,960,965],{"type":23,"tag":151,"props":933,"children":934},{"style":158},[935],{"type":29,"value":835},{"type":23,"tag":151,"props":937,"children":938},{"style":158},[939],{"type":29,"value":840},{"type":23,"tag":151,"props":941,"children":942},{"style":224},[943],{"type":29,"value":944}," isinstance",{"type":23,"tag":151,"props":946,"children":947},{"style":164},[948],{"type":29,"value":949},"(data[",{"type":23,"tag":151,"props":951,"children":952},{"style":285},[953],{"type":29,"value":954},"\"name\"",{"type":23,"tag":151,"props":956,"children":957},{"style":164},[958],{"type":29,"value":959},"], ",{"type":23,"tag":151,"props":961,"children":962},{"style":224},[963],{"type":29,"value":964},"str",{"type":23,"tag":151,"props":966,"children":967},{"style":164},[968],{"type":29,"value":217},{"type":23,"tag":151,"props":970,"children":972},{"class":153,"line":971},15,[973,977,981,986],{"type":23,"tag":151,"props":974,"children":975},{"style":158},[976],{"type":29,"value":336},{"type":23,"tag":151,"props":978,"children":979},{"style":164},[980],{"type":29,"value":857},{"type":23,"tag":151,"props":982,"children":983},{"style":285},[984],{"type":29,"value":985},"\"Name must be a string\"",{"type":23,"tag":151,"props":987,"children":988},{"style":164},[989],{"type":29,"value":293},{"type":23,"tag":151,"props":991,"children":993},{"class":153,"line":992},16,[994],{"type":23,"tag":151,"props":995,"children":996},{"emptyLinePlaceholder":184},[997],{"type":29,"value":187},{"type":23,"tag":151,"props":999,"children":1001},{"class":153,"line":1000},17,[1002,1006,1011,1015,1019],{"type":23,"tag":151,"props":1003,"children":1004},{"style":158},[1005],{"type":29,"value":835},{"type":23,"tag":151,"props":1007,"children":1008},{"style":285},[1009],{"type":29,"value":1010}," \"age\"",{"type":23,"tag":151,"props":1012,"children":1013},{"style":158},[1014],{"type":29,"value":840},{"type":23,"tag":151,"props":1016,"children":1017},{"style":158},[1018],{"type":29,"value":894},{"type":23,"tag":151,"props":1020,"children":1021},{"style":164},[1022],{"type":29,"value":845},{"type":23,"tag":151,"props":1024,"children":1026},{"class":153,"line":1025},18,[1027,1031,1035,1040],{"type":23,"tag":151,"props":1028,"children":1029},{"style":158},[1030],{"type":29,"value":336},{"type":23,"tag":151,"props":1032,"children":1033},{"style":164},[1034],{"type":29,"value":857},{"type":23,"tag":151,"props":1036,"children":1037},{"style":285},[1038],{"type":29,"value":1039},"\"Missing age\"",{"type":23,"tag":151,"props":1041,"children":1042},{"style":164},[1043],{"type":29,"value":293},{"type":23,"tag":151,"props":1045,"children":1047},{"class":153,"line":1046},19,[1048],{"type":23,"tag":151,"props":1049,"children":1050},{"emptyLinePlaceholder":184},[1051],{"type":29,"value":187},{"type":23,"tag":151,"props":1053,"children":1055},{"class":153,"line":1054},20,[1056,1060,1064,1068,1072,1077,1081,1085],{"type":23,"tag":151,"props":1057,"children":1058},{"style":158},[1059],{"type":29,"value":835},{"type":23,"tag":151,"props":1061,"children":1062},{"style":158},[1063],{"type":29,"value":840},{"type":23,"tag":151,"props":1065,"children":1066},{"style":224},[1067],{"type":29,"value":944},{"type":23,"tag":151,"props":1069,"children":1070},{"style":164},[1071],{"type":29,"value":949},{"type":23,"tag":151,"props":1073,"children":1074},{"style":285},[1075],{"type":29,"value":1076},"\"age\"",{"type":23,"tag":151,"props":1078,"children":1079},{"style":164},[1080],{"type":29,"value":959},{"type":23,"tag":151,"props":1082,"children":1083},{"style":224},[1084],{"type":29,"value":527},{"type":23,"tag":151,"props":1086,"children":1087},{"style":164},[1088],{"type":29,"value":217},{"type":23,"tag":151,"props":1090,"children":1092},{"class":153,"line":1091},21,[1093,1097,1101,1106],{"type":23,"tag":151,"props":1094,"children":1095},{"style":158},[1096],{"type":29,"value":336},{"type":23,"tag":151,"props":1098,"children":1099},{"style":164},[1100],{"type":29,"value":857},{"type":23,"tag":151,"props":1102,"children":1103},{"style":285},[1104],{"type":29,"value":1105},"\"Age must be an integer\"",{"type":23,"tag":151,"props":1107,"children":1108},{"style":164},[1109],{"type":29,"value":293},{"type":23,"tag":151,"props":1111,"children":1113},{"class":153,"line":1112},22,[1114],{"type":23,"tag":151,"props":1115,"children":1116},{"emptyLinePlaceholder":184},[1117],{"type":29,"value":187},{"type":23,"tag":151,"props":1119,"children":1121},{"class":153,"line":1120},23,[1122],{"type":23,"tag":151,"props":1123,"children":1124},{"style":324},[1125],{"type":29,"value":1126},"  # ... etc for each field to be validated\n",{"type":23,"tag":151,"props":1128,"children":1130},{"class":153,"line":1129},24,[1131],{"type":23,"tag":151,"props":1132,"children":1133},{"emptyLinePlaceholder":184},[1134],{"type":29,"value":187},{"type":23,"tag":151,"props":1136,"children":1138},{"class":153,"line":1137},25,[1139],{"type":23,"tag":151,"props":1140,"children":1141},{"style":324},[1142],{"type":29,"value":1143},"  # ... Create the user ...\n",{"type":23,"tag":151,"props":1145,"children":1147},{"class":153,"line":1146},26,[1148],{"type":23,"tag":151,"props":1149,"children":1150},{"style":164},[1151],{"type":29,"value":1152},"  \n",{"type":23,"tag":151,"props":1154,"children":1156},{"class":153,"line":1155},27,[1157,1162],{"type":23,"tag":151,"props":1158,"children":1159},{"style":158},[1160],{"type":29,"value":1161},"  return",{"type":23,"tag":151,"props":1163,"children":1164},{"style":164},[1165],{"type":29,"value":341},{"type":23,"tag":32,"props":1167,"children":1168},{},[1169],{"type":29,"value":1170},"The same validation in FastAPI:",{"type":23,"tag":141,"props":1172,"children":1174},{"className":143,"code":1173,"language":12,"meta":8,"style":8},"from pydantic import BaseModel\n\nclass User(BaseModel):\n  name: str\n  age: int\n  # ...etc\n\n@app.post(\"/users\")\nasync def create_user(user: User):\n   # All input data is validated against the User model automatically, returning a 422 error if validation fails\n\n   # ... Create the user ...\n\n  return user\n",[1175],{"type":23,"tag":147,"props":1176,"children":1177},{"__ignoreMap":8},[1178,1197,1204,1227,1239,1251,1259,1266,1285,1304,1312,1319,1327,1334],{"type":23,"tag":151,"props":1179,"children":1180},{"class":153,"line":154},[1181,1185,1189,1193],{"type":23,"tag":151,"props":1182,"children":1183},{"style":158},[1184],{"type":29,"value":161},{"type":23,"tag":151,"props":1186,"children":1187},{"style":164},[1188],{"type":29,"value":167},{"type":23,"tag":151,"props":1190,"children":1191},{"style":158},[1192],{"type":29,"value":172},{"type":23,"tag":151,"props":1194,"children":1195},{"style":164},[1196],{"type":29,"value":177},{"type":23,"tag":151,"props":1198,"children":1199},{"class":153,"line":180},[1200],{"type":23,"tag":151,"props":1201,"children":1202},{"emptyLinePlaceholder":184},[1203],{"type":29,"value":187},{"type":23,"tag":151,"props":1205,"children":1206},{"class":153,"line":190},[1207,1211,1215,1219,1223],{"type":23,"tag":151,"props":1208,"children":1209},{"style":158},[1210],{"type":29,"value":196},{"type":23,"tag":151,"props":1212,"children":1213},{"style":199},[1214],{"type":29,"value":202},{"type":23,"tag":151,"props":1216,"children":1217},{"style":164},[1218],{"type":29,"value":207},{"type":23,"tag":151,"props":1220,"children":1221},{"style":199},[1222],{"type":29,"value":212},{"type":23,"tag":151,"props":1224,"children":1225},{"style":164},[1226],{"type":29,"value":217},{"type":23,"tag":151,"props":1228,"children":1229},{"class":153,"line":220},[1230,1235],{"type":23,"tag":151,"props":1231,"children":1232},{"style":164},[1233],{"type":29,"value":1234},"  name: ",{"type":23,"tag":151,"props":1236,"children":1237},{"style":224},[1238],{"type":29,"value":251},{"type":23,"tag":151,"props":1240,"children":1241},{"class":153,"line":240},[1242,1247],{"type":23,"tag":151,"props":1243,"children":1244},{"style":164},[1245],{"type":29,"value":1246},"  age: ",{"type":23,"tag":151,"props":1248,"children":1249},{"style":224},[1250],{"type":29,"value":237},{"type":23,"tag":151,"props":1252,"children":1253},{"class":153,"line":254},[1254],{"type":23,"tag":151,"props":1255,"children":1256},{"style":324},[1257],{"type":29,"value":1258},"  # ...etc\n",{"type":23,"tag":151,"props":1260,"children":1261},{"class":153,"line":263},[1262],{"type":23,"tag":151,"props":1263,"children":1264},{"emptyLinePlaceholder":184},[1265],{"type":29,"value":187},{"type":23,"tag":151,"props":1267,"children":1268},{"class":153,"line":272},[1269,1273,1277,1281],{"type":23,"tag":151,"props":1270,"children":1271},{"style":199},[1272],{"type":29,"value":278},{"type":23,"tag":151,"props":1274,"children":1275},{"style":164},[1276],{"type":29,"value":207},{"type":23,"tag":151,"props":1278,"children":1279},{"style":285},[1280],{"type":29,"value":288},{"type":23,"tag":151,"props":1282,"children":1283},{"style":164},[1284],{"type":29,"value":293},{"type":23,"tag":151,"props":1286,"children":1287},{"class":153,"line":296},[1288,1292,1296,1300],{"type":23,"tag":151,"props":1289,"children":1290},{"style":158},[1291],{"type":29,"value":302},{"type":23,"tag":151,"props":1293,"children":1294},{"style":158},[1295],{"type":29,"value":307},{"type":23,"tag":151,"props":1297,"children":1298},{"style":199},[1299],{"type":29,"value":312},{"type":23,"tag":151,"props":1301,"children":1302},{"style":164},[1303],{"type":29,"value":317},{"type":23,"tag":151,"props":1305,"children":1306},{"class":153,"line":320},[1307],{"type":23,"tag":151,"props":1308,"children":1309},{"style":324},[1310],{"type":29,"value":1311},"   # All input data is validated against the User model automatically, returning a 422 error if validation fails\n",{"type":23,"tag":151,"props":1313,"children":1314},{"class":153,"line":330},[1315],{"type":23,"tag":151,"props":1316,"children":1317},{"emptyLinePlaceholder":184},[1318],{"type":29,"value":187},{"type":23,"tag":151,"props":1320,"children":1321},{"class":153,"line":901},[1322],{"type":23,"tag":151,"props":1323,"children":1324},{"style":324},[1325],{"type":29,"value":1326},"   # ... Create the user ...\n",{"type":23,"tag":151,"props":1328,"children":1329},{"class":153,"line":922},[1330],{"type":23,"tag":151,"props":1331,"children":1332},{"emptyLinePlaceholder":184},[1333],{"type":29,"value":187},{"type":23,"tag":151,"props":1335,"children":1336},{"class":153,"line":930},[1337,1341],{"type":23,"tag":151,"props":1338,"children":1339},{"style":158},[1340],{"type":29,"value":1161},{"type":23,"tag":151,"props":1342,"children":1343},{"style":164},[1344],{"type":29,"value":341},{"type":23,"tag":32,"props":1346,"children":1347},{},[1348],{"type":29,"value":1349},"FastAPI also allows for validating the output data, like so:",{"type":23,"tag":141,"props":1351,"children":1353},{"className":143,"code":1352,"language":12,"meta":8,"style":8},"from pydantic import BaseModel\n\nclass User(BaseModel):\n  name: str\n  age: int\n  # ...etc\n\nclass UserOut(BaseModel):\n  name: str\n  age: int\n  # ...etc\n\n@app.post(\"/users\", response_model=UserOut)\nasync def create_user(user: User):\n   # All input data is validated against the User model automatically, returning a 422 error if validation fails\n\n   # ... Create the user ...\n\n  return user\n",[1354],{"type":23,"tag":147,"props":1355,"children":1356},{"__ignoreMap":8},[1357,1376,1383,1406,1417,1428,1435,1442,1466,1477,1488,1495,1502,1535,1554,1561,1568,1575,1582],{"type":23,"tag":151,"props":1358,"children":1359},{"class":153,"line":154},[1360,1364,1368,1372],{"type":23,"tag":151,"props":1361,"children":1362},{"style":158},[1363],{"type":29,"value":161},{"type":23,"tag":151,"props":1365,"children":1366},{"style":164},[1367],{"type":29,"value":167},{"type":23,"tag":151,"props":1369,"children":1370},{"style":158},[1371],{"type":29,"value":172},{"type":23,"tag":151,"props":1373,"children":1374},{"style":164},[1375],{"type":29,"value":177},{"type":23,"tag":151,"props":1377,"children":1378},{"class":153,"line":180},[1379],{"type":23,"tag":151,"props":1380,"children":1381},{"emptyLinePlaceholder":184},[1382],{"type":29,"value":187},{"type":23,"tag":151,"props":1384,"children":1385},{"class":153,"line":190},[1386,1390,1394,1398,1402],{"type":23,"tag":151,"props":1387,"children":1388},{"style":158},[1389],{"type":29,"value":196},{"type":23,"tag":151,"props":1391,"children":1392},{"style":199},[1393],{"type":29,"value":202},{"type":23,"tag":151,"props":1395,"children":1396},{"style":164},[1397],{"type":29,"value":207},{"type":23,"tag":151,"props":1399,"children":1400},{"style":199},[1401],{"type":29,"value":212},{"type":23,"tag":151,"props":1403,"children":1404},{"style":164},[1405],{"type":29,"value":217},{"type":23,"tag":151,"props":1407,"children":1408},{"class":153,"line":220},[1409,1413],{"type":23,"tag":151,"props":1410,"children":1411},{"style":164},[1412],{"type":29,"value":1234},{"type":23,"tag":151,"props":1414,"children":1415},{"style":224},[1416],{"type":29,"value":251},{"type":23,"tag":151,"props":1418,"children":1419},{"class":153,"line":240},[1420,1424],{"type":23,"tag":151,"props":1421,"children":1422},{"style":164},[1423],{"type":29,"value":1246},{"type":23,"tag":151,"props":1425,"children":1426},{"style":224},[1427],{"type":29,"value":237},{"type":23,"tag":151,"props":1429,"children":1430},{"class":153,"line":254},[1431],{"type":23,"tag":151,"props":1432,"children":1433},{"style":324},[1434],{"type":29,"value":1258},{"type":23,"tag":151,"props":1436,"children":1437},{"class":153,"line":263},[1438],{"type":23,"tag":151,"props":1439,"children":1440},{"emptyLinePlaceholder":184},[1441],{"type":29,"value":187},{"type":23,"tag":151,"props":1443,"children":1444},{"class":153,"line":272},[1445,1449,1454,1458,1462],{"type":23,"tag":151,"props":1446,"children":1447},{"style":158},[1448],{"type":29,"value":196},{"type":23,"tag":151,"props":1450,"children":1451},{"style":199},[1452],{"type":29,"value":1453}," UserOut",{"type":23,"tag":151,"props":1455,"children":1456},{"style":164},[1457],{"type":29,"value":207},{"type":23,"tag":151,"props":1459,"children":1460},{"style":199},[1461],{"type":29,"value":212},{"type":23,"tag":151,"props":1463,"children":1464},{"style":164},[1465],{"type":29,"value":217},{"type":23,"tag":151,"props":1467,"children":1468},{"class":153,"line":296},[1469,1473],{"type":23,"tag":151,"props":1470,"children":1471},{"style":164},[1472],{"type":29,"value":1234},{"type":23,"tag":151,"props":1474,"children":1475},{"style":224},[1476],{"type":29,"value":251},{"type":23,"tag":151,"props":1478,"children":1479},{"class":153,"line":320},[1480,1484],{"type":23,"tag":151,"props":1481,"children":1482},{"style":164},[1483],{"type":29,"value":1246},{"type":23,"tag":151,"props":1485,"children":1486},{"style":224},[1487],{"type":29,"value":237},{"type":23,"tag":151,"props":1489,"children":1490},{"class":153,"line":330},[1491],{"type":23,"tag":151,"props":1492,"children":1493},{"style":324},[1494],{"type":29,"value":1258},{"type":23,"tag":151,"props":1496,"children":1497},{"class":153,"line":901},[1498],{"type":23,"tag":151,"props":1499,"children":1500},{"emptyLinePlaceholder":184},[1501],{"type":29,"value":187},{"type":23,"tag":151,"props":1503,"children":1504},{"class":153,"line":922},[1505,1509,1513,1517,1521,1526,1530],{"type":23,"tag":151,"props":1506,"children":1507},{"style":199},[1508],{"type":29,"value":278},{"type":23,"tag":151,"props":1510,"children":1511},{"style":164},[1512],{"type":29,"value":207},{"type":23,"tag":151,"props":1514,"children":1515},{"style":285},[1516],{"type":29,"value":288},{"type":23,"tag":151,"props":1518,"children":1519},{"style":164},[1520],{"type":29,"value":370},{"type":23,"tag":151,"props":1522,"children":1523},{"style":764},[1524],{"type":29,"value":1525},"response_model",{"type":23,"tag":151,"props":1527,"children":1528},{"style":158},[1529],{"type":29,"value":544},{"type":23,"tag":151,"props":1531,"children":1532},{"style":164},[1533],{"type":29,"value":1534},"UserOut)\n",{"type":23,"tag":151,"props":1536,"children":1537},{"class":153,"line":930},[1538,1542,1546,1550],{"type":23,"tag":151,"props":1539,"children":1540},{"style":158},[1541],{"type":29,"value":302},{"type":23,"tag":151,"props":1543,"children":1544},{"style":158},[1545],{"type":29,"value":307},{"type":23,"tag":151,"props":1547,"children":1548},{"style":199},[1549],{"type":29,"value":312},{"type":23,"tag":151,"props":1551,"children":1552},{"style":164},[1553],{"type":29,"value":317},{"type":23,"tag":151,"props":1555,"children":1556},{"class":153,"line":971},[1557],{"type":23,"tag":151,"props":1558,"children":1559},{"style":324},[1560],{"type":29,"value":1311},{"type":23,"tag":151,"props":1562,"children":1563},{"class":153,"line":992},[1564],{"type":23,"tag":151,"props":1565,"children":1566},{"emptyLinePlaceholder":184},[1567],{"type":29,"value":187},{"type":23,"tag":151,"props":1569,"children":1570},{"class":153,"line":1000},[1571],{"type":23,"tag":151,"props":1572,"children":1573},{"style":324},[1574],{"type":29,"value":1326},{"type":23,"tag":151,"props":1576,"children":1577},{"class":153,"line":1025},[1578],{"type":23,"tag":151,"props":1579,"children":1580},{"emptyLinePlaceholder":184},[1581],{"type":29,"value":187},{"type":23,"tag":151,"props":1583,"children":1584},{"class":153,"line":1046},[1585,1589],{"type":23,"tag":151,"props":1586,"children":1587},{"style":158},[1588],{"type":29,"value":1161},{"type":23,"tag":151,"props":1590,"children":1591},{"style":164},[1592],{"type":29,"value":341},{"type":23,"tag":32,"props":1594,"children":1595},{},[1596,1598,1603,1605,1611],{"type":29,"value":1597},"In this example, the ",{"type":23,"tag":147,"props":1599,"children":1601},{"className":1600},[],[1602],{"type":29,"value":1525},{"type":29,"value":1604}," parameter validates the output User object against the ",{"type":23,"tag":147,"props":1606,"children":1608},{"className":1607},[],[1609],{"type":29,"value":1610},"UserOut",{"type":29,"value":1612}," model, returning a 422 error if validation fails. This ensures that the output data matches the expected format, and also assists in generating more detailed documentation.",{"type":23,"tag":117,"props":1614,"children":1616},{"id":1615},"api-documentation-in-flask",[1617],{"type":29,"value":1618},"API Documentation in Flask",{"type":23,"tag":32,"props":1620,"children":1621},{},[1622],{"type":29,"value":1623},"Generating comprehensive API documentation in Flask requires installing extensions, configuring swagger, and decorating routes:",{"type":23,"tag":141,"props":1625,"children":1627},{"className":143,"code":1626,"language":12,"meta":8,"style":8},"from flask import Flask\nfrom flask_swagger_ui import get_swaggerui_blueprint\nfrom flasgger import Swagger, swag_from\n\napp = Flask(__name__)\n\n### Required Swagger setup ###\nSWAGGER_URL = '/api/docs'\nAPI_URL = '/static/swagger.json'\nSWAGGERUI_BLUEPRINT = get_swaggerui_blueprint(\n    SWAGGER_URL,\n    API_URL,\n    config={\n        'app_name': \"My App\"\n    }\n)\napp.register_blueprint(SWAGGERUI_BLUEPRINT, url_prefix=SWAGGER_URL)\n### End Swagger setup ###\n\n\n@app.route('/users', methods=['GET'])\n@swag_from('swagger/users.yml')\ndef get_users():\n  \"\"\"Gets list of users.\n  \n  ---\n  get:\n    description: Returns list of users\n    responses:\n      200:\n        description: Successful response\n        content:\n          application/json:\n            schema:\n              type: array\n              items:\n                type: object\n                properties:\n                  id: \n                    type: integer\n                  name:\n                    type: string\n  \"\"\"\n  pass \n\nif __name__ == \"__main__\":\n    app.run()\n",[1628],{"type":23,"tag":147,"props":1629,"children":1630},{"__ignoreMap":8},[1631,1651,1672,1693,1700,1726,1733,1741,1759,1776,1793,1806,1818,1835,1852,1860,1867,1900,1908,1915,1922,1964,1985,2001,2009,2016,2024,2032,2041,2050,2059,2068,2077,2086,2095,2104,2113,2122,2131,2140,2149,2158,2167,2176,2190,2198,2227],{"type":23,"tag":151,"props":1632,"children":1633},{"class":153,"line":154},[1634,1638,1642,1646],{"type":23,"tag":151,"props":1635,"children":1636},{"style":158},[1637],{"type":29,"value":161},{"type":23,"tag":151,"props":1639,"children":1640},{"style":164},[1641],{"type":29,"value":704},{"type":23,"tag":151,"props":1643,"children":1644},{"style":158},[1645],{"type":29,"value":172},{"type":23,"tag":151,"props":1647,"children":1648},{"style":164},[1649],{"type":29,"value":1650}," Flask\n",{"type":23,"tag":151,"props":1652,"children":1653},{"class":153,"line":180},[1654,1658,1663,1667],{"type":23,"tag":151,"props":1655,"children":1656},{"style":158},[1657],{"type":29,"value":161},{"type":23,"tag":151,"props":1659,"children":1660},{"style":164},[1661],{"type":29,"value":1662}," flask_swagger_ui ",{"type":23,"tag":151,"props":1664,"children":1665},{"style":158},[1666],{"type":29,"value":172},{"type":23,"tag":151,"props":1668,"children":1669},{"style":164},[1670],{"type":29,"value":1671}," get_swaggerui_blueprint\n",{"type":23,"tag":151,"props":1673,"children":1674},{"class":153,"line":190},[1675,1679,1684,1688],{"type":23,"tag":151,"props":1676,"children":1677},{"style":158},[1678],{"type":29,"value":161},{"type":23,"tag":151,"props":1680,"children":1681},{"style":164},[1682],{"type":29,"value":1683}," flasgger ",{"type":23,"tag":151,"props":1685,"children":1686},{"style":158},[1687],{"type":29,"value":172},{"type":23,"tag":151,"props":1689,"children":1690},{"style":164},[1691],{"type":29,"value":1692}," Swagger, swag_from\n",{"type":23,"tag":151,"props":1694,"children":1695},{"class":153,"line":220},[1696],{"type":23,"tag":151,"props":1697,"children":1698},{"emptyLinePlaceholder":184},[1699],{"type":29,"value":187},{"type":23,"tag":151,"props":1701,"children":1702},{"class":153,"line":240},[1703,1708,1712,1717,1722],{"type":23,"tag":151,"props":1704,"children":1705},{"style":164},[1706],{"type":29,"value":1707},"app ",{"type":23,"tag":151,"props":1709,"children":1710},{"style":158},[1711],{"type":29,"value":544},{"type":23,"tag":151,"props":1713,"children":1714},{"style":164},[1715],{"type":29,"value":1716}," Flask(",{"type":23,"tag":151,"props":1718,"children":1719},{"style":224},[1720],{"type":29,"value":1721},"__name__",{"type":23,"tag":151,"props":1723,"children":1724},{"style":164},[1725],{"type":29,"value":293},{"type":23,"tag":151,"props":1727,"children":1728},{"class":153,"line":254},[1729],{"type":23,"tag":151,"props":1730,"children":1731},{"emptyLinePlaceholder":184},[1732],{"type":29,"value":187},{"type":23,"tag":151,"props":1734,"children":1735},{"class":153,"line":263},[1736],{"type":23,"tag":151,"props":1737,"children":1738},{"style":324},[1739],{"type":29,"value":1740},"### Required Swagger setup ###\n",{"type":23,"tag":151,"props":1742,"children":1743},{"class":153,"line":272},[1744,1749,1754],{"type":23,"tag":151,"props":1745,"children":1746},{"style":224},[1747],{"type":29,"value":1748},"SWAGGER_URL",{"type":23,"tag":151,"props":1750,"children":1751},{"style":158},[1752],{"type":29,"value":1753}," =",{"type":23,"tag":151,"props":1755,"children":1756},{"style":285},[1757],{"type":29,"value":1758}," '/api/docs'\n",{"type":23,"tag":151,"props":1760,"children":1761},{"class":153,"line":296},[1762,1767,1771],{"type":23,"tag":151,"props":1763,"children":1764},{"style":224},[1765],{"type":29,"value":1766},"API_URL",{"type":23,"tag":151,"props":1768,"children":1769},{"style":158},[1770],{"type":29,"value":1753},{"type":23,"tag":151,"props":1772,"children":1773},{"style":285},[1774],{"type":29,"value":1775}," '/static/swagger.json'\n",{"type":23,"tag":151,"props":1777,"children":1778},{"class":153,"line":320},[1779,1784,1788],{"type":23,"tag":151,"props":1780,"children":1781},{"style":224},[1782],{"type":29,"value":1783},"SWAGGERUI_BLUEPRINT",{"type":23,"tag":151,"props":1785,"children":1786},{"style":158},[1787],{"type":29,"value":1753},{"type":23,"tag":151,"props":1789,"children":1790},{"style":164},[1791],{"type":29,"value":1792}," get_swaggerui_blueprint(\n",{"type":23,"tag":151,"props":1794,"children":1795},{"class":153,"line":330},[1796,1801],{"type":23,"tag":151,"props":1797,"children":1798},{"style":224},[1799],{"type":29,"value":1800},"    SWAGGER_URL",{"type":23,"tag":151,"props":1802,"children":1803},{"style":164},[1804],{"type":29,"value":1805},",\n",{"type":23,"tag":151,"props":1807,"children":1808},{"class":153,"line":901},[1809,1814],{"type":23,"tag":151,"props":1810,"children":1811},{"style":224},[1812],{"type":29,"value":1813},"    API_URL",{"type":23,"tag":151,"props":1815,"children":1816},{"style":164},[1817],{"type":29,"value":1805},{"type":23,"tag":151,"props":1819,"children":1820},{"class":153,"line":922},[1821,1826,1830],{"type":23,"tag":151,"props":1822,"children":1823},{"style":764},[1824],{"type":29,"value":1825},"    config",{"type":23,"tag":151,"props":1827,"children":1828},{"style":158},[1829],{"type":29,"value":544},{"type":23,"tag":151,"props":1831,"children":1832},{"style":164},[1833],{"type":29,"value":1834},"{\n",{"type":23,"tag":151,"props":1836,"children":1837},{"class":153,"line":930},[1838,1843,1847],{"type":23,"tag":151,"props":1839,"children":1840},{"style":285},[1841],{"type":29,"value":1842},"        'app_name'",{"type":23,"tag":151,"props":1844,"children":1845},{"style":164},[1846],{"type":29,"value":232},{"type":23,"tag":151,"props":1848,"children":1849},{"style":285},[1850],{"type":29,"value":1851},"\"My App\"\n",{"type":23,"tag":151,"props":1853,"children":1854},{"class":153,"line":971},[1855],{"type":23,"tag":151,"props":1856,"children":1857},{"style":164},[1858],{"type":29,"value":1859},"    }\n",{"type":23,"tag":151,"props":1861,"children":1862},{"class":153,"line":992},[1863],{"type":23,"tag":151,"props":1864,"children":1865},{"style":164},[1866],{"type":29,"value":293},{"type":23,"tag":151,"props":1868,"children":1869},{"class":153,"line":1000},[1870,1875,1879,1883,1888,1892,1896],{"type":23,"tag":151,"props":1871,"children":1872},{"style":164},[1873],{"type":29,"value":1874},"app.register_blueprint(",{"type":23,"tag":151,"props":1876,"children":1877},{"style":224},[1878],{"type":29,"value":1783},{"type":23,"tag":151,"props":1880,"children":1881},{"style":164},[1882],{"type":29,"value":370},{"type":23,"tag":151,"props":1884,"children":1885},{"style":764},[1886],{"type":29,"value":1887},"url_prefix",{"type":23,"tag":151,"props":1889,"children":1890},{"style":158},[1891],{"type":29,"value":544},{"type":23,"tag":151,"props":1893,"children":1894},{"style":224},[1895],{"type":29,"value":1748},{"type":23,"tag":151,"props":1897,"children":1898},{"style":164},[1899],{"type":29,"value":293},{"type":23,"tag":151,"props":1901,"children":1902},{"class":153,"line":1025},[1903],{"type":23,"tag":151,"props":1904,"children":1905},{"style":324},[1906],{"type":29,"value":1907},"### End Swagger setup ###\n",{"type":23,"tag":151,"props":1909,"children":1910},{"class":153,"line":1046},[1911],{"type":23,"tag":151,"props":1912,"children":1913},{"emptyLinePlaceholder":184},[1914],{"type":29,"value":187},{"type":23,"tag":151,"props":1916,"children":1917},{"class":153,"line":1054},[1918],{"type":23,"tag":151,"props":1919,"children":1920},{"emptyLinePlaceholder":184},[1921],{"type":29,"value":187},{"type":23,"tag":151,"props":1923,"children":1924},{"class":153,"line":1091},[1925,1929,1933,1938,1942,1946,1950,1954,1959],{"type":23,"tag":151,"props":1926,"children":1927},{"style":199},[1928],{"type":29,"value":749},{"type":23,"tag":151,"props":1930,"children":1931},{"style":164},[1932],{"type":29,"value":207},{"type":23,"tag":151,"props":1934,"children":1935},{"style":285},[1936],{"type":29,"value":1937},"'/users'",{"type":23,"tag":151,"props":1939,"children":1940},{"style":164},[1941],{"type":29,"value":370},{"type":23,"tag":151,"props":1943,"children":1944},{"style":764},[1945],{"type":29,"value":767},{"type":23,"tag":151,"props":1947,"children":1948},{"style":158},[1949],{"type":29,"value":544},{"type":23,"tag":151,"props":1951,"children":1952},{"style":164},[1953],{"type":29,"value":776},{"type":23,"tag":151,"props":1955,"children":1956},{"style":285},[1957],{"type":29,"value":1958},"'GET'",{"type":23,"tag":151,"props":1960,"children":1961},{"style":164},[1962],{"type":29,"value":1963},"])\n",{"type":23,"tag":151,"props":1965,"children":1966},{"class":153,"line":1112},[1967,1972,1976,1981],{"type":23,"tag":151,"props":1968,"children":1969},{"style":199},[1970],{"type":29,"value":1971},"@swag_from",{"type":23,"tag":151,"props":1973,"children":1974},{"style":164},[1975],{"type":29,"value":207},{"type":23,"tag":151,"props":1977,"children":1978},{"style":285},[1979],{"type":29,"value":1980},"'swagger/users.yml'",{"type":23,"tag":151,"props":1982,"children":1983},{"style":164},[1984],{"type":29,"value":293},{"type":23,"tag":151,"props":1986,"children":1987},{"class":153,"line":1120},[1988,1992,1997],{"type":23,"tag":151,"props":1989,"children":1990},{"style":158},[1991],{"type":29,"value":794},{"type":23,"tag":151,"props":1993,"children":1994},{"style":199},[1995],{"type":29,"value":1996}," get_users",{"type":23,"tag":151,"props":1998,"children":1999},{"style":164},[2000],{"type":29,"value":803},{"type":23,"tag":151,"props":2002,"children":2003},{"class":153,"line":1129},[2004],{"type":23,"tag":151,"props":2005,"children":2006},{"style":285},[2007],{"type":29,"value":2008},"  \"\"\"Gets list of users.\n",{"type":23,"tag":151,"props":2010,"children":2011},{"class":153,"line":1137},[2012],{"type":23,"tag":151,"props":2013,"children":2014},{"style":285},[2015],{"type":29,"value":1152},{"type":23,"tag":151,"props":2017,"children":2018},{"class":153,"line":1146},[2019],{"type":23,"tag":151,"props":2020,"children":2021},{"style":285},[2022],{"type":29,"value":2023},"  ---\n",{"type":23,"tag":151,"props":2025,"children":2026},{"class":153,"line":1155},[2027],{"type":23,"tag":151,"props":2028,"children":2029},{"style":285},[2030],{"type":29,"value":2031},"  get:\n",{"type":23,"tag":151,"props":2033,"children":2035},{"class":153,"line":2034},28,[2036],{"type":23,"tag":151,"props":2037,"children":2038},{"style":285},[2039],{"type":29,"value":2040},"    description: Returns list of users\n",{"type":23,"tag":151,"props":2042,"children":2044},{"class":153,"line":2043},29,[2045],{"type":23,"tag":151,"props":2046,"children":2047},{"style":285},[2048],{"type":29,"value":2049},"    responses:\n",{"type":23,"tag":151,"props":2051,"children":2053},{"class":153,"line":2052},30,[2054],{"type":23,"tag":151,"props":2055,"children":2056},{"style":285},[2057],{"type":29,"value":2058},"      200:\n",{"type":23,"tag":151,"props":2060,"children":2062},{"class":153,"line":2061},31,[2063],{"type":23,"tag":151,"props":2064,"children":2065},{"style":285},[2066],{"type":29,"value":2067},"        description: Successful response\n",{"type":23,"tag":151,"props":2069,"children":2071},{"class":153,"line":2070},32,[2072],{"type":23,"tag":151,"props":2073,"children":2074},{"style":285},[2075],{"type":29,"value":2076},"        content:\n",{"type":23,"tag":151,"props":2078,"children":2080},{"class":153,"line":2079},33,[2081],{"type":23,"tag":151,"props":2082,"children":2083},{"style":285},[2084],{"type":29,"value":2085},"          application/json:\n",{"type":23,"tag":151,"props":2087,"children":2089},{"class":153,"line":2088},34,[2090],{"type":23,"tag":151,"props":2091,"children":2092},{"style":285},[2093],{"type":29,"value":2094},"            schema:\n",{"type":23,"tag":151,"props":2096,"children":2098},{"class":153,"line":2097},35,[2099],{"type":23,"tag":151,"props":2100,"children":2101},{"style":285},[2102],{"type":29,"value":2103},"              type: array\n",{"type":23,"tag":151,"props":2105,"children":2107},{"class":153,"line":2106},36,[2108],{"type":23,"tag":151,"props":2109,"children":2110},{"style":285},[2111],{"type":29,"value":2112},"              items:\n",{"type":23,"tag":151,"props":2114,"children":2116},{"class":153,"line":2115},37,[2117],{"type":23,"tag":151,"props":2118,"children":2119},{"style":285},[2120],{"type":29,"value":2121},"                type: object\n",{"type":23,"tag":151,"props":2123,"children":2125},{"class":153,"line":2124},38,[2126],{"type":23,"tag":151,"props":2127,"children":2128},{"style":285},[2129],{"type":29,"value":2130},"                properties:\n",{"type":23,"tag":151,"props":2132,"children":2134},{"class":153,"line":2133},39,[2135],{"type":23,"tag":151,"props":2136,"children":2137},{"style":285},[2138],{"type":29,"value":2139},"                  id: \n",{"type":23,"tag":151,"props":2141,"children":2143},{"class":153,"line":2142},40,[2144],{"type":23,"tag":151,"props":2145,"children":2146},{"style":285},[2147],{"type":29,"value":2148},"                    type: integer\n",{"type":23,"tag":151,"props":2150,"children":2152},{"class":153,"line":2151},41,[2153],{"type":23,"tag":151,"props":2154,"children":2155},{"style":285},[2156],{"type":29,"value":2157},"                  name:\n",{"type":23,"tag":151,"props":2159,"children":2161},{"class":153,"line":2160},42,[2162],{"type":23,"tag":151,"props":2163,"children":2164},{"style":285},[2165],{"type":29,"value":2166},"                    type: string\n",{"type":23,"tag":151,"props":2168,"children":2170},{"class":153,"line":2169},43,[2171],{"type":23,"tag":151,"props":2172,"children":2173},{"style":285},[2174],{"type":29,"value":2175},"  \"\"\"\n",{"type":23,"tag":151,"props":2177,"children":2179},{"class":153,"line":2178},44,[2180,2185],{"type":23,"tag":151,"props":2181,"children":2182},{"style":158},[2183],{"type":29,"value":2184},"  pass",{"type":23,"tag":151,"props":2186,"children":2187},{"style":164},[2188],{"type":29,"value":2189}," \n",{"type":23,"tag":151,"props":2191,"children":2193},{"class":153,"line":2192},45,[2194],{"type":23,"tag":151,"props":2195,"children":2196},{"emptyLinePlaceholder":184},[2197],{"type":29,"value":187},{"type":23,"tag":151,"props":2199,"children":2201},{"class":153,"line":2200},46,[2202,2207,2212,2217,2222],{"type":23,"tag":151,"props":2203,"children":2204},{"style":158},[2205],{"type":29,"value":2206},"if",{"type":23,"tag":151,"props":2208,"children":2209},{"style":224},[2210],{"type":29,"value":2211}," __name__",{"type":23,"tag":151,"props":2213,"children":2214},{"style":158},[2215],{"type":29,"value":2216}," ==",{"type":23,"tag":151,"props":2218,"children":2219},{"style":285},[2220],{"type":29,"value":2221}," \"__main__\"",{"type":23,"tag":151,"props":2223,"children":2224},{"style":164},[2225],{"type":29,"value":2226},":\n",{"type":23,"tag":151,"props":2228,"children":2230},{"class":153,"line":2229},47,[2231],{"type":23,"tag":151,"props":2232,"children":2233},{"style":164},[2234],{"type":29,"value":2235},"    app.run()\n",{"type":23,"tag":32,"props":2237,"children":2238},{},[2239,2241,2247],{"type":29,"value":2240},"The Swagger spec must be explicitly configured and ",{"type":23,"tag":147,"props":2242,"children":2244},{"className":2243},[],[2245],{"type":29,"value":2246},"flask-swagger-ui",{"type":29,"value":2248}," registered to serve docs. API routes require decorators to define schema and parameters. This is a lot of overhead to keep documentation in sync.",{"type":23,"tag":117,"props":2250,"children":2252},{"id":2251},"api-documentation-in-fastapi",[2253],{"type":29,"value":2254},"API Documentation in FastAPI",{"type":23,"tag":32,"props":2256,"children":2257},{},[2258],{"type":29,"value":2259},"FastAPI automatically generates OpenAPI schemas and Swagger UI interactive documentation:",{"type":23,"tag":141,"props":2261,"children":2263},{"className":143,"code":2262,"language":12,"meta":8,"style":8},"from fastapi import FastAPI\n\napp = FastAPI()\n\nclass UserOut(BaseModel):\n  id: int\n  name: str\n\n@app.get(\"/users\", response_model=list[UserOut])\nasync def get_users():\n    return [{\"id\": 1, \"name\": \"John\"}]\n\nif __name__ == \"__main__\":\n    import uvicorn\n    uvicorn.run(app)\n",[2264],{"type":23,"tag":147,"props":2265,"children":2266},{"__ignoreMap":8},[2267,2288,2295,2311,2318,2341,2357,2368,2375,2407,2426,2474,2481,2504,2517],{"type":23,"tag":151,"props":2268,"children":2269},{"class":153,"line":154},[2270,2274,2279,2283],{"type":23,"tag":151,"props":2271,"children":2272},{"style":158},[2273],{"type":29,"value":161},{"type":23,"tag":151,"props":2275,"children":2276},{"style":164},[2277],{"type":29,"value":2278}," fastapi ",{"type":23,"tag":151,"props":2280,"children":2281},{"style":158},[2282],{"type":29,"value":172},{"type":23,"tag":151,"props":2284,"children":2285},{"style":164},[2286],{"type":29,"value":2287}," FastAPI\n",{"type":23,"tag":151,"props":2289,"children":2290},{"class":153,"line":180},[2291],{"type":23,"tag":151,"props":2292,"children":2293},{"emptyLinePlaceholder":184},[2294],{"type":29,"value":187},{"type":23,"tag":151,"props":2296,"children":2297},{"class":153,"line":190},[2298,2302,2306],{"type":23,"tag":151,"props":2299,"children":2300},{"style":164},[2301],{"type":29,"value":1707},{"type":23,"tag":151,"props":2303,"children":2304},{"style":158},[2305],{"type":29,"value":544},{"type":23,"tag":151,"props":2307,"children":2308},{"style":164},[2309],{"type":29,"value":2310}," FastAPI()\n",{"type":23,"tag":151,"props":2312,"children":2313},{"class":153,"line":220},[2314],{"type":23,"tag":151,"props":2315,"children":2316},{"emptyLinePlaceholder":184},[2317],{"type":29,"value":187},{"type":23,"tag":151,"props":2319,"children":2320},{"class":153,"line":240},[2321,2325,2329,2333,2337],{"type":23,"tag":151,"props":2322,"children":2323},{"style":158},[2324],{"type":29,"value":196},{"type":23,"tag":151,"props":2326,"children":2327},{"style":199},[2328],{"type":29,"value":1453},{"type":23,"tag":151,"props":2330,"children":2331},{"style":164},[2332],{"type":29,"value":207},{"type":23,"tag":151,"props":2334,"children":2335},{"style":199},[2336],{"type":29,"value":212},{"type":23,"tag":151,"props":2338,"children":2339},{"style":164},[2340],{"type":29,"value":217},{"type":23,"tag":151,"props":2342,"children":2343},{"class":153,"line":254},[2344,2349,2353],{"type":23,"tag":151,"props":2345,"children":2346},{"style":224},[2347],{"type":29,"value":2348},"  id",{"type":23,"tag":151,"props":2350,"children":2351},{"style":164},[2352],{"type":29,"value":232},{"type":23,"tag":151,"props":2354,"children":2355},{"style":224},[2356],{"type":29,"value":237},{"type":23,"tag":151,"props":2358,"children":2359},{"class":153,"line":263},[2360,2364],{"type":23,"tag":151,"props":2361,"children":2362},{"style":164},[2363],{"type":29,"value":1234},{"type":23,"tag":151,"props":2365,"children":2366},{"style":224},[2367],{"type":29,"value":251},{"type":23,"tag":151,"props":2369,"children":2370},{"class":153,"line":272},[2371],{"type":23,"tag":151,"props":2372,"children":2373},{"emptyLinePlaceholder":184},[2374],{"type":29,"value":187},{"type":23,"tag":151,"props":2376,"children":2377},{"class":153,"line":296},[2378,2382,2386,2390,2394,2398,2402],{"type":23,"tag":151,"props":2379,"children":2380},{"style":199},[2381],{"type":29,"value":478},{"type":23,"tag":151,"props":2383,"children":2384},{"style":164},[2385],{"type":29,"value":207},{"type":23,"tag":151,"props":2387,"children":2388},{"style":285},[2389],{"type":29,"value":288},{"type":23,"tag":151,"props":2391,"children":2392},{"style":164},[2393],{"type":29,"value":370},{"type":23,"tag":151,"props":2395,"children":2396},{"style":764},[2397],{"type":29,"value":1525},{"type":23,"tag":151,"props":2399,"children":2400},{"style":158},[2401],{"type":29,"value":544},{"type":23,"tag":151,"props":2403,"children":2404},{"style":164},[2405],{"type":29,"value":2406},"list[UserOut])\n",{"type":23,"tag":151,"props":2408,"children":2409},{"class":153,"line":320},[2410,2414,2418,2422],{"type":23,"tag":151,"props":2411,"children":2412},{"style":158},[2413],{"type":29,"value":302},{"type":23,"tag":151,"props":2415,"children":2416},{"style":158},[2417],{"type":29,"value":307},{"type":23,"tag":151,"props":2419,"children":2420},{"style":199},[2421],{"type":29,"value":1996},{"type":23,"tag":151,"props":2423,"children":2424},{"style":164},[2425],{"type":29,"value":803},{"type":23,"tag":151,"props":2427,"children":2428},{"class":153,"line":330},[2429,2433,2438,2443,2447,2452,2456,2460,2464,2469],{"type":23,"tag":151,"props":2430,"children":2431},{"style":158},[2432],{"type":29,"value":336},{"type":23,"tag":151,"props":2434,"children":2435},{"style":164},[2436],{"type":29,"value":2437}," [{",{"type":23,"tag":151,"props":2439,"children":2440},{"style":285},[2441],{"type":29,"value":2442},"\"id\"",{"type":23,"tag":151,"props":2444,"children":2445},{"style":164},[2446],{"type":29,"value":232},{"type":23,"tag":151,"props":2448,"children":2449},{"style":224},[2450],{"type":29,"value":2451},"1",{"type":23,"tag":151,"props":2453,"children":2454},{"style":164},[2455],{"type":29,"value":370},{"type":23,"tag":151,"props":2457,"children":2458},{"style":285},[2459],{"type":29,"value":954},{"type":23,"tag":151,"props":2461,"children":2462},{"style":164},[2463],{"type":29,"value":232},{"type":23,"tag":151,"props":2465,"children":2466},{"style":285},[2467],{"type":29,"value":2468},"\"John\"",{"type":23,"tag":151,"props":2470,"children":2471},{"style":164},[2472],{"type":29,"value":2473},"}]\n",{"type":23,"tag":151,"props":2475,"children":2476},{"class":153,"line":901},[2477],{"type":23,"tag":151,"props":2478,"children":2479},{"emptyLinePlaceholder":184},[2480],{"type":29,"value":187},{"type":23,"tag":151,"props":2482,"children":2483},{"class":153,"line":922},[2484,2488,2492,2496,2500],{"type":23,"tag":151,"props":2485,"children":2486},{"style":158},[2487],{"type":29,"value":2206},{"type":23,"tag":151,"props":2489,"children":2490},{"style":224},[2491],{"type":29,"value":2211},{"type":23,"tag":151,"props":2493,"children":2494},{"style":158},[2495],{"type":29,"value":2216},{"type":23,"tag":151,"props":2497,"children":2498},{"style":285},[2499],{"type":29,"value":2221},{"type":23,"tag":151,"props":2501,"children":2502},{"style":164},[2503],{"type":29,"value":2226},{"type":23,"tag":151,"props":2505,"children":2506},{"class":153,"line":930},[2507,2512],{"type":23,"tag":151,"props":2508,"children":2509},{"style":158},[2510],{"type":29,"value":2511},"    import",{"type":23,"tag":151,"props":2513,"children":2514},{"style":164},[2515],{"type":29,"value":2516}," uvicorn\n",{"type":23,"tag":151,"props":2518,"children":2519},{"class":153,"line":971},[2520],{"type":23,"tag":151,"props":2521,"children":2522},{"style":164},[2523],{"type":29,"value":2524},"    uvicorn.run(app)\n",{"type":23,"tag":32,"props":2526,"children":2527},{},[2528],{"type":29,"value":2529},"That's it! FastAPI parses the function signatures and return types to build a live Swagger UI. Documentation always stays up-to-date with the code. The developer experience is greatly improved compared to manually defining schemas in Flask.",{"type":23,"tag":24,"props":2531,"children":2533},{"id":2532},"first-impressions-of-fastapi",[2534],{"type":29,"value":2535},"First Impressions of FastAPI",{"type":23,"tag":32,"props":2537,"children":2538},{},[2539],{"type":29,"value":2540},"After building an initial API with FastAPI, here are some thoughts:",{"type":23,"tag":117,"props":2542,"children":2544},{"id":2543},"quick-setup",[2545],{"type":29,"value":2546},"Quick Setup",{"type":23,"tag":32,"props":2548,"children":2549},{},[2550],{"type":29,"value":2551},"FastAPI was extremely quick to install and start using. The ability to use it directly without an application factory or settings file accelerated development.",{"type":23,"tag":117,"props":2553,"children":2555},{"id":2554},"intuitive-syntax",[2556],{"type":29,"value":2557},"Intuitive Syntax",{"type":23,"tag":32,"props":2559,"children":2560},{},[2561],{"type":29,"value":2562},"The syntax for creating endpoints, validating parameters, and configuring docs made sense right away. Python type hints integrate directly for validation.",{"type":23,"tag":117,"props":2564,"children":2566},{"id":2565},"automatic-documentation",[2567],{"type":29,"value":2568},"Automatic Documentation",{"type":23,"tag":32,"props":2570,"children":2571},{},[2572],{"type":29,"value":2573},"Generating interactive API docs using Swagger UI required no extra configuration. It was easy to immediately test endpoints and review parameters.",{"type":23,"tag":117,"props":2575,"children":2577},{"id":2576},"pydantic-data-validation",[2578],{"type":29,"value":2579},"Pydantic Data Validation",{"type":23,"tag":32,"props":2581,"children":2582},{},[2583],{"type":29,"value":2584},"Leveraging Pydantic for data validation using Python type hints reduced boilerplate code tremendously. Input and output was validated automatically.",{"type":23,"tag":117,"props":2586,"children":2588},{"id":2587},"performance",[2589],{"type":29,"value":2590},"Performance",{"type":23,"tag":32,"props":2592,"children":2593},{},[2594,2596,2603],{"type":29,"value":2595},"In ",{"type":23,"tag":36,"props":2597,"children":2600},{"href":2598,"rel":2599},"https://www.techempower.com/benchmarks/#section=data-r21&test=composite",[40],[2601],{"type":29,"value":2602},"benchmarks",{"type":29,"value":2604},", FastAPI achieved a score of 1184 compared to Django's 274, and Flask's 1229. This makes it a strong choice for high-performance web applications that don't require the speed of a lower-level language like Go or Rust, like typical APIs and microservices.",{"type":23,"tag":117,"props":2606,"children":2608},{"id":2607},"balance-of-flexibility-and-structure",[2609],{"type":29,"value":2610},"Balance of Flexibility and Structure",{"type":23,"tag":32,"props":2612,"children":2613},{},[2614],{"type":29,"value":2615},"While slightly opinionated in some areas like project structure, FastAPI still provided freedom to organize code beyond the basics as needed.",{"type":23,"tag":117,"props":2617,"children":2619},{"id":2618},"positive-first-impressions",[2620],{"type":29,"value":2621},"Positive First Impressions",{"type":23,"tag":32,"props":2623,"children":2624},{},[2625],{"type":29,"value":2626},"After creating several APIs with FastAPI, I'm impressed with FastAPI's performance, automatic validation, docs generation, and overall developer experience. The community and ecosystem are growing rapidly as well.",{"type":23,"tag":24,"props":2628,"children":2630},{"id":2629},"when-to-use-fastapi",[2631],{"type":29,"value":2632},"When to Use FastAPI",{"type":23,"tag":32,"props":2634,"children":2635},{},[2636],{"type":29,"value":2637},"Based on its strengths and comparisons to alternatives, here are some good use cases for FastAPI:",{"type":23,"tag":2639,"props":2640,"children":2641},"ul",{},[2642,2654,2664,2674,2684],{"type":23,"tag":2643,"props":2644,"children":2645},"li",{},[2646,2652],{"type":23,"tag":2647,"props":2648,"children":2649},"strong",{},[2650],{"type":29,"value":2651},"APIs and Microservices",{"type":29,"value":2653},": FastAPI is purpose-built for API development. Its performance and dev experience make it great for microservices too.",{"type":23,"tag":2643,"props":2655,"children":2656},{},[2657,2662],{"type":23,"tag":2647,"props":2658,"children":2659},{},[2660],{"type":29,"value":2661},"Real-time Applications",{"type":29,"value":2663},": FastAPI's ASGI support makes it a strong choice for apps requiring low latency like live streaming, gaming, and messaging.",{"type":23,"tag":2643,"props":2665,"children":2666},{},[2667,2672],{"type":23,"tag":2647,"props":2668,"children":2669},{},[2670],{"type":29,"value":2671},"Machine Learning",{"type":29,"value":2673},": For ML applications processing lots of data, FastAPI provides speed and reliability.",{"type":23,"tag":2643,"props":2675,"children":2676},{},[2677,2682],{"type":23,"tag":2647,"props":2678,"children":2679},{},[2680],{"type":29,"value":2681},"Legacy Modernization",{"type":29,"value":2683},": You can use FastAPI to create a modern API frontend for legacy systems and improve performance.",{"type":23,"tag":2643,"props":2685,"children":2686},{},[2687,2692],{"type":23,"tag":2647,"props":2688,"children":2689},{},[2690],{"type":29,"value":2691},"Prototyping and MVPs",{"type":29,"value":2693},": FastAPI's ability to create APIs and docs quickly accelerates prototyping and building minimal viable products.",{"type":23,"tag":24,"props":2695,"children":2697},{"id":2696},"real-world-usage",[2698],{"type":29,"value":2699},"Real-World Usage",{"type":23,"tag":32,"props":2701,"children":2702},{},[2703],{"type":29,"value":2704},"Several companies and organizations have adopted FastAPI for their projects, demonstrating its effectiveness and versatility in real-world use cases. Some examples include:",{"type":23,"tag":2639,"props":2706,"children":2707},{},[2708,2727,2745,2755],{"type":23,"tag":2643,"props":2709,"children":2710},{},[2711,2716,2718,2725],{"type":23,"tag":2647,"props":2712,"children":2713},{},[2714],{"type":29,"value":2715},"Uber",{"type":29,"value":2717},": Uber uses FastAPI in their internal projects to build and maintain high-performance APIs. FastAPI's performance and ease of use make it a suitable choice for Uber's large-scale applications that need to handle a high volume of requests efficiently. Uber uses FastAPI in their ",{"type":23,"tag":36,"props":2719,"children":2722},{"href":2720,"rel":2721},"https://github.com/uber/ludwig",[40],[2723],{"type":29,"value":2724},"Ludwig machine learning framework",{"type":29,"value":2726},", a deep learning toolbox.",{"type":23,"tag":2643,"props":2728,"children":2729},{},[2730,2735,2737,2744],{"type":23,"tag":2647,"props":2731,"children":2732},{},[2733],{"type":29,"value":2734},"Netflix",{"type":29,"value":2736},": Netflix uses FastAPI for some of their backend services. FastAPI's performance and support for asynchronous programming help Netflix build services that are capable of handling large amounts of data and concurrent connections. Netflix uses FastAPI for their open-source crisis management orchestration framework, ",{"type":23,"tag":36,"props":2738,"children":2741},{"href":2739,"rel":2740},"https://netflix.github.io/dispatch/",[40],[2742],{"type":29,"value":2743},"Dispatch",{"type":29,"value":386},{"type":23,"tag":2643,"props":2746,"children":2747},{},[2748,2753],{"type":23,"tag":2647,"props":2749,"children":2750},{},[2751],{"type":29,"value":2752},"Microsoft",{"type":29,"value":2754},": Microsoft utilizes FastAPI in some of their internal projects, taking advantage of its performance, data validation, and automatic documentation generation capabilities. FastAPI's features help Microsoft's development teams build APIs and services that are efficient, robust, and easily maintainable. Some machine learning related services that are made with FastAPI are being integrated into core Windows and Office products.",{"type":23,"tag":2643,"props":2756,"children":2757},{},[2758,2763,2765,2769,2771,2774,2776,2779],{"type":23,"tag":2647,"props":2759,"children":2760},{},[2761],{"type":29,"value":2762},"Art & Logic",{"type":29,"value":2764},": At Art+Logic, I have started utilizing FastAPI for various projects, including new applications and supporting older applications.",{"type":23,"tag":2766,"props":2767,"children":2768},"br",{},[],{"type":29,"value":2770},"In one particular project, we were working with a legacy application built on WebSauna, a Pyramid-based framework. The existing system relied on server-side rendering for its pages, which posed a challenge when developing a native iOS application, as we needed to create API endpoints for it. We were faced with two choices: either expand the existing WebSauna application by adding RESTful API endpoints or implement an API sidecar using another framework.",{"type":23,"tag":2766,"props":2772,"children":2773},{},[],{"type":29,"value":2775},"Given that WebSauna is a legacy framework with little to no documentation and no active support, extending it would have been a difficult and time-consuming process. Moreover, it is much heavier and harder to extend compared to FastAPI. Considering these factors, we decided to go with FastAPI for its lightweight nature and ease of use.",{"type":23,"tag":2766,"props":2777,"children":2778},{},[],{"type":29,"value":2780},"With FastAPI, we were able to quickly develop the necessary API for the iOS developer to utilize, streamlining the development process and ensuring a more efficient and maintainable solution, using a modern framework. This will also allow for the client to opt into creating new clients for web and Android, as having an API gives them that option.",{"type":23,"tag":32,"props":2782,"children":2783},{},[2784],{"type":29,"value":2785},"These real-world use cases demonstrate FastAPI's capabilities in handling a variety of projects across different industries. FastAPI's performance, ease of use, and data validation features make it an attractive choice for companies and organizations looking to build efficient, reliable, and high-performance web applications and APIs.",{"type":23,"tag":24,"props":2787,"children":2789},{"id":2788},"key-takeaways",[2790],{"type":29,"value":2791},"Key Takeaways",{"type":23,"tag":32,"props":2793,"children":2794},{},[2795],{"type":29,"value":2796},"Here are some of the key highlights of FastAPI as a Python web framework:",{"type":23,"tag":2639,"props":2798,"children":2799},{},[2800,2805,2810,2815,2820],{"type":23,"tag":2643,"props":2801,"children":2802},{},[2803],{"type":29,"value":2804},"Excellent performance thanks to optimizations like ASGI support",{"type":23,"tag":2643,"props":2806,"children":2807},{},[2808],{"type":29,"value":2809},"Automatic data validation using Pydantic and type hints",{"type":23,"tag":2643,"props":2811,"children":2812},{},[2813],{"type":29,"value":2814},"Streamlined API development experience",{"type":23,"tag":2643,"props":2816,"children":2817},{},[2818],{"type":29,"value":2819},"Automatic interactive documentation using OpenAPI schemas",{"type":23,"tag":2643,"props":2821,"children":2822},{},[2823],{"type":29,"value":2824},"Rapidly growing ecosystem of plugins, extensions, and community support",{"type":23,"tag":32,"props":2826,"children":2827},{},[2828],{"type":29,"value":2829},"FastAPI is ideal for developers who prioritize building APIs and web services with high productivity and little boilerplate code. Its balance of ease-of-use, flexibility, performance, and reliability make it a worthy contender among Python's web frameworks.",{"type":23,"tag":32,"props":2831,"children":2832},{},[2833],{"type":29,"value":2834},"As FastAPI continues maturing, it will be exciting to see the additional capabilities it develops alongside the growing community support. Based on my experience so far, I believe FastAPI can be the right choice for many API and web app projects that need speed, validation, and great documentation.",{"type":23,"tag":2836,"props":2837,"children":2838},"style",{},[2839],{"type":29,"value":2840},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":8,"searchDepth":190,"depth":190,"links":2842},[2843,2844,2851,2857,2866,2867,2868],{"id":26,"depth":180,"text":30},{"id":107,"depth":180,"text":110,"children":2845},[2846,2847,2848,2849,2850],{"id":119,"depth":190,"text":122},{"id":389,"depth":190,"text":392},{"id":435,"depth":190,"text":438},{"id":569,"depth":190,"text":572},{"id":595,"depth":190,"text":598},{"id":617,"depth":180,"text":620,"children":2852},[2853,2854,2855,2856],{"id":628,"depth":190,"text":631},{"id":672,"depth":190,"text":675},{"id":1615,"depth":190,"text":1618},{"id":2251,"depth":190,"text":2254},{"id":2532,"depth":180,"text":2535,"children":2858},[2859,2860,2861,2862,2863,2864,2865],{"id":2543,"depth":190,"text":2546},{"id":2554,"depth":190,"text":2557},{"id":2565,"depth":190,"text":2568},{"id":2576,"depth":190,"text":2579},{"id":2587,"depth":190,"text":2590},{"id":2607,"depth":190,"text":2610},{"id":2618,"depth":190,"text":2621},{"id":2629,"depth":180,"text":2632},{"id":2696,"depth":180,"text":2699},{"id":2788,"depth":180,"text":2791},"markdown","content:jestep:2023-3:fastapi.md","content","jestep/2023-3/fastapi.md","jestep/2023-3/fastapi","md",{"user":2876,"name":2877},"jestep","Jagger Estep",[2879,2892,2901,2914,2929,2941,2949,2959,2970,2979,2991,3002,3013,3022,3032,3043,3056,3067,3076,3086,3094,3101,3110,3118,3127,3137,3147,3156,3165,3173,3184,3192,3200,3209,3217,3225,3233,3241,3249,3257,3265,3273,3281,3291,3299,3309,3317,3327,3337,3348,3358,3368,3378,3388,3401,3410,3420,3431,3441,3453,3465,3468,3482,3497,3505,3513,3522,3531,3540,3549,3558,3567,3576,3585,3594,3605,3618,3628,3636,3644,3652,3660,3672,3684,3694,3703,3712,3722,3731,3741,3750],{"_path":2880,"title":2881,"description":2882,"image":2883,"publishDate":2884,"tags":2885,"_id":2888,"author":2889},"/alalande/2023-1/escaping_text","Thinking Like a Programmer: Escaping Text","In this progressive and vivid explanation, we explore the HOW and WHY of quoting, nesting, and escaping text.","/alalande/2023-1/img/header.png","2024-02-15",[2886,2887],"series","educational","content:alalande:2023-1:escaping_text.md",{"user":2890,"name":2891},"alalande","Anthony Lalande",{"_path":2893,"title":2894,"description":2895,"image":2896,"publishDate":2897,"tags":2898,"_id":2899,"author":2900},"/alalande/2023-2/heuristics","Thinking Like a Programmer: Heuristics","We want to help you turbo-charge your decision making.","/alalande/2023-2/img/heuristics.png","2024-03-15",[2886,2887],"content:alalande:2023-2:heuristics.md",{"user":2890,"name":2891},{"_path":2902,"title":2903,"description":2904,"tags":2905,"publishDate":2908,"image":2909,"_id":2910,"author":2911},"/areichert/2023-10/rapid-testing-techniques-for-web-and-mobile","Rapid Testing Techniques for Web & Mobile Apps","Testing rapidly or the need to test quickly under shortened execution cycles is not new. Rapid testing has been around for as long as software testing has existed but increases when a product release is imminent, strained, or behind schedule. There are many reasons development gets behind schedule. Similar to testing, development is prone to surprise requirements changes and increases in scope and complexity.",[2906,2907],"software-testing","qa","2024-06-01","/areichert/2023-10/img/rapid_testing.png","content:areichert:2023-10:Rapid Testing techniques for web and mobile.md",{"user":2912,"name":2913},"areichert","Amy Reichert",{"_path":2915,"title":2916,"description":2917,"image":2918,"publishDate":2919,"tags":2920,"_id":2925,"author":2926},"/asherbrooke/2020-4/watchwah","Bringing an Idea to Life: WatchWah Proof of Concept","\"Wouldn't it be cool if...\"","/asherbrooke/2020-4/img/Guitar_and_Watch.jpeg","2020-04-01",[2921,2922,2923,2924],"ios","apple","watch","juce","content:asherbrooke:2020-4:watchwah.md",{"user":2927,"name":2928},"asherbrooke","Andrew Sherbrooke",{"_path":2930,"title":2931,"description":2932,"publishDate":2933,"tags":2934,"_id":2937,"author":2938},"/avogan/2012-07/salt","What Your Users Don't Know (Part 1)","What's wrong with this code?","2012-07-13",[2935,2936,2886],"cryptography","security","content:avogan:2012-07:salt.md",{"user":2939,"name":2940},"avogan","Andrew Vogan",{"_path":2942,"title":2943,"description":2944,"publishDate":2945,"tags":2946,"_id":2947,"author":2948},"/avogan/2012-07/salt-2","What Your Users Don't Know (Part 2)","In my last post we saw that what your users don't know can hurt them. In other words, how securely you handle your users' private data behind the scenes can have profound implications both for your business and your users' well being. To put it bluntly, it's bad for your business to be publicly shamed over your handling of sensitive data, and it's bad for your users to have their bank accounts pilfered -- those being some of the worse case scenarios.","2012-07-26",[2935,2936,2886],"content:avogan:2012-07:salt-2.md",{"user":2939,"name":2940},{"_path":2950,"title":2951,"description":2952,"publishDate":2953,"image":2954,"_id":2955,"author":2956},"/bporter/2012-5/cd_player","My First CD Player","I started college right about the time when the first CD players were coming onto the market -- there weren't many available, and they were all obscenely expensive. At the time, my dad was dong a lot of traveling to Japan for business, and he was able to bring me a really nice Yamaha CD player back from a shop in Akihabara for about 1/4th of what a similar unit would have cost me here in the US.","2012-05-01","/bporter/2012-5/img/cd_player.jpg","content:bporter:2012-5:cd_player.md",{"user":2957,"name":2958},"bporter","Brett Porter",{"_path":2960,"title":2961,"description":2962,"publishDate":2963,"tags":2964,"image":2967,"_id":2968,"author":2969},"/bporter/2012-5/improtech","ImproTech Paris-New York 2012","Last week, I took a vacation day to attend one day of workshops at NYU as part of ImproTech 2012 Paris-New York That website descibes the event as:","2012-05-24",[2965,2966],"improvisation","music","/bporter/2012-5/img/affichemartin.jpg","content:bporter:2012-5:improtech.md",{"user":2957,"name":2958},{"_path":2971,"title":2972,"description":2973,"publishDate":2974,"tags":2975,"_id":2977,"author":2978},"/bporter/2012-5/learntocode","Yes, Do Learn To Code!","My usual pre-work routine is to walk the dog (working at home, this is my counterpart to a commute), pour my first cup of coffee, and then curl up for a little while with Google Reader. I don't know if it's because I've selected feeds that are too closely aligned with my values and personal agenda, but it's really rare that I'll read a post that is just so wrong that it makes me angry. Jeff Atwood wrote a post like that: Please Don't Learn To Code","2012-05-15",[2976],"learn-to-code","content:bporter:2012-5:learntocode.md",{"user":2957,"name":2958},{"_path":2980,"title":2981,"description":2982,"publishDate":2983,"tags":2984,"image":2988,"_id":2989,"author":2990},"/bporter/2012-6/dsl","Watch Your Language","Interesting to see a theme emerge in my Pinboard account this week -- lots of stuff about the idea of 'programming language'. I've spent the last few weeks preparing to dive back into a personal interactive music project that I've been working on sporadically since I was in graduate school. I had recently realized that the conceptual roadblock I hit before my last hiatus was something that I'd need to address by adding some sort of little programming language into the system. After following Martin Fowler's many blog posts over the years discussing domain specific languages, I finally broke down and bought his book on the topic. It's too early yet for me to have much concrete to say about the book, but I remember getting enough out of those blog posts to be confident that it will be worth the money and time to read.","2012-06-29",[2985,2986,2987],"dsl","erlang","go","/bporter/2012-6/img/dsl.jpg","content:bporter:2012-6:dsl.md",{"user":2957,"name":2958},{"_path":2992,"title":2993,"description":2994,"image":2995,"publishDate":2996,"tags":2997,"_id":3000,"author":3001},"/bporter/2019-3/animator","Friz: A flexible animation controller for JUCE","As is often the case, I found myself working on a personal project and had some UI elements that really wanted to have some life to them on the screen.","/bporter/2019-3/img/animator.png","2019-03-01",[2924,2998,2999],"ui","c++","content:bporter:2019-3:animator.md",{"user":2957,"name":2958},{"_path":3003,"title":3004,"description":3005,"image":3006,"publishDate":3007,"tags":3008,"_id":3011,"author":3012},"/bporter/2019-4/aesannounce","Art+Logic In the Real World","There are a few events coming up in the next few weeks where A+L will have people in attendance. If you're going to be there or nearby, please get in touch and we'll meet up.","/bporter/2019-4/img/aesLogo.jpg","2019-04-01",[3009,3010],"a+l","event","content:bporter:2019-4:aesAnnounce.md",{"user":2957,"name":2958},{"_path":3014,"title":3015,"description":3016,"image":3017,"publishDate":3018,"tags":3019,"_id":3020,"author":3021},"/bporter/2020-10/reanimated","Re-animated","Last year, I posted here about an animation control framework called 'Friz' that works within the JUCE Application Framework.","/bporter/2020-10/img/module.png","2020-10-01",[2924,2998,2999],"content:bporter:2020-10:reanimated.md",{"user":2957,"name":2958},{"_path":3023,"title":3024,"description":3025,"image":3026,"publishDate":2996,"tags":3027,"_id":3028,"author":3029},"/bstevens/2019-3","Coding the Impossible","As you can see on the Art+Logic website, our slogan is Coding the \"impossible.\"®","/bstevens/2019-3/img/impossible.png",[3009],"content:bstevens:2019-3:index.md",{"user":3030,"name":3031},"bstevens","Ben Stevens",{"_path":3033,"title":3034,"description":3035,"publishDate":3036,"tags":3037,"_id":3039,"author":3040},"/ckeefer/2013-1/misc","JS Hints & Shortcuts","During the course of any complex project (and even many simple ones), on the way to accomplish the actual goal, you're certain to encounter any number of small hurdles along the way - little problems which need to be resolved for the bigger picture to come into focus.","2013-09-01",[3038],"js","content:ckeefer:2013-1:misc.md",{"user":3041,"name":3042},"ckeefer","Christopher Keefer",{"_path":3044,"title":3045,"description":3046,"publishDate":3047,"tags":3048,"image":3053,"_id":3054,"author":3055},"/ckeefer/2013-2/xslt","XML and XSLT","Not terribly long ago, XML was the darling of the web. HTML4 was reformulated as XHTML 1.0, SOAP messages were XML, and let us not forget XMLHttpRequest.","2013-10-08",[3049,3050,3051,3052],"data-formats","xml","xsl","xslt","/ckeefer/2013-2/img/xslt-processing.png","content:ckeefer:2013-2:xslt.md",{"user":3041,"name":3042},{"_path":3057,"title":3058,"description":3059,"publishDate":3060,"tags":3061,"image":3064,"_id":3065,"author":3066},"/ckeefer/2013-3/ajax-upload","Ajax Upload Part I: Framed (and jQuery Deferred)","Inevitably, people want their files on the Internet. If your project is about cute cats, someone will task you with allowing users to upload photos of their cats, videos of their cats, long rambling audio clips in which they attempt to convince their cat to stop attacking the microphone, etcetera. If your project is about the nature and proclivities of mold, someone, somewhere will want to share detailed photographic evidence of their mold problem. The need to upload files is a given.","2013-03-20",[3038,3062,3063],"jquery","html5","/ckeefer/2013-3/img/upframe.jpg","content:ckeefer:2013-3:ajax-upload.md",{"user":3041,"name":3042},{"_path":3068,"title":3069,"description":3070,"publishDate":3071,"tags":3072,"_id":3074,"author":3075},"/ckeefer/2013-4/teaching-programming","Can (and Should) Everyone Learn to Program?","Fair warning: The following article is long, rambly, and contains no code. It does, however, contain some rumination on the idea that everyone can and should learn to program.","2013-12-03",[3073],"programming","content:ckeefer:2013-4:teaching-programming.md",{"user":3041,"name":3042},{"_path":3077,"title":3078,"description":3079,"publishDate":3080,"tags":3081,"image":3083,"_id":3084,"author":3085},"/ckeefer/2013-5/ajax-uploader","Ajax Upload XHR2, Take 2","It's a pleasure to be able to interact with files in the browser at long last, isn't it? Reading files in without needing to bounce them against the server first opens up a lot of possibilities - and getting progress from a chunked ajax upload is miles away from the indeterminate form uploads of days past.","2014-02-19",[3062,3038,3082],"xhr2","/ckeefer/2013-5/img/html5.jpg","content:ckeefer:2013-5:ajax-uploader.md",{"user":3041,"name":3042},{"_path":3087,"title":3088,"description":3089,"publishDate":3090,"tags":3091,"_id":3092,"author":3093},"/ckeefer/2013-07/anchors-hash","Anchors, Hash Sign, javascript:void(0)","So, you've got a link that, in reality, is just a click target for performing some javascript function. You want the appearance of a standard anchor link, but if it's not performing the intended function, should it really be an anchor? And if so, what should we fill that 'href' attribute in with?","2013-07-29",[3038],"content:ckeefer:2013-07:anchors-hash.md",{"user":3041,"name":3042},{"_path":3095,"title":3096,"description":3097,"publishDate":3098,"_id":3099,"author":3100},"/ckeefer/2013-07/static-vmware-host","Static Hosting with VMWare","Virtualization is one of the many benefits of the excess (metaphorical) horsepower available to us with modern hardware. Need to test against (Windows XP/7/8/NT || Fedora || Mint || Ubuntu || FreeBSD || MacOSX || etc)? Fire up the VM. Need a Linux environment for the packages your server relies on, but need to test in the iPad simulator? VM's to the rescue.","2013-07-26","content:ckeefer:2013-07:static-vmware-host.md",{"user":3041,"name":3042},{"_path":3102,"title":3103,"description":3104,"publishDate":3105,"tags":3106,"_id":3108,"author":3109},"/ckeefer/2013-08/fullproof-fulltext-search","Client-side Fulltext Searching with Fullproof","Recently, I was engaged in a genial argument with a friend of an older generation, each of us taking an opposing stance on some obscure trivia neither of us was entirely certain about - but which we were both ready to defend with all the wit and rhetoric at our disposal. When we had finally exhausted all attempts to make the other budge on the matter, we turned to an authoritative 3rd-party source to lay the matter to rest for us - a Google search.","2013-08-29",[3107,3052],"search","content:ckeefer:2013-08:fullproof-fulltext-search.md",{"user":3041,"name":3042},{"_path":3111,"title":3112,"description":3113,"publishDate":3114,"tags":3115,"_id":3116,"author":3117},"/ckeefer/2013-11/jquery-ajax-blobs","jQuery Ajax Blobs and Array Buffers","A big part of what makes jQuery a regular part of so many web projects is the clean interface it offers us for a number of sometimes messy built-in aspects of javascript. The most obvious is the DOM interface; and in second place, jquery ajax and its various shorthand methods. Abstracting away the difference between ActiveXObject and XMLHttpRequest is one of the most obvious benefits - but even if you don't need to worry about supporting old versions of IE, you might well enjoy the clean, object-based, promise-returning interface that jquery ajax offers.","2013-11-21",[3038,3062],"content:ckeefer:2013-11:jquery-ajax-blobs.md",{"user":3041,"name":3042},{"_path":3119,"title":3120,"description":3121,"publishDate":3122,"tags":3123,"_id":3125,"author":3126},"/ckeefer/2013-12/deploying-with-git","Deploying Websites with Git","Deploying your webapp is an important part of the web development equation - your client's site isn't going to attract a lot of attention sitting in your local dev directory. Deployment concerns tend to fall to the bottom of the priority list, though, and the end result tends to be kludgy, hastily thrown-together deployment scripts; and because they are so kludgy and, often, time consuming, when time crunches threaten, a developer may resort to making changes directly on the remote server that need to be (but sometimes never are) backported to the code living in your version control.","2013-12-23",[3124],"git","content:ckeefer:2013-12:deploying-with-git.md",{"user":3041,"name":3042},{"_path":3128,"title":3129,"description":3130,"publishDate":3131,"tags":3132,"image":3134,"_id":3135,"author":3136},"/ckeefer/2014-1/still-using-php","Still Using PHP?","Poor PHP. It's so lonely and unloved these days.","2014-01-29",[3133],"php","/ckeefer/2014-1/img/php.jpg","content:ckeefer:2014-1:still-using-php.md",{"user":3041,"name":3042},{"_path":3138,"title":3139,"description":3140,"publishDate":3141,"tags":3142,"image":3144,"_id":3145,"author":3146},"/ckeefer/2014-2/ajax-upload-2","Ajax Upload Part II: XHR2 (and FileReader)","So, the client has told you their users should be able to upload their drunken party pictures for all the internet to see. \"We want the very best experience possible,\" they tell you. \"Simple, seamless - maybe using that new html5 thing I've heard so much about.\"","2013-04-09",[3038,3143],"xmlhttprequest","/ckeefer/2014-2/img/html5.jpg","content:ckeefer:2014-2:ajax-upload-2.md",{"user":3041,"name":3042},{"_path":3148,"title":3149,"description":3150,"publishDate":3151,"tags":3152,"_id":3154,"author":3155},"/ckeefer/2014-3/customgmapsinfowindow","Custom Google Maps Info Windows","When it comes time to relate the ephemeral world of data to the physical world, Maps are key in both enterprise and consumer applications. Whatever else you might think of it, Google Maps tends to be the default option - certainly, its the only one I've ever had clients ask for by name.","2014-02-26",[3038,3153],"google-maps","content:ckeefer:2014-3:customgmapsinfowindow.md",{"user":3041,"name":3042},{"_path":3157,"title":3158,"description":3159,"publishDate":3160,"tags":3161,"_id":3163,"author":3164},"/ckeefer/2014-4/hidden-options","Hidden Options: A Workaround","Here's the situation: You've got a select. Maybe a whole bunch of selects, with a ton of options each (metric ton - let's keep our imaginary hyperbolic units straight here); and these are meant to be complex interactive elements, with options made visible or not as some programmatic condition dictates.","2014-04-23",[3162,3038,3062],"how-to","content:ckeefer:2014-4:hidden-options.md",{"user":3041,"name":3042},{"_path":3166,"title":3167,"description":3168,"publishDate":3169,"tags":3170,"_id":3171,"author":3172},"/ckeefer/2014-5/cgwin2","Custom Google Info Windows: Updated, Live","April 30, 2014 at 3:22 am Remy says:","2014-05-09",[3038,3153],"content:ckeefer:2014-5:cgwin2.md",{"user":3041,"name":3042},{"_path":3174,"title":3175,"description":3176,"publishDate":3177,"tags":3178,"image":3181,"_id":3182,"author":3183},"/ckeefer/2014-6/backbonesocketsync","Websockets for Backbone","Backbone's had some of its thunder stolen lately by trendier frameworks like Meteor and Angular; for good reason, in most cases, as without the prosthetic functionality offered by the likes of Marionette, Backbone's view handling (amongst a few other lacks and warts) is really just 'roughed in'.","2014-06-25",[3038,3179,3180],"websockets","backbone","/ckeefer/2014-6/img/WebsocketsPlusBackbone.png","content:ckeefer:2014-6:backbonesocketsync.md",{"user":3041,"name":3042},{"_path":3185,"title":3186,"description":3187,"publishDate":3188,"tags":3189,"_id":3190,"author":3191},"/ckeefer/2014-7/promises","It's a (jQuery-style) Promise","Way back when I brought up the topic of promises (particularly, jQuery Deferred), and I promised we would come back to the topic someday.","2014-10-16",[3038,3062],"content:ckeefer:2014-7:promises.md",{"user":3041,"name":3042},{"_path":3193,"title":3194,"description":3195,"publishDate":3196,"tags":3197,"_id":3198,"author":3199},"/ckeefer/2014-8/behold-views","Behold! (JavaScript Views)","JavaScript has the propensity to be very untidy - if you let it, it will sprawl all over the place. Hundreds of global variables scattered across dozens of files, messy half-measures towards object-orientation, mixed in seemingly at random with ungrouped functions - anyone who's had a client bring them a failed project from some other development team knows just how bad it can get.","2015-01-07",[3038],"content:ckeefer:2014-8:behold-views.md",{"user":3041,"name":3042},{"_path":3201,"title":3202,"description":3203,"publishDate":3204,"tags":3205,"image":3206,"_id":3207,"author":3208},"/ckeefer/2015-1/writeonce","Write Once, Debug Everywhere","It's pretty seldom that anyone mentions web pages these days, other than in historical reference to days long gone by (yes, a whole few years ago). Web sites, sure, but not if what is really wanted is to replace something that, not so long ago, would have been some native code for a smartphone (or a little further back still, a desktop computer). Generally speaking, the most common term tripping from client's lips these days is 'web applications' - or webapps, because who has time for spaces and proper spelling, amirite?","2015-02-02",[3038],"/ckeefer/2015-1/img/html5java.jpg","content:ckeefer:2015-1:writeonce.md",{"user":3041,"name":3042},{"_path":3210,"title":3211,"description":3212,"publishDate":3213,"tags":3214,"_id":3215,"author":3216},"/ckeefer/2015-2/js-frameworks","The What and Why of Javascript Frameworks","JavaScript has the propensity to be very untidy if you let it be. This isn't a problem unique to JavaScript, of course - many other languages suffer from a lack of native organization, especially for specific tasks.","2015-05-29",[3038],"content:ckeefer:2015-2:js-frameworks.md",{"user":3041,"name":3042},{"_path":3218,"title":3219,"description":3220,"publishDate":3221,"tags":3222,"_id":3223,"author":3224},"/ckeefer/2015-3/emailvalidation","Email Validation with Django and python-social-auth","When it comes to user accounts, the standard litmus test is email validation. Besides the immediate benefits - of offering us a straightforward unique identifier for users, and making it more difficult to automate creating a mass of accounts on our service - by requiring that each account have an email address and interact therewith to confirm the addresses validity, it also offers us the chance to associate a known-working email account with a user account. This is important for transactional emails such as password resets or for potential two-factor authentication use... and if you're a little less ethical, for sending marketing desirable and informative emails about interesting products and services.","2015-07-23",[12,14],"content:ckeefer:2015-3:EmailValidation.md",{"user":3041,"name":3042},{"_path":3226,"title":3227,"description":3228,"publishDate":3229,"tags":3230,"_id":3231,"author":3232},"/ckeefer/2015-5/file-reader-chunking","FileReader Chunking and Base64 DataURLs","In a hurry? You can now use our HUp jquery plugin to read files in a chunked fashion as data URLs. Hooray!","2015-12-15",[3038,3062],"content:ckeefer:2015-5:file-reader-chunking.md",{"user":3041,"name":3042},{"_path":3234,"title":3235,"description":3236,"publishDate":3237,"tags":3238,"_id":3239,"author":3240},"/ckeefer/2016-1/ajaxbinarycaching","Caching Binary Data With jQuery Ajax and IndexedDB","After long, grueling months (years? or does it only feel like years?), your web application nears completion. It is tightly coded, well documented, works across all modern browsers, and is well received by your beta testers. It's nearly time to go live, and a smile of pure relief plays upon your lips... and freezes into a rictus grin when your client turns to you, and asks, \"so, hey, can we speed up the dynamic cat pic loading? Especially when I close the browser and come back to it later. I think that's really key to the whole application.\"","2016-04-25",[3038,3062],"content:ckeefer:2016-1:ajaxBinaryCaching.md",{"user":3041,"name":3042},{"_path":3242,"title":3243,"description":3244,"publishDate":3245,"tags":3246,"_id":3247,"author":3248},"/ckeefer/2016-2/paymentprocessing","Payment Processing with Braintree","You've built the web application of the century, and the users have rightly flooded to it. Cat pictures for everyone!","2016-05-11",[14,3038,3062,12],"content:ckeefer:2016-2:paymentprocessing.md",{"user":3041,"name":3042},{"_path":3250,"title":3251,"description":3252,"publishDate":3253,"tags":3254,"_id":3255,"author":3256},"/ckeefer/2016-3/djangochannels1","Django Channels: From the Ground Up - Part 1","You stare mournfully into the mass of code you've inherited. At some point, it's clear, the requirements called for the server to push information to the client, because there's an unholy mix of Server-Side Events, long-polling, hidden iframes and even a Java applet in there, all supporting some level of long-term connectivity with the server. It's almost fascinating in its barely functional hideousness, and you would be inclined to leave well enough alone... except for the new feature specifications you've been assigned, which require the client to be able to send data back to the server in response to the received events, in as close to real-time as you can get.","2016-06-13",[14,12,3179],"content:ckeefer:2016-3:djangoChannels1.md",{"user":3041,"name":3042},{"_path":3258,"title":3259,"description":3260,"publishDate":3261,"tags":3262,"_id":3263,"author":3264},"/ckeefer/2016-4/djangochannels2","Django Channels: From the Ground Up - Part 2","Last time, we decided to embark on a brave new adventure and give our Django framework a big upgrade with the inclusion of Django Channels. We got just far enough to get the development server running, but while this may be an adequate start, it's better to develop against something like what we intend to deploy, right?","2016-06-15",[14,12,3179],"content:ckeefer:2016-4:djangochannels2.md",{"user":3041,"name":3042},{"_path":3266,"title":3267,"description":3268,"publishDate":3269,"tags":3270,"_id":3271,"author":3272},"/ckeefer/2016-6/gofetch1","Go Fetch! (JavaScript Fetch API)","Long ago, we briefly brushed upon the topic of what has made jQuery such a valuable part of the web developer's toolset for such a long time - namely, a cleaner interface for interacting with the DOM, and the $.ajax abstraction over XMLHttpRequest.","2016-10-03",[3038,3062,2886],"content:ckeefer:2016-6:goFetch1.md",{"user":3041,"name":3042},{"_path":3274,"title":3275,"description":3276,"publishDate":3277,"tags":3278,"_id":3279,"author":3280},"/ckeefer/2016-7/gofetch2","Go Fetch 2! (JavaScript Fetch API)","Last time we discussed the Fetch API in general, taking a look at how it differed from the XMLHttpRequest API, and some of its advantages. Today, we're going to take a look at a little library that you can include in your projects today that offers you localStorage caching for the Fetch API.","2016-10-10",[3038,3062,2886],"content:ckeefer:2016-7:goFetch2.md",{"user":3041,"name":3042},{"_path":3282,"title":3283,"description":3284,"publishDate":3285,"tags":3286,"_id":3289,"author":3290},"/ckeefer/2016-8/herokupdf","Generating PDFs: wkhtmltopdf & Heroku","So, it has come to this.","2016-12-21",[3287,3288,12],"heroku","pdf","content:ckeefer:2016-8:HerokuPDF.md",{"user":3041,"name":3042},{"_path":3292,"title":3293,"description":3294,"publishDate":3295,"tags":3296,"_id":3297,"author":3298},"/ckeefer/2017-1/downloadingclientsidecontent","Downloading Client-side Generated Content","A young developer, new to the Tao of the client-side, comes to a Master of the way, and speaks thusly: \"Oh Master, our application nears completion; and lo, cat pics can be drawn upon, and captions fixated thereto, for the creation of humour and the bounteous enjoyment of our users.\"","2017-02-06",[3038],"content:ckeefer:2017-1:downloadingclientsidecontent.md",{"user":3041,"name":3042},{"_path":3300,"title":3301,"description":3302,"publishDate":3303,"tags":3304,"_id":3307,"author":3308},"/ckeefer/2017-2/morepwatoya-part1","More PWA to Ya! (Progressive Web Apps, Part 1)","It's project kickoff time, and you're having a conversation with your client about what form the application will take:","2017-02-01",[3305,3306,2886],"pwa","mobile","content:ckeefer:2017-2:MorePWAToYa-Part1.md",{"user":3041,"name":3042},{"_path":3310,"title":3311,"description":3312,"tags":3313,"publishDate":3314,"_id":3315,"author":3316},"/ckeefer/2017-3/morepwatoya-part2","More PWA to Ya! (Progressive Web Apps, Part 2)","Last time, we got into the nitty gritty on how to make your web application into a Progressive Web Application (PWA to it's friends). I promised we'd dig even deeper this time, and show you how to make your web app a little more 'native' on Android - and how to deal with iOS Safari's special snowflake syndrome.",[3306,3305,2886],"2017-03-01","content:ckeefer:2017-3:MorePWAToYa-Part2.md",{"user":3041,"name":3042},{"_path":3318,"title":3319,"description":3320,"image":3321,"publishDate":3322,"tags":3323,"_id":3325,"author":3326},"/ckeefer/2019-1/unlockingwebaudio","Unlocking Web Audio","\"It's going to be the coolest thing ever.\"","/ckeefer/2019-1/img/featured_image.jpg","2019-01-01",[3038,3324],"audio","content:ckeefer:2019-1:UnlockingWebAudio.md",{"user":3041,"name":3042},{"_path":3328,"title":3329,"description":3330,"publishDate":3331,"image":3332,"tags":3333,"_id":3335,"author":3336},"/ckeefer/2020-1/why-vue","Why Vue","Why choose Vue over any other front-end framework?","2020-01-01","/ckeefer/2020-1/img/vue-wall.jpg",[3038,3334],"vue","content:ckeefer:2020-1:Why Vue.md",{"user":3041,"name":3042},{"_path":3338,"title":3339,"description":3340,"tags":3341,"image":3344,"publishDate":3345,"_id":3346,"author":3347},"/ckeefer/2024-3/e2e_testing","E2E Testing: To What End?","Friend, can we agree that tests are a good idea? I won't scorn you for sometimes omitting them - time and budget constraints are what they are, and even the best intentioned of us sometimes have to just give our projects a lick and a promise. \"Proper test coverage soon\", you sweetly croon as you rock it to sleep, the knowledge that you're telling a dark, terrible lie twisting you up inside. Maybe you could just scrape enough budget together for some simple unit tests? Then, at least, you'd have \"tests\", right?",[2907,2906,3342,3343],"e2e","playwright","/ckeefer/2024-3/img/E2E_Testing_2024.png","2024-06-15","content:ckeefer:2024-3:e2e_testing.md",{"user":3041,"name":3042},{"_path":3349,"title":3350,"description":3351,"tags":3352,"image":3354,"publishDate":3355,"_id":3356,"author":3357},"/ckeefer/2024-7/vpubsub","Vue 3 Pub / Sub: All aboard the (event) bus","We like Vue at A+L. We think it's one of the best frontend frameworks, and a great choice pretty much anywhere you might otherwise be tempted to use React.",[3038,3334,3353],"pub/sub","/ckeefer/2024-7/img/event_bus.png","2024-08-15","content:ckeefer:2024-7:VPubSub.md",{"user":3041,"name":3042},{"_path":3359,"title":3360,"description":3361,"publishDate":3362,"tags":3363,"_id":3364,"author":3365},"/cmacksey/2012-5/php-musings","PHP Musings","Ran into an interesting, but thorough, rant the other day - PHP: A Fractal of Bad Design. The part that grabbed me the most was the analogy at the beginning, which was all too perfect:","2012-05-07",[3133],"content:cmacksey:2012-5:php-musings.md",{"user":3366,"name":3367},"cmacksey","Chris Macksey",{"_path":3369,"title":3370,"description":3371,"publishDate":3372,"tags":3373,"_id":3374,"author":3375},"/dpopowich/2021-07-30/data-collector","Asynchronous Python - A Real World Example","A dive into a real example of async Python usage.","2021-07-30",[12,3162,302],"content:dpopowich:2021-07-30:data-collector.md",{"user":3376,"name":3377},"dpopowich","Daniel Popowich",{"_path":3379,"title":3380,"description":3381,"tags":3382,"image":3384,"publishDate":3385,"_id":3386,"author":3387},"/dpopowich/2023-8/postgres-pubsub","Using PostgreSQL for Pub/Sub","A+L has been working on a Single Page Application (SPA) wherein our client's users take on the role of Staff Users (think: project managers) as they aid their Customer Users in using the application to complete a complex project.",[3383,12,302],"postgresql","/dpopowich/2023-8/img/psql_pub_sub.png","2024-04-15","content:dpopowich:2023-8:postgres-pubsub.md",{"user":3376,"name":3377},{"_path":3389,"title":3390,"description":3391,"tags":3392,"image":3395,"publishDate":3396,"_id":3397,"author":3398},"/ewahl/2025-05/escape_deployment_hell","Escape Deployment Hell: IaC, CDK, Ephemeral Environments, and the Pragmatic Path to Platform Power","Another Friday afternoon, another deployment fire. If this sounds familiar, you're not alone. On too many projects, the chasm between application code and infrastructure management breeds manual configuration nightmares, crippling complexity, and agonizingly slow development cycles. But what if your team could sidestep this chaos, focusing on building features instead of constantly battling deployment gremlins?",[3393,3394,12],"devops","aws","/ewahl/2025-05/img/deployment_hell.png","2025-05-13","content:ewahl:2025-05:escape_deployment_hell.md",{"user":3399,"name":3400},"ewahl","Edward F. Wahl",{"_path":3402,"title":3403,"description":3404,"publishDate":3405,"image":3406,"tags":3407,"_id":3408,"author":3409},"/ewahl/2025-06/argued_with_ai","I Argued With an AI for 20 Minutes About Async Code &mdash; And I'm Surprisingly Happy","If you have ever spent twenty minutes debating an obscure AWS Lambda invocation pattern with an AI, you might question your life choices. But here I am: amused by the wasted time but ultimately happy with the outcome and understanding I gained.","2026-06-01","/ewahl/2025-06/img/argued_with_ai.png",[3393,3394,12],"content:ewahl:2025-06:argued_with_ai.md",{"user":3399,"name":3400},{"_path":3411,"title":3412,"description":3413,"tags":3414,"image":3415,"publishDate":3007,"_id":3416,"author":3417},"/jbagley/2019-4/makingspectrogramsinjuce","Making Spectrograms in JUCE","Art+Logic's Incubator project has made a lot of progress. In a previous post I mentioned that Dr. Scott Hawley's technique to classify audio involved converting audio to an image and using a Convolution Neural Network (CNN) to classify the audio based on this image. That image is a spectrogram. I'm going to go into some detail about what we do to create one, and why to the best of my ability.",[2924,2999,3324],"/jbagley/2019-4/img/Fortissimo_Trumpet_Ensemble_Matrix_Swells_61.wav-2048x1700.png","content:jbagley:2019-4:MakingSpectrogramsInJUCE.md",{"user":3418,"name":3419},"jbagley","Jason Bagley",{"_path":3421,"title":3422,"description":3423,"tags":3424,"image":3427,"publishDate":3428,"_id":3429,"author":3430},"/jbagley/2021-07/softwaresenescence","Legacy Vulnerabilities AKA Software Senescence","Does your business still have an XT computer in the back office because it's\nrunning that one version of some database software that your business depends\non? Yeah, we know there is. Most modern software doesn't work like that.",[3425,3426],"legacy","project-management","/jbagley/2021-07/img/old_software_to_new.jpg","2021-07-01","content:jbagley:2021-07:SoftwareSenescence.md",{"user":3418,"name":3419},{"_path":3432,"title":3433,"description":3434,"tags":3435,"image":3437,"publishDate":3438,"_id":3439,"author":3440},"/jbagley/2021-08-01/accuratetiming","Accurate Timing","In many tasks we need to do something at given intervals of time. The most obvious ways may not give you the best results.",[2999,3436],"timing","/jbagley/2021-08-01/img/accurateTiming.jpg","2021-08-01","content:jbagley:2021-08-01:AccurateTiming.md",{"user":3418,"name":3419},{"_path":3442,"title":3443,"description":3444,"tags":3445,"image":3449,"publishDate":3450,"_id":3451,"author":3452},"/jbagley/2023-06-01/universal_ffmpeg_custom_builds","Building Universal FFmpeg Custom Binaries","I am using a very pared down set of FFMpeg features for a macOS project that I\nbuild into a custom library. I had a script set up to configure the build which\nworked fine on my Intel based MacBook Pro. Then I upgraded to an Apple Silicon\nMacBookPro and wanted to run natively, or at least see what happened when I\ndid. To build, FFMpeg uses autoconf which produces a makefile that then handles\nthe build.",[3446,3447,3448,2922],"c","bash","ffmpeg","/jbagley/2023-06-01/img/header.png","2024-04-01","content:jbagley:2023-06-01:Universal_FFMPEG_custom_builds.md",{"user":3418,"name":3419},{"_path":3454,"title":3455,"description":3456,"publishDate":3457,"image":3458,"tags":3459,"_id":3463,"author":3464},"/jbagley/2025-08/a_developers_primer_on_apple_tracking_transparency","A Primer on Apple's App Tracking Transparency","If an app tracks user activity, Apple requires them to declare all information they collect as well as whether that data is linked or tracked. This includes collection by the app itself and any third parties the app uses. The app owner is responsible for knowing and correctly reporting privacy information for all components in the app.","2026-05-22","/jbagley/2025-08/img/apple_app_transparency.png",[3460,3461,2921,3462],"app tracking transparency","att","macos","content:jbagley:2025-08:a_developers_primer_on_apple_tracking_transparency.md",{"user":3418,"name":3419},{"_path":5,"title":9,"description":10,"tags":3466,"image":17,"publishDate":18,"_id":2870,"author":3467},[12,13,14,15,16],{"user":2876,"name":2877},{"_path":3469,"title":3470,"description":3471,"publishDate":3472,"tags":3473,"image":3477,"_id":3478,"author":3479},"/nharrison/2012-07/core-data","Securing Your Core Data with Transformable Attributes","In order to store private data in an iOS Core Data database, there are several methods available for encryption, including:","2012-07-30",[3474,3475,2921,2936,3476],"core-data","encryption","objective-c","/nharrison/2012-07/img/superman.jpg","content:nharrison:2012-07:core-data.md",{"user":3480,"name":3481},"nharrison","Noah Harrison",{"_path":3483,"title":3484,"description":3485,"tags":3486,"publishDate":3491,"image":3492,"_id":3493,"author":3494},"/phendry/2019-3/restfromthebottomup","REST from the Bottom Up","The RESTful API has a funny place in the software development world: it's widely regarded as the best general-purpose pattern for building web application APIs, and yet it's also nebulous enough of a concept to cause endless disagreements within teams over exactly how to implement one.",[3487,3488,3489,3490],"rest","api","web","architecture","2019-10-01","/phendry/2019-3/img/feature_image.png","content:phendry:2019-3:RestFromTheBottomUp.md",{"user":3495,"name":3496},"phendry","Paul Hendry",{"_path":3498,"title":3499,"description":3500,"tags":3501,"publishDate":3428,"image":3502,"_id":3503,"author":3504},"/phendry/2021-06/smoothupgradestovue3","Smooth Upgrades to Vue 3","This post assumes basic familiarity with Vue.js v2.x.",[3038,3334,3162],"/phendry/2021-06/img/vue-transition.jpg","content:phendry:2021-06:SmoothUpgradesToVue3.md",{"user":3495,"name":3496},{"_path":3506,"title":3507,"description":3508,"image":3509,"tags":3510,"publishDate":3372,"_id":3511,"author":3512},"/phendry/2021-07-30/spotthevulndataranges","Spot the Vulnerability: Data Ranges and Untrusted Input","In 1997, a flaw was discovered in how Linux and Windows handled IP fragmentation, a Denial-of-Service vulnerability which allowed systems to be crashed remotely.","/phendry/2021-07-30/img/vulnerability.jpg",[2936,2886],"content:phendry:2021-07-30:SpotTheVulnDataRanges.md",{"user":3495,"name":3496},{"_path":3514,"title":3515,"description":3516,"tags":3517,"image":3518,"publishDate":3519,"_id":3520,"author":3521},"/phendry/2021-08-15/exploringdependenttypesinidris","Exploring Dependent Types in Idris","When I'm not coding the \"impossible\" at Art+Logic, I take a lot of interest in new programming technologies and paradigms; even if they're not yet viable for use in production, there can often be takeaways for improving your everyday code.",[3073],"/phendry/2021-08-15/img/dependent-types.jpg","2021-08-15","content:phendry:2021-08-15:ExploringDependentTypesInIdris.md",{"user":3495,"name":3496},{"_path":3523,"title":3524,"description":3525,"tags":3526,"image":3527,"publishDate":3528,"_id":3529,"author":3530},"/phendry/2021-10-30/spotthevulnloopsandtermconditions","Spot the Vulnerability: Loops and Terminating Conditions","In memory-unsafe languages like C, special care must be taken when copying untrusted data, particularly when copying it to another buffer. In this post, we'll spot and mitigate a past vulnerability in Linux's NTP daemon.",[2936,2886],"/phendry/2021-10-30/img/vulnerability-2.jpg","2021-10-30","content:phendry:2021-10-30:SpotTheVulnLoopsAndTermConditions.md",{"user":3495,"name":3496},{"_path":3532,"title":3533,"description":3534,"image":3535,"tags":3536,"publishDate":3537,"_id":3538,"author":3539},"/phendry/2022-07-21/migratingfromexpresstofastifypart1","Migrating from Express to Fastify, Part 1","Express.js has for years been the dominant lightweight Web framework for Node.js, but over time its development has stalled, with its latest major version (5.0) still in pre-release nearly eight years after its first alpha release. There's a lot to be said for this sort of stability in a foundational dependency for a project, but it's worth assessing whether the added features of competing frameworks are worth making a switch. In this article we'll be looking at Fastify in particular, to understand what it has to offer compared to Express and how difficult it is to migrate an existing Express project.","/phendry/2022-07-21/img/Migrating from Express to Fastify, Part 1.png",[3038,2886],"2023-12-01","content:phendry:2022-07-21:MigratingFromExpressToFastifyPart1.md",{"user":3495,"name":3496},{"_path":3541,"title":3542,"description":3543,"image":3544,"tags":3545,"publishDate":3546,"_id":3547,"author":3548},"/phendry/2022-07-28/migratingfromexpresstofastifypart2","Migrating from Express to Fastify, Part 2","In Part 1, we looked at the features of the Fastify Node.js Web framework compared to Express.js. In Part 2, we'll work through migrating an example Express.js application to Fastify.","/phendry/2022-07-28/img/Migrating from Express to Fastify, Part 2.png",[3038,2886],"2023-12-31","content:phendry:2022-07-28:MigratingFromExpressToFastifyPart2.md",{"user":3495,"name":3496},{"_path":3550,"title":3551,"description":3552,"tags":3553,"image":3554,"publishDate":3555,"_id":3556,"author":3557},"/phendry/2023-01-19/badcode","\"Bad\" Code (Or, Why Software Development is Hard)","Recently, the Dutch government open-sourced the iOS application for their \"DigiD\" authentication service. A tweet with a snippet of that source code, presumably making fun of it, blew up into a debate about whether mocking it is even justified. The amount of debate over such a simple snippet of code highlights, in my mind, just how tricky software development can be.",[2936,2886],"/phendry/2023-01-19/img/Bad Code.png","2024-01-15","content:phendry:2023-01-19:BadCode.md",{"user":3495,"name":3496},{"_path":3559,"title":3560,"description":3561,"image":3562,"publishDate":3563,"tags":3564,"_id":3565,"author":3566},"/phendry/2023-01-31/forgetaboutcodestyle","Forget About [Code] Style","Good code style, being highly subjective, is something often debated among developers. After all, we spend more time reading code than writing it, so it's worth making sure our code is styled to be as easy as possible to read and to understand. On the other hand, deciding upon and continuously enforcing a style is also time-consuming, and the benefits are near-impossible to quantify. Given that modern code formatting tools can fully automate the process, is it still worth fretting about style?","/phendry/2023-01-31/img/forget_style_header.png","2024-02-01",[3073],"content:phendry:2023-01-31:ForgetAboutCodeStyle.md",{"user":3495,"name":3496},{"_path":3568,"title":3569,"description":3570,"image":3571,"tags":3572,"publishDate":3573,"_id":3574,"author":3575},"/phendry/2023-04-02/semantichtml","Don't Give Up on Semantic HTML","Since the early days of the Web, there has been tension between the ideal of \"semantic HTML\" and the practical reality of designing complex page layouts, which often could not be achieved without inserting style concerns into the document. More recently, frameworks like Tailwind CSS have emerged which challenge the very idea that semantic HTML is an ideal to strive for, and which commit to thoroughly embedding style concerns into HTML documents. With modern CSS features however, semantic HTML is more achievable than ever, and I do think it remains a worthy goal.","/phendry/2023-04-02/img/Don't Give Up on Semantic HTML.png",[3073],"2024-03-01","content:phendry:2023-04-02:SemanticHtml.md",{"user":3495,"name":3496},{"_path":3577,"title":3578,"description":3579,"image":3580,"tags":3581,"publishDate":3582,"_id":3583,"author":3584},"/phendry/2023-05-16/doyouneedacsspreprocessor","Do You Need a CSS Preprocessor in 2023?","CSS preprocessors like Less, Sass and Stylus have long provided powerful features that vanilla CSS lacked: variables, nesting of rulesets, mixins, control flow constructs, etc. These days however, the feature gap is considerably narrower, and it's not so clear that the benefits of a preprocessor outweight the burdens of setting it up.","/phendry/2023-05-16/img/css_preprocessor_header.png",[3073],"2023-01-01","content:phendry:2023-05-16:DoYouNeedACSSPreprocessor.md",{"user":3495,"name":3496},{"_path":3586,"title":3587,"description":3588,"image":3589,"publishDate":3590,"tags":3591,"_id":3592,"author":3593},"/phendry/2023-07-28/dependencymanagement","Software Dependency Management: Best Practices","Leveraging third-party libraries and frameworks is essential in most modern software projects, and the projects we build at Art+Logic are no exception. The pressure on developers to rapidly deliver features is high, and there are so many commonalities in the details of each project (particularly in Web development) that a lot of development time can be saved by using well-designed libraries that handle the details.","/phendry/2023-07-28/img/dependency_header.png","2023-01-02",[3073],"content:phendry:2023-07-28:DependencyManagement.md",{"user":3495,"name":3496},{"_path":3595,"title":3596,"description":3597,"tags":3598,"publishDate":3601,"image":3602,"_id":3603,"author":3604},"/phendry/2023-11-06/frontendframeworksin2024","Frontend Frameworks in 2024: React, Svelte and Vue","Several years ago, Art+Logic settled on Vue.js as our preferred frontend Web framework. Now, in 2024, we feel it's time to revisit the frontend framework landscape to see how things have (or haven't) changed.",[3073,3599,3600,3334],"react","svelte","2024-05-15","/phendry/2023-11-06/img/frontend_frameworks_2024.png","content:phendry:2023-11-06:FrontendFrameworksIn2024.md",{"user":3495,"name":3496},{"_path":3606,"title":3607,"description":3608,"publishDate":3609,"tags":3610,"image":3613,"_id":3614,"author":3615},"/rbrubaker/2012-06/arduino-thermometer","Turn Your Mac into a Thermometer with Arduino","The topic of the Arduino came up around A&L's \"virtual water cooler\" last week. About a year and a half ago, I purchased a SparkFun Inventor's Kit for Arduino. The kit is a fun way for a hardware novice like me to get started and learn some basics. It comes with more than a dozen sample projects such as lighting LEDs, spinning a motor and generating audio.","2012-06-28",[3611,3612],"arduino","java","/rbrubaker/2012-06/img/arduino1.jpg","content:rbrubaker:2012-06:arduino-thermometer.md",{"user":3616,"name":3617},"rbrubaker","Ryan Brubaker",{"_path":3619,"title":3620,"description":3621,"publishDate":3622,"tags":3623,"_id":3626,"author":3627},"/rbrubaker/2012-06/coffe-backbone-1","Fun with CoffeeScript and Backbone.js : Part 1","CoffeeScript has been all the rage lately and I've been wanting to hop on board the bandwagon. I've also seen Backbone.js mentioned quite a bit and was even more intrigued after listening to this .NET Rocks podcast. I decided to convert some plain JavaScript code I had in a side project to use both CoffeeScript and Backbone.js and see how things went.","2012-06-06",[3624,3625,3063,2886],"backbone-js","coffeescript","content:rbrubaker:2012-06:coffe-backbone-1.md",{"user":3616,"name":3617},{"_path":3629,"title":3630,"description":3631,"publishDate":3632,"tags":3633,"_id":3634,"author":3635},"/rbrubaker/2012-06/coffee-backbone-2","Fun with CoffeeScript and Backbone.js : Part 2","In this post I’ll discuss the code that handles updating the UI.","2012-06-07",[3624,3625,3063,2886],"content:rbrubaker:2012-06:coffee-backbone-2.md",{"user":3616,"name":3617},{"_path":3637,"title":3638,"description":3639,"publishDate":3640,"tags":3641,"_id":3642,"author":3643},"/rbrubaker/2012-06/coffee-backbone-3","Fun with CoffeeScript and Backbone.js : Part 3","In this post I’ll discuss my thoughts on CoffeeScript and Backbone.js.","2012-06-08",[3624,3625,3063,2886],"content:rbrubaker:2012-06:coffee-backbone-3.md",{"user":3616,"name":3617},{"_path":3645,"title":3646,"description":3647,"publishDate":3648,"tags":3649,"_id":3650,"author":3651},"/rbrubaker/2012-07/prototypal-js","Prototypal vs. Functional Inheritance in JavaScript","If you ever found JavaScript's prototypal inheritance confusing, do yourself a favor and open this article, open a JavaScript console and code each example in the article. You will definitely come away with a better understanding of how prototypal inheritance works in JavaScript.","2012-07-11",[3625,3038],"content:rbrubaker:2012-07:prototypal-js.md",{"user":3616,"name":3617},{"_path":3653,"title":3654,"description":3655,"publishDate":3656,"tags":3657,"_id":3658,"author":3659},"/rbrubaker/2012-07/whither-pm","Whither Project Management?","When I was first asked to manage a project at Art & Logic, I had my reservations. Did I really want to start down a career path that led to less development? Would my skills as a developer go stale? My first few projects as a manager were solo projects so I still had plenty of development work and fortunately, I found myself to be a pretty easy person to manage. As time went on I started managing larger projects and with them came the responsibility to manage other developers. To my surprise I found project management to be rewarding and dare I say, even fun. It's very satisfying to work with clients, helping them define their visions and seeing those visions come to life.","2012-07-25",[3426],"content:rbrubaker:2012-07:whither-pm.md",{"user":3616,"name":3617},{"_path":3661,"title":3662,"description":3663,"tags":3664,"image":3667,"publishDate":3007,"_id":3668,"author":3669},"/scharette/2019-4/discover_machine_learning","Discover Machine Learning","Computers have been around for less than 100 years.  In that short period of time, some incredible things have happened:  they've been universally adopted so quickly that we have them in our houses.  In our cars.  Even in our pockets.  In the last 40 years, there have been many significant events when it comes to computers:",[3665,3666,2999],"machine-learning","neural-networks","/scharette/2019-4/img/discover_machine_learning.png","content:scharette:2019-4:discover_machine_learning.md",{"user":3670,"name":3671},"scharette","Stéphane Charette",{"_path":3673,"title":3674,"description":3675,"publishDate":3676,"image":3677,"tags":3678,"_id":3680,"author":3681},"/shuey/2012-05/baas","BaaS Offerings Continue to Grow","The makers of Simplenote recently introduced their Backend as a Service (BaaS) offering called Simperium that looks to compete in an increasingly crowded space with services like CloudMine, Kinvey, and Parse and to some extent with iCloud for iOS and OS X only apps. So just how crowded is this space? Back in February, Kinvey published their own map of the BaaS ecosystem that highlights different tiers of the ecosystem and various relationships between them.","2012-05-10","/shuey/2012-05/img/header.png",[3679],"baas","content:shuey:2012-05:baas.md",{"user":3682,"name":3683},"shuey","Steven Huey",{"_path":3685,"title":3686,"description":3687,"publishDate":3688,"tags":3689,"image":3691,"_id":3692,"author":3693},"/shuey/2012-05/cloud","Under the Sheets with iCloud and Core Data","Drew McCormack is writing a great series (Part 1, Part 2, Part 3) of posts about using iCloud for syncing Core Data managed data. It's harder than Apple lets on and Drew has done a great job of uncovering how this actually works.","2012-05-28",[2922,3690],"icloud","/shuey/2012-05/img/icloud.jpg","content:shuey:2012-05:cloud.md",{"user":3682,"name":3683},{"_path":3695,"title":3696,"description":3697,"publishDate":3698,"tags":3699,"_id":3701,"author":3702},"/shuey/2012-05/economics-android","The Economics of Android","If you haven't already do yourself a favor and head over to asymco.com to catch Horace Deidu's multi-post series on \"The Economics of Android\". Horace and Dan Benjamin discuss the series during this week's Critical Path podcast as well. Horace is a former analyst for Nokia and has been writing Asymco for a few years now. His analysis of the mobile industry and Apple's place within it in particular has been featured in publications such as Bloomberg and Forbes.","2012-05-17",[3700],"android","content:shuey:2012-05:economics-android.md",{"user":3682,"name":3683},{"_path":3704,"title":3705,"description":3706,"publishDate":3362,"tags":3707,"_id":3710,"author":3711},"/shuey/2012-05/iot","The Internet of Things and Big Data","I've been following the developments in the \"Internet of Things\" and Big Data / Open Data markets as new apps and tools are released and they look to be two exciting technologies on a collision course. With the advent of internet connected home appliances like Wattvision and Nest that provide real utility to the average home owner at reasonable prices along with crowd funded projects like Air Quality Egg or Twine we should see an explosion in the kinds and amount of useful and real-time or near real-time data that is available to anyone with a smartphone. Health metric or \"quantitative self\" tracking devices such as Fitbit, Jawbone Up, and the Pebble watch will fuel this data explosion as well.",[3708,3709],"big-data","iot","content:shuey:2012-05:iot.md",{"user":3682,"name":3683},{"_path":3713,"title":3714,"description":3715,"publishDate":3716,"tags":3717,"image":3719,"_id":3720,"author":3721},"/shuey/2012-05/rubymotion","RubyMotion Brings Ruby to iOS","RubyMotion is a new development toolchain that allows you to build iOS apps using Ruby created by Laurent Sansonetti, a former Apple engineer and contributor to the MacRuby project. It has garnered a lot of attention the past few weeks and some detailed reviews have already been written:","2012-05-14",[2921,3718],"ruby","/shuey/2012-05/img/logotype-icon.png","content:shuey:2012-05:rubymotion.md",{"user":3682,"name":3683},{"_path":3723,"title":3724,"description":3725,"publishDate":3726,"tags":3727,"image":3728,"_id":3729,"author":3730},"/shuey/2012-06/thoughts-ios6","A few thoughts on iOS 6","Apple made their session videos from WWDC 2012 available earlier this week in record time. It's nice to see since tickets for this years event sold out in under two hours. Apple has an iOS 6 Preview page touting some of the new features such as Siri's new abilities, tighter integration with Facebook, Photo Stream sharing, and things like iCloud tabs for Safari all of which look great.","2012-06-21",[2922,2921],"/shuey/2012-06/img/ios6.jpg","content:shuey:2012-06:thoughts-ios6.md",{"user":3682,"name":3683},{"_path":3732,"title":3733,"description":3734,"publishDate":3735,"tags":3736,"image":3738,"_id":3739,"author":3740},"/shuey/2012-07/mixer","A Simple Mixer Using AVFoundation","In iOS 4.0 Apple introduced the AV Foundation APIs that made working with audio and video media much easier than it had been in previous versions of iOS. Apple then brought these APIs to Mac OS X in OS X 10.7 \"Lion\". In this post I'll show how to use some of the APIs to create a simple four track mixer.","2012-07-02",[2922,3737,2921],"cocoa","/shuey/2012-07/img/mixer-screenshot.jpg","content:shuey:2012-07:mixer.md",{"user":3682,"name":3683},{"_path":3742,"title":3743,"description":3744,"publishDate":3745,"tags":3746,"image":3747,"_id":3748,"author":3749},"/shuey/2012-07/reset-button","The Reset Button","Horace Dediu of Asymco has been publishing some fantastic insights and analysis of the mobile market in the past few weeks. I linked to some of Dediu's analysis of the Economics of Android in an earlier post, and since then he's updated his work with the latest data and is studying RIM and Microsoft's efforts in the space as well.","2012-07-19",[3700,2922,2921],"/shuey/2012-07/img/kevin.jpg","content:shuey:2012-07:reset-button.md",{"user":3682,"name":3683},{"_path":3751,"title":3752,"description":3753,"publishDate":3754,"tags":3755,"image":3757,"_id":3758,"author":3759},"/tfarrel/2012-07","Looking at Steganography","With the help of one of my favorite news aggregators, I discovered this article on using JavaScript and the canvas element to hide information inside images. I've long been fascinated by steganography and this article and demonstration makes it even more accessible. If you can't be bothered to read the article, it describes a method of using the HTML5 File API and the canvas element to embed a message in images.","2012-07-24",[3756],"steganography","/tfarrel/2012-07/img/white.png","content:tfarrel:2012-07:index.md",{"user":3760,"name":3761},"tfarrel","Troy Farrel",1780330263271]