laravelapiblueprint

apiblueprint response download file


I'm trying to use apiblueprint.

How do I write the apib just like as below Laravel code?

public function getDownload()
{
    //PDF file is stored under project/public/download/info.pdf
    $file= public_path(). "/download/info.pdf";

    $headers = array(
              'Content-Type: application/pdf',
            );

    return Response::download($file, 'filename.pdf', $headers);
}

 apib file

## getDownload [GET]

+ Response 200 (application/pdf)??

Solution

  • You are missing the Resource. It should be something like:

    ## Resource Title [/path-to-get-the-pdf]
    
    ### Download [GET]
    
    + Response 200 (application/pdf)