AOSSIE-Org / AOSSIE-Org/PictoPy

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

オープン
#1,512 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug enhancement
主要言語
Python
スター
283
フォーク
679
平均マージ
7日 2時間
マージ済み PR(30日)
3

説明

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

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。