From d4b4b165a4edf0dac5cdfa03719e63860838c7fb Mon Sep 17 00:00:00 2001 From: Marcus Wyche Date: Sat, 18 Jul 2026 16:19:43 -0400 Subject: [PATCH 1/2] Updates to figure out what a file server in swagger would look like --- .../fastapi-helloworld/src/hello_api/my_app.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/python/fastapi-helloworld/src/hello_api/my_app.py b/python/fastapi-helloworld/src/hello_api/my_app.py index 2a26878..63c3cdb 100644 --- a/python/fastapi-helloworld/src/hello_api/my_app.py +++ b/python/fastapi-helloworld/src/hello_api/my_app.py @@ -1,7 +1,23 @@ -from fastapi import FastAPI +from fastapi import FastAPI, UploadFile, File app = FastAPI() @app.get("/") async def root(): return {"message": "Hello World"} + + +@app.post("/upload/") +async def upload_file(file: UploadFile = File(...)): + # Read metadata + filename = file.filename + content_type = file.content_type + + # Read the actual contents (async) + contents = await file.read() + + return { + "filename": filename, + "content_type": content_type, + "file_size_bytes": len(contents) + } From e8a818f703e54973e2d40c27656111fea206e6ab Mon Sep 17 00:00:00 2001 From: Marcus Wyche Date: Sat, 18 Jul 2026 16:23:48 -0400 Subject: [PATCH 2/2] Updates to gitignore for gradle --- .gitignore | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitignore b/.gitignore index e5b3e50..4b247bf 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,9 @@ node_modules/ # Javascript .next next-env.d.ts + +# Gradle files +.gradle/ +build/ +!gradle/wrapper/gradle-wrapper.jar +!**/src/main/**/build/