<?php

namespace App\Controllers;

use OpenApi\Annotations as OA;
use OpenApi\Generator;

class SwaggerController extends BaseController
{
    public function view()
    {
        // echo 'Hai'; die;
        return view('swagger/index');
    }

    public function generate()
    {
        header('Content-Type: application/json');
        $openapi = Generator::scan([APPPATH . 'Controllers', APPPATH . 'Models']);
        dd($openapi);
        echo $openapi->toJson();
    }
}
