AOSSIE-Org / AOSSIE-Org/PictoPy

BUG: Backend startup writes to tracked docs/backend/backend_python/openapi.json, dirtying the working tree

Abierto
#1,512 2 comentarios 0 reacciones 0 asignados Ver en GitHub
bug enhancement
Lenguaje dominante
Python
Estrellas
283
Forks
679
Merge medio
7 d 2 h
PR fusionados (30 d)
3

Descripción

### Is there an existing issue for this?

- [x] I have searched the existing issues

### What happened?

`generate_openapi_json()` is called during backend startup (`backend/main.py:76`) and writes the schema directly into the tracked file `docs/backend/backend_python/openapi.json` (`backend/main.py:~154-161`). As a result, simply running the backend leaves the git working tree dirty.

**Steps to reproduce:**
1. Fresh clone, backend deps installed in a venv.
2. `cd backend && python main.py`, let it start, then stop it.
3. `git status` → `docs/backend/backend_python/openapi.json` shows as modified.

On my clone the resulting diff was 31 lines (25 insertions, 6 deletions), so the committed copy is also currently out of sync with what the code generates.

**Why this matters**

Any contributor who runs the backend gets a spurious modification to a committed file. It's easy to `git add .` and commit it by accident, and it adds noise to `git status` during normal development.

**Context**

The auto-generation of `openapi.json` on startup was introduced in #483 (Swagger docs integration), so the committed spec is intentional — this isn't a request to stop tracking it. There was also related interest in decoupling OpenAPI generation from app startup in #1167, which was closed unmerged only because no issue was linked. This issue is meant to be that tracking issue for the concrete symptom.

**Possible directions (open to maintainer preference)**

- Generate the spec via an explicit script / pre-commit hook / CI step rather than on every server start, and optionally have CI fail if it's stale.
- Or write it to a non-tracked build location and have the docs pipeline pull from there.

Happy to open a PR once maintainers confirm the preferred direction.

### Record

- [x] I agree to follow this project's Code of Conduct

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.