Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

feat: add Pydantic response models for all endpoints

Open
#41 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
fastapi, python
Domain
api, backend

Research direction

Start in app.py by locating the six endpoint handlers and their hand-built dict or JSONResponse results, beginning with the /healthz example. Trace the response shapes for each route, including the nested /schema, /columns, and vector cell objects, then verify that the generated OpenAPI schemas and handler responses match the declared models.

Written by the indexing model from the issue text.

Description

enhancement

Right now all six endpoints return plain dict / JSONResponse objects constructed by hand in app.py. FastAPI can infer loose schemas from the return type hints but there is no enforced contract between the backend and the frontend, and the OpenAPI schema that FastAPI generates is correspondingly thin.

Adding Pydantic response models would:

  • Give the frontend a stable contract to rely on. Serialization drift between backend versions would fail in the route handler rather than silently returning a malformed shape to the UI.
  • Produce a much richer OpenAPI schema. This pairs naturally with #23, which covers exposing the Swagger UI at /docs.
  • Catch bugs at the boundary. If serialize_arrow_value returns something that does not match the declared shape, Pydantic raises a clear validation error instead of the frontend getting mystery fields.

No new dependencies: Pydantic is already a transitive dependency of FastAPI.

Sketch:

from pydantic import BaseModel

class HealthResponse(BaseModel):
    ok: bool
    app_version: str
    lancedb_version: str
    pyarrow_version: str
    build_tag: str | None = None
    compat: dict[str, bool]

@app.get("/healthz", response_model=HealthResponse)
async def healthz() -> HealthResponse:
    ...

Scope: one model per endpoint (six total), plus the nested shapes for /schema, /columns, and the vector cell object. Can be done in a single PR without touching any business logic, just the return types and response construction.

Dominant language
Python
Stars
65
Forks
8
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from lance-format/lance-data-viewer

All issues in lance-format/lance-data-viewer

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.