AOSSIE-Org / AOSSIE-Org/PictoPy

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

Offen
#1,512 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug enhancement
Vorherrschende Sprache
Python
Sterne
283
Forks
679
Ø Merge
7 T. 2 Std.
Gemergte PRs (30 T.)
3

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.