From 051fca907060deb0d75a0defd39dffd7deec07e1 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Tue, 23 Mar 2021 20:13:05 +0100 Subject: [PATCH] [Doc] Some minor fixes in index.rst --- Resources/doc/index.rst | 65 +++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/Resources/doc/index.rst b/Resources/doc/index.rst index b5d2af4..97277f7 100644 --- a/Resources/doc/index.rst +++ b/Resources/doc/index.rst @@ -72,7 +72,7 @@ Open a command console, enter your project directory and execute the following c defaults: { _controller: nelmio_api_doc.controller.swagger } As you just installed the bundle, you'll likely see routes you don't want in - your documentation such as `/_profiler/`. To fix this, you can filter the + your documentation such as ``/_profiler/``. To fix this, you can filter the routes that are documented by configuring the bundle: .. code-block:: yaml @@ -140,8 +140,8 @@ To document your routes, you can use the SwaggerPHP annotations and the class UserController { -       /** -         * List the rewards of the specified user. + /** + * List the rewards of the specified user. * * This call takes into account all confirmed awards, but not pending or refused awards. * @@ -179,48 +179,49 @@ Use it instead of a definition reference and the bundle will deduce your model p .. note:: -    A model can be a Symfony form type, a Doctrine ORM entity or a general PHP object. + A model can be a Symfony form type, a Doctrine ORM entity or a general PHP object. This annotation has two options: * ``type`` to specify your model's type:: /** -     * @SWG\Response( -     * response=200, -     *     @Model(type=User::class) -     * ) -     */ + * @SWG\Response( + * response=200, + * @Model(type=User::class) + * ) + */ * ``groups`` to specify the serialization groups used to (de)serialize your model:: -   /** -     * @SWG\Response( -     * response=200, -     *     @Model(type=User::class, groups={"non_sensitive_data"}) -     * ) -     */ + /** + * @SWG\Response( + * response=200, + * @Model(type=User::class, groups={"non_sensitive_data"}) + * ) + */ - .. tip:: +.. tip:: - When used at the root of ``@SWG\Response`` and ``@SWG\Parameter``, ``@Model`` is automatically nested - in a ``@SWG\Schema``. + When used at the root of ``@SWG\Response`` and ``@SWG\Parameter``, ``@Model`` + is automatically nested in a ``@SWG\Schema``. - To use ``@Model`` directly within a ``@SWG\Schema``, ``@SWG\Items`` or ``@SWG\Property``, you have to use the ``$ref`` field:: + To use ``@Model`` directly within a ``@SWG\Schema``, ``@SWG\Items`` or + ``@SWG\Property``, you have to use the ``$ref`` field:: - /** - * @SWG\Response( - * @SWG\Schema(ref=@Model(type=User::class)) - * ) - * - * or - * - * @SWG\Response( - * @SWG\Schema(type="object", - * @SWG\Property(property="foo", ref=@Model(type=FooClass::class)) - * ) - * ) - */ + /** + * @SWG\Response( + * @SWG\Schema(ref=@Model(type=User::class)) + * ) + * + * or + * + * @SWG\Response( + * @SWG\Schema(type="object", + * @SWG\Property(property="foo", ref=@Model(type=FooClass::class)) + * ) + * ) + */ Symfony Form types ~~~~~~~~~~~~~~~~~~