HOW TO GENERATE AN API DOCUMENTATION

Mar 27, 2022 Copy Link

ู…ู† ุงู„ุญุงุฌุงุช ุงู„ุฌู…ูŠู„ุฉ ููŠ Laravel ุฅู†ู‡ ููŠ packages ูƒุชูŠุฑ ู‡ุชุณุงุนุฏูƒ ููŠ ุดุบู„ูƒ ูˆ ู‡ู†ุง ููŠ ุงู„ู…ู‚ุงู„ุฉ ุฏูŠ ู‡ุชูƒู„ู… ุนู† ุฅุฒุงูŠ ุชุนู…ู„ documentation ู„ู„ APIs ุจุชุงุนุชูƒ ๐Ÿ“–

 

ุทูŠุจ ุฅุญู†ุง ุจู†ุญุชุงุฌ ุฒูŠ ุฏูŠ ููŠ ุฅูŠู‡ุŸ ๐Ÿค”

 

ู‡ู‚ูˆู„ูƒ ุฅู†ู†ุง ุจู†ุญุชุงุฌ ุญุงุฌุฉ ุฒูŠ ุฏูŠ ู„ู…ุง ูŠูƒูˆู† ููŠ Mobile Team ุดุบุงู„ ู…ุนุงู†ุง ูู„ุงุฒู… ู‡ู†ุง ู‡ู†ุญุชุงุฌ ุงู„ documentation ุนุดุงู† ู†ุนุฑูู‡ู… ุชูุงุตูŠู„ ูƒู„ Endpoint ๐Ÿ”ญ

 

ุฃูˆู„ package ู…ุนุงู†ุง ู‡ุชุณุงุนุฏูƒ ููŠ ุงู„ู…ูˆุถูˆุน ุฏุง ู‡ูŠ L5-Swagger ๐Ÿ—ƒ

 

ุงู„ุจุงูƒุฏุฌ ุฏูŠ ุฌู…ูŠู„ุฉ ุฌุฏุงู‹ ุจุณ ู…ุญุชุงุฌุฉ ุฅู†ูƒ ุชูƒุชุจ ูƒู„ ุญุงุฌุฉ ุจู†ูุณูƒ, ุจู…ุนู†ูŠ ุฅู†ูƒ ู„ู…ุง ุชุญุจ ุชุนู…ู„ documentation ู„ุงุฒู… ุชูƒุชุจ ุงู„ meta-data ููˆู‚ ูƒู„ function ุจุชูˆุถุญ ููŠู‡ุง ุดูˆูŠุฉ ู…ุนู„ูˆู…ุงุช ุฒูŠ ุงู„ูƒูˆุฏ ุฏุง ๐Ÿ‘‡

 

/**
 * @OA\Put(
 *     path="/users/{user}",
 *     summary="Update a user by their ID",
 *     @OA\Parameter(
 *         description="Updates the details of an existing user identified by the given ID.",
 *         in="path",
 *         name="user",
 *         required=true,
 *         @OA\Schema(type="string"),
 *         @OA\Examples(example="int", value="1", summary="A sample user ID"),
 *     ),
 *     @OA\Response(
 *         response=200,
 *         description="OK"
 *     )
 * )
 */
public function update(User $user)
{
    // Perform the update operation here...
}

 

ูˆ ู…ู† ุฎู„ุงู„ ุงู„ูƒูˆุฏ ุงู„ู„ูŠ ููˆู‚ ุฏุง ู‡ูŠุจุงู† ููŠ ุงู„ documentation ุงู„ุญุงุฌุงุช ุงู„ู„ูŠ ุฅู†ุช ูƒุชุจุชู‡ุง ุฒูŠ ุงู„ path ูˆ ูˆุตู ู„ู„ API ูˆ ูƒู…ุงู† ุจุชูˆุตู ุดูƒู„ ุงู„ response ุจุชุงุนูƒ ๐Ÿง

 

ูˆ ู…ุน package ุฒูŠ ุฏูŠ ูƒู„ ู…ุง ุชุถูŠู ุฃูˆ ุชุนุฏู„ ุฃูˆ ุชุญุฐู route ู„ุงุฒู… ุชุนุฏู„ ุงู„ documentation ุจู†ูุณูƒ, ุจุณ ุฅู†ุช ูƒ developer ู…ู…ูƒู† ู…ุชุญุจุด ุญุงุฌุฉ ุฒูŠ ุฏูŠ ู„ุฅู†ูƒ ุจุชูƒูˆู† ู…ูู‡ุชู… ุจุงู„ูƒูˆุฏ ุจุณ ูˆ ุนุดุงู† ูƒุฏุง ู‡ู‚ูˆู„ูƒ ุนู„ูŠ ุจุงูƒุฏุฌ ุชุงู†ูŠุฉ ูˆ ู‡ูŠ Swagger ๐Ÿ—ƒ

 

ุงู„ุจุงูƒุฏุฌ ุฏูŠ ุฌู…ูŠู„ุฉ ุฌุฏุงู‹ ูˆุณู‡ู„ุฉ ุงู„ุฅุณุชุฎุฏุงู… ูˆุจูู…ุฌุฑุฏ ุฅู†ูƒ ุชุนู…ู„ู‡ุง install ูˆุชุฑุญ ู„ู„ request-docs/ ู‡ุชู„ุงู‚ูŠ documentation ู…ูุญุชุฑู… ู…ุณุชู†ูŠูƒ ๐Ÿš€

 

ูˆ ุจูƒุฏุง ุฃูƒูˆู† ุฎู„ุตุช ูˆ ุฃุชู…ู†ูŠ ุชูƒูˆู† ุฅุณุชูุฏุช โœ”

Share via

Mahmoud Ramadan

Mahmoud Ramadan

Mahmoud is the creator of Digging Code and a contributor to Laravel since 2020.

Newly published

  • How to Enable Relationship Autoloading in Versions Before v12.8

    How to Enable Relationship Autoloading in Versions Before v12.8

    PREMIUM

  • Get your environment ready to welcome Laravel v12

    Get your environment ready to welcome Laravel v12

    PREMIUM

  • How to generate Arabic PDF using TCPDF

    How to generate Arabic PDF using TCPDF

    FREE