Skip to content

Instantly share code, notes, and snippets.

@erenhatirnaz
Created October 24, 2021 14:06
Show Gist options
  • Save erenhatirnaz/114d673e0b12d9a9a568cbcfacbd0e3e to your computer and use it in GitHub Desktop.
Save erenhatirnaz/114d673e0b12d9a9a568cbcfacbd0e3e to your computer and use it in GitHub Desktop.
AddressController@show
/**
* @OA\Parameter(
* parameter="AddressId",
* description="Address ID",
* in="path",
* name="id",
* @OA\Schema(type="integer"),
* required=true,
* example=1,
* )
*
* @OA\Examples(
* example="AddressNotFound",
* summary="Address not found",
* value={"code": "common.not-found", "message": "Address not found."},
* )
*/
class AddressController extends Controller
{
// ...
/**
* Show
*
* @OA\Get(
* path="/api/address/{id}",
* tags={"Address"},
* security={{ "token": {} }},
* @OA\Parameter(ref="#/components/parameters/AddressId"),
* @OA\Response(response=401, ref="#/components/responses/UnauthorizedError"),
* @OA\Response(
* response=400,
* description="Bad request",
* @OA\JsonContent(
* ref="#/components/schemas/Error",
* examples={
* @OA\Examples(example="AddressNotFound", ref="#/components/examples/AddressNotFound"),
* }
* )
* ),
* @OA\Response(
* response=200,
* description="OK",
* @OA\JsonContent(
* allOf={@OA\Schema(ref="#/components/schemas/Success")},
* @OA\Property(property="data", type="object", ref="#/components/schemas/Address")
* )
* )
* )
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show(Request $request, $id)
{
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment