"My First API", version: "0.1")] class OpenApi {} class MyController { #[OA\Get(path: '/api/data.json')] #[OA\Response(response: '200', description: 'The data')] public function getResource() { // ... } } Request <?php use OpenApi\Attributes as OA; use Illuminate\Foundation\Http\FormRequest; #[OA\Schema(schema: 'CreateUserRequest', title: ' ユーザー生成のリクエ class CreateUserRequest extends FromRequest { use BaseRequestTrait; #[OA\Property('username', description: ' ユーザー名', type: 'string', maxLength: 100, pattern: '^[a-zA-Z\d]{4,100}', example: 'scott', nullable: false)] public string $username; #[OA\Property('email', description: ' メールアドレス', type: 'string', maxLength: 320, pattern: '^[a-zA-Z0-9_.+-]+@([a-zA-Z0-9][a-zA-Z0-9-]*[a-zA- example: '
[email protected]',nullable: false)] public string $email;