Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
3.3 kB
3
Indexable
Never
/**
 * @OA\Get(
 *   path="/v1/users/{id}",
 *   tags={"Users"},
 *   operationId="findUser",
 *   summary="Find User",
 *   @OA\Response(
 *     response=401,
 *     description="Error: Unauthorized",
 *     @OA\MediaType(
 *         mediaType="application/json",
 *     )
 *   ),
 *   @OA\Response(
 *     response=404,
 *     description="Error: Not Found",
 *     @OA\MediaType(
 *         mediaType="application/json",
 *     )
 *   ),
 *   @OA\Response(
 *     response=200,
 *     description="success",
 *
 *     @OA\MediaType(
 *         mediaType="application/json",
 *         example=
{
"data": {
    "id": 1,
    "name": "John Doe",
    "email": "john@example.com",
    "sip_address": "string@exampl.com",
    "mobile_phone": "+12223334444",
    "verified": true,
    "roles": {
        "admin",
        "user",
    },
    "permissions": {
        "create-post",
        "edit-user",
    },
}
},
 *     )
 *   ),
 *   security={
 *     {"apiToken": {}}
 *   },
 *  @OA\Parameter(in="path", name="id", required=true)
 * )
 */


/**
 * @OA\Get(
 *   path="/v1/users",
 *   tags={"Users"},
 *   operationId="getUsers",
 *   summary="Get Users",
 *   @OA\Response(
 *     response=401,
 *     description="Error: Unauthorized",
 *     @OA\MediaType(
 *         mediaType="application/json",
 *     )
 *   ),
 *   @OA\Response(
 *     response=200,
 *     description="success",
 *
 *     @OA\MediaType(
 *         mediaType="application/json",
 *         example=
{
"data": {
    {
        "id": 268,
        "name": "John Doe",
        "email": "john@example.com",
        "sip_address": null,
        "mobile_phone": "+19999999999",
        "verified": 1,
        "roles": {
            "user"
        },
        "permissions": {}
    },
    {
        "id": 267,
        "name": "Jack",
        "email": "jack@example.com",
        "sip_address": null,
        "mobile_phone": "+19999999999",
        "verified": null,
        "roles": {},
        "permissions": {}
    }
},
"links": {
    "first": "https://example.com/api/v1/users?page=1",
    "last": "https://example.com/api/v1/users?page=29",
    "prev": null,
    "next": "https://example.com/api/v1/users?page=2"
},
"meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 29,
    "links": {
        {
            "url": null,
            "label": "« Previous",
            "active": false
        },
        {
            "url": "https://example.com/api/v1/users?page=1",
            "label": 1,
            "active": true
        },
        {
            "url": "https://example.com/api/v1/users?page=2",
            "label": 2,
            "active": false
        },
        {
            "url": null,
            "label": "...",
            "active": false
        },
        {
            "url": "https://example.com/api/v1/users?page=29",
            "label": 29,
            "active": false
        },
        {
            "url": "https://example.com/api/v1/users?page=2",
            "label": "Next »",
            "active": false
        }
    },
    "path": "https://example.com/api/v1/users",
    "per_page": 2,
    "to": 2,
    "total": 57
}
}
 *     )
 *   ),
 *   security={
 *     {"apiToken": {}}
 *   },
 *   @OA\Parameter(in="query", name="limit", required=false),
 * )
 */