laravel-openapi icon indicating copy to clipboard operation
laravel-openapi copied to clipboard

Add operation optional elements

Open Mohammad-Alavi opened this issue 1 year ago • 0 comments

Description

Add summary, description & deprecated optional elements to Operation attribute.

This also fixes a problem ( #88) where you would get an error if you wouldn't provide summary or description and you had to at least provide an empty DocBlock to get around it. Now you can just omit the DocBlock all together.

This PR is completely backward compatible.

Docs are updated accordingly.

Summary

For the moment, we can only add summary, description & deprecated elements through DocBlock:

/**
 * Get all users
 *
 * Get all users from the database.
 * 
 * @deprecated This endpoint is deprecated.
 */

This PR makes it possible to do it through Operation attribute too:

#[Operation(summary: 'Get all users', description: 'Get all users from the database.', deprecated: true)]

resolve #93

Mohammad-Alavi avatar Sep 20 '23 14:09 Mohammad-Alavi