Skip to content

Commit

Permalink
Merge pull request #288 from uasoft-indonesia/feature/v1/auth-api-docs
Browse files Browse the repository at this point in the history
Feature/v1/auth api docs
  • Loading branch information
rizkiheryandi authored Jul 29, 2021
2 parents 6019799 + 15cd105 commit c82798d
Show file tree
Hide file tree
Showing 3 changed files with 252 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/Providers/BadasoServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function boot()
__DIR__.'/../Config/badaso-hidden-tables.php' => config_path('badaso-hidden-tables.php'),
__DIR__.'/../Config/badaso-watch-tables.php' => config_path('badaso-watch-tables.php'),
__DIR__.'/../Config/analytics.php' => config_path('analytics.php'),
__DIR__.'/../Swagger/swagger_models/settings/badaso.php' => app_path('Http/Swagger/swagger_models/settings/badaso.php'),
__DIR__.'/../Swagger/swagger_models' => app_path('Http/Swagger/swagger_models'),
], 'Badaso');

$this->publishes([
Expand Down
251 changes: 251 additions & 0 deletions src/Swagger/swagger_models/auth.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,251 @@
<?php

/**
* @OA\Post(
* path="/v1/auth/forgot-password",
* operationId="forgotPassword",
* tags={"auth"},
* summary="Forgot Password",
* description="Send forgot password request",
* @OA\RequestBody(
* @OA\MediaType(
* mediaType="application/json",
* @OA\Schema(
* @OA\Property(
* property="email",
* type="string",
* example="johndoe@gmail.com"
* ),
* )
* )
* ),
* @OA\Response(response=200, description="Successful operation"),
* @OA\Response(response=400, description="Bad request"),
* @OA\Response(response=401, description="Unauthorized"),
* @OA\Response(response=402, description="Payment Required"),
* )
*/

/**
* @OA\Post(
* path="/v1/auth/forgot-password-verify",
* operationId="forgotPasswordVerify",
* tags={"auth"},
* summary="Verify Forgot Password Token",
* description="Verify the forgot password token sent to the email",
* @OA\RequestBody(
* @OA\MediaType(
* mediaType="application/json",
* @OA\Schema(
* @OA\Property(
* property="email",
* type="string",
* example="johndoe@gmail.com"
* ),
* @OA\Property(
* property="token",
* type="string",
* example="123456"
* ),
* )
* )
* ),
* @OA\Response(response=200, description="Successful operation"),
* @OA\Response(response=400, description="Bad request"),
* @OA\Response(response=401, description="Unauthorized"),
* @OA\Response(response=402, description="Payment Required"),
* )
*/

/**
* @OA\Post(
* path="/v1/auth/login",
* operationId="login",
* tags={"auth"},
* summary="Login Authentication",
* description="Log in the user",
* @OA\RequestBody(
* @OA\MediaType(
* mediaType="application/json",
* @OA\Schema(
* @OA\Property(
* property="email",
* type="string",
* example="johndoe@gmail.com"
* ),
* @OA\Property(
* property="password",
* type="string",
* example=""
* ),
* @OA\Property(
* property="remember",
* type="boolean",
* example="false"
* ),
* )
* )
* ),
* @OA\Response(response=200, description="Successful operation"),
* @OA\Response(response=400, description="Bad request"),
* @OA\Response(response=401, description="Unauthorized"),
* @OA\Response(response=402, description="Payment Required"),
* )
*/

/**
* @OA\Post(
* path="/v1/auth/logout",
* operationId="logout",
* tags={"auth"},
* summary="Logout",
* description="Log out the current user",
* @OA\Response(response=200, description="Successful operation"),
* @OA\Response(response=400, description="Bad request"),
* @OA\Response(response=401, description="Unauthorized"),
* @OA\Response(response=402, description="Payment Required"),
* )
*/

/**
* @OA\Post(
* path="/v1/auth/re-request-verification",
* operationId="reRequestVerification",
* tags={"auth"},
* summary="Resend the verification token",
* description="Request the server to resend the verification token",
* @OA\RequestBody(
* @OA\MediaType(
* mediaType="application/json",
* @OA\Schema(
* @OA\Property(
* property="email",
* type="string",
* example="johndoe@gmail.com"
* ),
* )
* )
* ),
* @OA\Response(response=200, description="Successful operation"),
* @OA\Response(response=400, description="Bad request"),
* @OA\Response(response=401, description="Unauthorized"),
* @OA\Response(response=402, description="Payment Required"),
* )
*/

/**
* @OA\Post(
* path="/v1/auth/refresh-token",
* operationId="refreshToken",
* tags={"auth"},
* summary="Refresh Token for Authentication",
* description="Request the jwt refresh token",
* @OA\Response(response=200, description="Successful operation"),
* @OA\Response(response=400, description="Bad request"),
* @OA\Response(response=401, description="Unauthorized"),
* @OA\Response(response=402, description="Payment Required"),
* )
*/

/**
* @OA\Post(
* path="/v1/auth/register",
* operationId="register",
* tags={"auth"},
* summary="User Registration",
* description="Register the user",
* @OA\RequestBody(
* @OA\MediaType(
* mediaType="application/json",
* @OA\Schema(
* @OA\Property(
* property="name",
* type="string",
* example="John Doe"
* ),
* @OA\Property(
* property="email",
* type="string",
* example="johndoe@gmail.com"
* ),
* @OA\Property(
* property="password",
* type="string",
* example=""
* ),
* @OA\Property(
* property="passwordConfirmation",
* type="string",
* example=""
* ),
* )
* )
* ),
* @OA\Response(response=200, description="Successful operation"),
* @OA\Response(response=400, description="Bad request"),
* @OA\Response(response=401, description="Unauthorized"),
* @OA\Response(response=402, description="Payment Required"),
* )
*/

/**
* @OA\Post(
* path="/v1/auth/reset-password",
* operationId="resetPassword",
* tags={"auth"},
* summary="User Reset Password",
* description="Send reset password request",
* @OA\RequestBody(
* @OA\MediaType(
* mediaType="application/json",
* @OA\Schema(
* @OA\Property(
* property="email",
* type="string",
* example="johndoe@gmail.com"
* ),
* @OA\Property(
* property="token",
* type="string",
* example=""
* ),
* )
* )
* ),
* @OA\Response(response=200, description="Successful operation"),
* @OA\Response(response=400, description="Bad request"),
* @OA\Response(response=401, description="Unauthorized"),
* @OA\Response(response=402, description="Payment Required"),
* )
*/

/**
* @OA\Post(
* path="/v1/auth/verify",
* operationId="getUser",
* tags={"auth"},
* summary="Get User Info",
* description="Get the current user information",
* @OA\RequestBody(
* @OA\MediaType(
* mediaType="application/json",
* @OA\Schema(
* @OA\Property(
* property="email",
* type="string",
* example="johndoe@gmail.com"
* ),
* @OA\Property(
* property="token",
* type="string",
* example=""
* ),
* )
* )
* ),
* @OA\Response(response=200, description="Successful operation"),
* @OA\Response(response=400, description="Bad request"),
* @OA\Response(response=401, description="Unauthorized"),
* @OA\Response(response=402, description="Payment Required"),
* )
*/
8 changes: 0 additions & 8 deletions src/Swagger/swagger_models/settings/badaso.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@
* )
*/

/**
* @OA\Get(
* path="/",
* description="Home page",
* @OA\Response(response="default", description="Welcome page")
* )
*/

/**
* @OA\SecurityScheme(
* type="http",
Expand Down

0 comments on commit c82798d

Please sign in to comment.