API-Doku: OpenAPI-Spec aus public/ statt geloeschtem docs/ ausliefern

Der docs/-Mount kam nicht mit; die Route /docs/api/v1 lief dadurch auf 500.
Liest jetzt public/api/v1.yml mit 404-Guard.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Kevin Adametz 2026-07-09 15:34:28 +00:00
parent f11e8aab7c
commit 07e0bc598e
2 changed files with 318 additions and 1 deletions

View file

@ -283,7 +283,11 @@ Route::get('/robots.txt', function () {
// Sprach-/Edition-unabhängige Routen (API-Doku).
// ---------------------------------------------------------------------------
Route::get('/docs/api/v1', function () {
return response((string) file_get_contents(base_path('docs/api/v1.yml')), 200, [
$path = public_path('api/v1.yml');
abort_unless(is_file($path), 404);
return response((string) file_get_contents($path), 200, [
'Content-Type' => 'application/yaml; charset=UTF-8',
]);
})->name('docs.api.v1');