mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 23:59:26 +03:00
Merge pull request #1803 from javiereguiluz/patch-1
[Doc] Some minor fixes in index.rst
This commit is contained in:
commit
a306d6c96e
@ -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,34 +179,35 @@ 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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user