Add Pydantic response models for OpenAPI/Swagger docs - #10
Open
HaraldeRoessler wants to merge 1 commit into
Open
Add Pydantic response models for OpenAPI/Swagger docs#10HaraldeRoessler wants to merge 1 commit into
HaraldeRoessler wants to merge 1 commit into
Conversation
The OpenAPI/Swagger docs show empty response schemas for all endpoints
because no response_model is set on the FastAPI route decorators.
Adds response models for:
- GET /identity/verify/{did} -> VerifyResponse
- GET /reputation/query/{did} -> ReputationResponse
- GET /skill/trust-score/{did} -> TrustScoreResponse
- GET /identity/resolve/{did} -> DIDDocumentResponse
- GET /health -> HealthResponse
- POST /reputation/rate -> RateResponse
Discovered while debugging moltrust-openclaw plugin showing undefined
(see MoltyCel/moltrust-openclaw#1).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
MoltyCel
added a commit
that referenced
this pull request
Jul 28, 2026
…287) * docs(backlog): security-triage 2026-07-28 — die sieben Aufräum-Items Die erreichbaren Funde der Triage sind gefixt und deployt (mcp 1.26.0 → 1.28.1, moltrust-mcp-server #14; MoltGuard npm audit fix, moltguard #10). Was übrig bleibt, sind Struktur- und Hygiene-Probleme, die kein Versions-Bump löst: - pypdf streichen statt hochziehen (tote Dep, 4 Advisories, nirgends importiert) - liboqs-Pin klären (requirements pinnt 0.15.0, die Prod-venv kennt es nicht) - email → EmailStr (app/main.py:1219; der CR/LF-Fund läuft heute nur ins Leere, weil die stdlib serialisierungsseitig blockt — geprüft auf 3.12.3) - aiosmtplib/mcp/moltrust-mcp-server in requirements deklarieren (alle drei laufen, keiner steht drin) - Port-Check verwirft die Bind-Adresse (Z. ~186) → Fehlalarm auf 3006, und 8168 mit *-Binding würde er weiterhin nicht als solches erkennen - ruff in moltrust-mcp-server/ci.yml pinnen (ungepinnt, hat #14 rot gemacht) - Report-Abschnitt 1e: DID-Core-Link veraltet, und 1e prüft nichts Beim letzten Punkt weicht der Eintrag von der Vorlage ab: ein kaputter Markdown-Link ließ sich nicht belegen. 1e schreibt nackte URLs in einen Plaintext-Report, beide antworten 200; der Telegram-Pfad sendet zwar mit parse_mode=HTML, überträgt aber nur die Alert-Zeilen, nicht den Reportkörper. Belegbar sind nur der veraltete DID-Core-Verweis und die fehlende Mechanik. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * fix(deps): liboqs-python-Pin streichen — PyPI hat 0.15.0 zurückgezogen `liboqs-python==0.15.0` ist seit dem 2026-07-28 nicht mehr auf PyPI; das Projekt serviert nur noch 0.16.0, 0.15.0 antwortet 404. Damit scheitert `pip install -r requirements.txt`, und jeder PR im Repo läuft rot — auch reine Docs-PRs. Der letzte grüne Lauf auf main war 93ac358. Gestrichen statt auf 0.16.0 gehoben. Das entspricht dem, was tatsächlich läuft: die Prod-venv hat das Paket nie gehabt, `is_available()` in app/crypto/dilithium.py liest dort False, und es sind keine DILITHIUM_*-Variablen gesetzt. Der Import von `oqs` sitzt innerhalb der Funktionen, die Degradation ist gewollt und getestet. Ein Bump hätte bei jedem frischen Install eine PQC-Bibliothek hereingezogen, die kein Codepfad aufruft. Die Begründung des ursprünglichen Hard-Pins bleibt als Kommentar an der Fundstelle stehen, ausdrücklich mit der Bitte, ihn nicht blind wieder einzusetzen: der Supply-Chain-Einwand gegen ein pre-1.0, nicht FIPS-validiertes C-Binding (3-Modell-Review-Konsens) gilt weiter. Er ist nur nicht mit `==` gegen ein Projekt lösbar, das seine Releases zurückzieht — 0.10.2 existierte nie, 0.14.1/0.15.0 waren die realen, und 0.15.0 ist jetzt auch weg. Wieder deklarieren, wenn PQC scharf geht: gepinnt, gegen das dann existierende Release, und mit im Deploy verifizierter Installation statt angenommener. Verifiziert: `pip install --dry-run -r requirements.txt` in einer frischen venv auf Python 3.12.3 (die CI-Version) löst vollständig auf, rc=0. BACKLOG-Eintrag entsprechend von "offen" auf "erledigt" gezogen. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Swagger docs at /docs show empty response schemas (
{}) for all endpoints because noresponse_modelis set on the FastAPI route decorators. This makes it impossible for plugin/SDK developers to know what fields the API returns.The problem
All three sources tell a different story:
/identity/verify/{did}{did, verified, reputation}{}{did, verified, message, trustScore}/skill/trust-score/{did}{did, trust_score, grade, breakdown, ...}{}{did, score, grade, sybilRisk}/reputation/query/{did}{did, score, total_ratings}{}This caused the moltrust-openclaw plugin to show 'undefined' — fixed in MoltyCel/moltrust-openclaw#1.
Changes
Adds Pydantic response models for 6 core endpoints:
VerifyResponsefor GET /identity/verify/{did}ReputationResponsefor GET /reputation/query/{did}TrustScoreResponse+TrustScoreBreakdownfor GET /skill/trust-score/{did}DIDDocumentResponse+DIDDocumentMetadatafor GET /identity/resolve/{did}HealthResponsefor GET /healthRateResponsefor POST /reputation/rateTest plan
Generated with Claude Code