Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multiline description #1319

Open
dmitrach opened this issue Sep 29, 2022 · 2 comments
Open

Support multiline description #1319

dmitrach opened this issue Sep 29, 2022 · 2 comments

Comments

@dmitrach
Copy link

dmitrach commented Sep 29, 2022

I've have a long description, there is more 120 characters in a line and it is a problem for reading and for PHP CS Fixer.

I would like to divide the line into multiple lines. Currently I cannot do it due to extra symbols like * of a multiline comment. Also it cannot work with markdown, for example, a list.

/*
 * @OA\Schema(
 *   schema="AuthorizationStatus",
 *   type="integer",
 *   description=">
 *     An authorization status: 
 *     - 1 - registration isn't finished, 
 *     - 2 - a user has an active booking, 
 *     - 3 - a user has been registered without an active booking.",
 *   enum={1, 2, 3},
 *   example=1
 * )
 */

The current result.

description: ">\n *   An authorization status:\n *   - 1 - registration isn't finished,\n *   - 2 - a user has an active booking, \n *   3 - a user has been registered without an active booking."

Expected.

description: >
  An authorization status:
  - 1 - registration isn't finished,
  - 2 - a user has an active booking, 
  - 3 - a user has been registered without an active booking.

As a result I've removed * from comments to get the desired result.

/*
 * @OA\Schema(
 *   schema="AuthorizationStatus",
 *   type="integer",
 *   description=">
An authorization status: 
- 1 - registration isn't finished, 
- 2 - a user has an active booking, 
- 3 - a user has been registered without an active booking.",
 *   enum={1, 2, 3},
 *   example=1
 * )
 */
@DerManoMann
Copy link
Collaborator

Might be something to just document. Looking at the Doctrine Annotations project I do not think that is going to be supported at all.

@rlehner-dk
Copy link

rlehner-dk commented Aug 29, 2023

I recommend the usage of PHP 8.2 attributes, with HEREDOC
Unfortunately I did not find this way in the documentary either

#[OA\Schema(
    schema: 'AuthorizationStatus',
    description: <<<HEREDOC
    An authorization status: 
    - 1 - registration isn't finished, 
    - 2 - a user has an active booking, 
    - 3 - a user has been registered without an active booking.
    HEREDOC,
    type: 'integer',
    enum: [1, 2, 3],
    example: 1
)]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants