API: KI-Deklaration als v1-Pflichtfeld, Legacy-Default fuer /service (Entscheidung 10.07.)
Befund: v1 hatte keine KI-Deklarationsfelder — Submit lief seit der KI-Kennzeichnungspflicht (09.07.) immer auf 422 und haette alle Legacy-API-Kunden blockiert (Suite uebersah es: Factory deklariert). - v1-Submit verlangt ai_text_declaration; der Call gilt dokumentiert als verbindliche Bestaetigung (Art. 50 KI-VO) und schliesst die Archiv-Kenntnisnahme (AGB par. 13) ein - Bild-Upload verlangt ai_declaration (original/ai_generated/ai_edited) - Legacy-/service-Aliasse defaulten auf none/original — das API-Kunden-Mailing (R6.4) weist auf die Erklaerungswirkung hin - OpenAPI v1.yml + lang-Hinweis aktualisiert; Tests erweitert (Submit/Image/LegacyCompatibility) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
9b2409ee54
commit
5c91e2e281
11 changed files with 213 additions and 10 deletions
|
|
@ -2,8 +2,10 @@
|
|||
|
||||
namespace App\Http\Requests\Api\V1;
|
||||
|
||||
use App\Enums\AiImageDeclaration;
|
||||
use Illuminate\Contracts\Validation\ValidationRule;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class StorePressReleaseImageRequest extends FormRequest
|
||||
{
|
||||
|
|
@ -18,12 +20,23 @@ class StorePressReleaseImageRequest extends FormRequest
|
|||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* KI-Kennzeichnung je Bild (Art. 50 KI-VO) ist im v1-Vertrag Pflicht;
|
||||
* Legacy-/service-Clients kennen das Feld nicht — dort greift der
|
||||
* Kompatibilitäts-Default „original" (Entscheidung 10.07.2026).
|
||||
*
|
||||
* @return array<string, ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
$isLegacyServiceCall = str_starts_with((string) $this->route()?->getName(), 'legacy-service.');
|
||||
|
||||
return [
|
||||
'image' => ['required', 'image', 'mimes:jpg,jpeg,png,webp', 'max:8192'],
|
||||
'ai_declaration' => [
|
||||
Rule::requiredIf(! $isLegacyServiceCall),
|
||||
'nullable',
|
||||
Rule::enum(AiImageDeclaration::class),
|
||||
],
|
||||
'title' => ['nullable', 'string', 'max:120'],
|
||||
'description' => ['nullable', 'string', 'max:500'],
|
||||
'copyright' => ['nullable', 'string', 'max:255'],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue