Skip to content

Instantly share code, notes, and snippets.

@erenhatirnaz
Created November 3, 2021 05:52
Show Gist options
  • Save erenhatirnaz/57e94f9bb547dcf04c27b058e6fcd5f0 to your computer and use it in GitHub Desktop.
Save erenhatirnaz/57e94f9bb547dcf04c27b058e6fcd5f0 to your computer and use it in GitHub Desktop.
class AuthController extends Controller
{
/**
* User Login
*
* @OA\Post(
* path="api/auth/login",
* tags={"Auth"},
* @OA\RequestBody(ref="#/components/requestBodies/LoginRequest"),
* @OA\Response(
* response=400,
* description="Bad request",
* @OA\JsonContent(
* ref="#/components/schemas/Error",
* example={"code": "auth.incorrect", "message": "Incorrect information."},
* )
* ),
* @OA\Response(
* response=200,
* description="OK",
* @OA\JsonContent(
* allOf={@OA\Schema(ref="#/components/schemas/Success")},
* @OA\Property(
* property="data",
* type="object",
* @OA\Property(property="token", type="string", format="uuid", example="Authorization token", example="71c943d9-944f-4584-a523-2592064ae282"),
* )
* )
* )
* )
*/
public function login(LoginRequest $request)
{
// ...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment