Skip to content

Commit c209cab

Browse files
d-j-hattonvredchenko
authored andcommitted
add response media type information for openapi schema for image endpoints
1 parent ec032d9 commit c209cab

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ repos:
2626
]
2727

2828
- repo: https://github.com/astral-sh/ruff-pre-commit
29-
rev: v0.8.6
29+
rev: v0.14.14
3030
hooks:
31-
- id: ruff
32-
args: [--force-exclude]
31+
- id: ruff-check
3332
- id: ruff-format
34-
args: [--force-exclude]

src/smartem_backend/api_server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2366,7 +2366,7 @@ def complete(self):
23662366
return [LatentRepresentationResponse(foilhole_uuid=k, x=v.x, y=v.y, index=v.index) for k, v in rep.items() if v]
23672367

23682368

2369-
@app.get("/grids/{grid_uuid}/atlas_image")
2369+
@app.get("/grids/{grid_uuid}/atlas_image", responses={200: {"content": {"image/png": {}}}})
23702370
def get_grid_atlas_image(
23712371
grid_uuid: str,
23722372
x: int | None = None,
@@ -2393,7 +2393,7 @@ def get_grid_atlas_image(
23932393
return Response(im_bytes, media_type="image/png")
23942394

23952395

2396-
@app.get("/gridsquares/{gridsquare_uuid}/gridsquare_image")
2396+
@app.get("/gridsquares/{gridsquare_uuid}/gridsquare_image", responses={200: {"content": {"image/png": {}}}})
23972397
def get_gridsquare_image(
23982398
gridsquare_uuid: str,
23992399
db: SqlAlchemySession = DB_DEPENDENCY,

0 commit comments

Comments
 (0)