AOSSIE-Org / AOSSIE-Org/PictoPy

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

Ouverte
#1,512 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
bug enhancement
Langage dominant
Python
Étoiles
283
Forks
679
Merge moyen
7 j 2 h
PR mergées (30 j)
3

Description

### 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

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.