Skip to content

Instantly share code, notes, and snippets.

@pboethig
Last active October 16, 2016 09:29
Show Gist options
  • Save pboethig/52c770a6d09e0522b51d01064bc5e865 to your computer and use it in GitHub Desktop.
Save pboethig/52c770a6d09e0522b51d01064bc5e865 to your computer and use it in GitHub Desktop.
<?php namespace App\Modules\Api\Controllers;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
/**
* @SWG\Swagger(
* schemes={"http"},
* host="swagger.local",
* basePath="/lektionen/swagger/Api/public/Api",
* @SWG\Info(
* version="1.0.0",
* title="Main user api",
* description="This is our main user api. It contains all method to handle users...",
* termsOfService="",
* @SWG\Contact(
* email="[email protected]"
* ),
* @SWG\License(
* name="Private License",
* url="URL to the license"
* )
* ),
* @SWG\ExternalDocumentation(
* description="Find out more about this in our FAQ",
* url="http://www.google.de"
* )
* )
*/
class ApiController extends Controller {
/**
* @SWG\Get(
* path="/list",
* summary="List all users",
* tags={"User/list"},
* description="return a list of users",
* operationId="userslist",
* consumes={"application/json"},
* produces={"application/json"},
* @SWG\Response(
* response=200,
* description="successful operation",
* @SWG\Schema(
* type="array",
* @SWG\Items(ref="#/definitions/Users")
* ),
* ),
* @SWG\Response(
* response="404",
* description="Invalid tag value",
* ),
* security={
* {
* "usersstore_auth": {"write:users", "read:users"}
* }
* }
* )
*/
public function list()
{
$content = $this->getFakeData();
return response()->json($content, 200)->header('Content-Type', 'application/json');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment