mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 15:51:48 +03:00
Fix DOCtor-RST errors
This commit is contained in:
parent
5195058abb
commit
7bc9462e7e
@ -40,7 +40,7 @@ Then update your routing to be able to access your different documentations:
|
|||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
# app/config/routing.yml
|
# app/config/routing.yaml
|
||||||
app.swagger_ui:
|
app.swagger_ui:
|
||||||
path: /api/doc/{area}
|
path: /api/doc/{area}
|
||||||
methods: GET
|
methods: GET
|
||||||
|
@ -5,7 +5,7 @@ A command is provided in order to dump the documentation in ``json``, ``yaml`` o
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ php app/console nelmio:apidoc:dump [--format="..."]
|
$ php bin/console nelmio:apidoc:dump [--format="..."]
|
||||||
|
|
||||||
The ``--format`` option allows to choose the format (default is: ``json``).
|
The ``--format`` option allows to choose the format (default is: ``json``).
|
||||||
|
|
||||||
@ -14,20 +14,20 @@ without whitespace, use the ``--no-pretty`` option.
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ php app/console nelmio:apidoc:dump --format=json > json-pretty-formatted.json
|
$ php bin/console nelmio:apidoc:dump --format=json > json-pretty-formatted.json
|
||||||
$ php app/console nelmio:apidoc:dump --format=json --no-pretty > json-no-pretty.json
|
$ php bin/console nelmio:apidoc:dump --format=json --no-pretty > json-no-pretty.json
|
||||||
|
|
||||||
Every format can override API url. Useful if static documentation is not hosted on API url:
|
Every format can override API url. Useful if static documentation is not hosted on API url:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ php app/console nelmio:apidoc:dump --format=yaml --server-url "http://example.com/api" > api.yaml
|
$ php bin/console nelmio:apidoc:dump --format=yaml --server-url "http://example.com/api" > api.yaml
|
||||||
|
|
||||||
For example to generate a static version of your documentation you can use:
|
For example to generate a static version of your documentation you can use:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ php app/console nelmio:apidoc:dump --format=html > api.html
|
$ php bin/console nelmio:apidoc:dump --format=html > api.html
|
||||||
|
|
||||||
By default, the generated HTML will add the sandbox feature.
|
By default, the generated HTML will add the sandbox feature.
|
||||||
If you want to generate a static version of your documentation without sandbox,
|
If you want to generate a static version of your documentation without sandbox,
|
||||||
@ -40,6 +40,6 @@ or configure UI configuration, use the ``--html-config`` option.
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ php app/console nelmio:apidoc:dump --format=html --html-config '{"assets_mode":"offline","server_url":"https://example.com","swagger_ui_config":{"supportedSubmitMethods":[]}}' > api.html
|
$ php bin/console nelmio:apidoc:dump --format=html --html-config '{"assets_mode":"offline","server_url":"https://example.com","swagger_ui_config":{"supportedSubmitMethods":[]}}' > api.html
|
||||||
|
|
||||||
.. _`configure Swagger UI`: https://swagger.io/docs/open-source-tools/swagger-ui/usage/configuration/
|
.. _`configure Swagger UI`: https://swagger.io/docs/open-source-tools/swagger-ui/usage/configuration/
|
||||||
|
@ -10,7 +10,7 @@ A: You can configure ``schemas`` in the nelmio_api_doc configuration and then re
|
|||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
# config/nelmio_api_doc.yml
|
# config/nelmio_api_doc.yaml
|
||||||
nelmio_api_doc:
|
nelmio_api_doc:
|
||||||
documentation:
|
documentation:
|
||||||
components:
|
components:
|
||||||
@ -125,7 +125,7 @@ If you have not set up this script, you can manually execute this command:
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ bin/console assets:install --symlink
|
$ php bin/console assets:install --symlink
|
||||||
|
|
||||||
Re-add Google Fonts
|
Re-add Google Fonts
|
||||||
-------------------
|
-------------------
|
||||||
@ -194,7 +194,7 @@ A: Use ``@OA\Tag`` annotation.
|
|||||||
*/
|
*/
|
||||||
class BookmarkController extends AbstractFOSRestController implements ContextPresetInterface
|
class BookmarkController extends AbstractFOSRestController implements ContextPresetInterface
|
||||||
{
|
{
|
||||||
//...
|
// ...
|
||||||
}
|
}
|
||||||
|
|
||||||
Disable Default Section
|
Disable Default Section
|
||||||
|
@ -8,7 +8,7 @@ What's supported?
|
|||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
This bundle supports *Symfony* route requirements, PHP annotations, `Swagger-Php`_ annotations,
|
This bundle supports *Symfony* route requirements, PHP annotations, `Swagger-Php`_ annotations,
|
||||||
`FOSRestBundle`_ annotations and apps using `Api-Platform`_.
|
`FOSRestBundle`_ annotations and applications using `Api-Platform`_.
|
||||||
|
|
||||||
.. _`Swagger-Php`: https://github.com/zircote/swagger-php
|
.. _`Swagger-Php`: https://github.com/zircote/swagger-php
|
||||||
.. _`FOSRestBundle`: https://github.com/FriendsOfSymfony/FOSRestBundle
|
.. _`FOSRestBundle`: https://github.com/FriendsOfSymfony/FOSRestBundle
|
||||||
@ -145,8 +145,8 @@ To document your routes, you can use the SwaggerPHP annotations and the
|
|||||||
|
|
||||||
namespace AppBundle\Controller;
|
namespace AppBundle\Controller;
|
||||||
|
|
||||||
use AppBundle\Entity\User;
|
|
||||||
use AppBundle\Entity\Reward;
|
use AppBundle\Entity\Reward;
|
||||||
|
use AppBundle\Entity\User;
|
||||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||||
use Nelmio\ApiDocBundle\Annotation\Security;
|
use Nelmio\ApiDocBundle\Annotation\Security;
|
||||||
use OpenApi\Annotations as OA;
|
use OpenApi\Annotations as OA;
|
||||||
@ -187,8 +187,8 @@ To document your routes, you can use the SwaggerPHP annotations and the
|
|||||||
|
|
||||||
namespace AppBundle\Controller;
|
namespace AppBundle\Controller;
|
||||||
|
|
||||||
use AppBundle\Entity\User;
|
|
||||||
use AppBundle\Entity\Reward;
|
use AppBundle\Entity\Reward;
|
||||||
|
use AppBundle\Entity\User;
|
||||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||||
use Nelmio\ApiDocBundle\Annotation\Security;
|
use Nelmio\ApiDocBundle\Annotation\Security;
|
||||||
use OpenApi\Attributes as OA;
|
use OpenApi\Attributes as OA;
|
||||||
@ -225,7 +225,7 @@ To document your routes, you can use the SwaggerPHP annotations and the
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
The normal PHPdoc block on the controller method is used for the summary and description.
|
The normal PHPDoc block on the controller method is used for the summary and description.
|
||||||
|
|
||||||
.. tip::
|
.. tip::
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ This will add the Bearer security policy to all registered paths.
|
|||||||
Overriding Specific Paths
|
Overriding Specific Paths
|
||||||
-------------------------
|
-------------------------
|
||||||
|
|
||||||
The security policy can be overriden for a path using the ``@Security`` annotation.
|
The security policy can be overridden for a path using the ``@Security`` annotation.
|
||||||
|
|
||||||
.. code-block:: php
|
.. code-block:: php
|
||||||
|
|
||||||
|
@ -230,7 +230,7 @@ class SwaggerDocblockConvertCommand extends ContainerAwareCommand
|
|||||||
Then open a command console, enter your project directory and run:
|
Then open a command console, enter your project directory and run:
|
||||||
|
|
||||||
```
|
```
|
||||||
bin/console api:doc:convert
|
php bin/console api:doc:convert
|
||||||
```
|
```
|
||||||
|
|
||||||
Your annotations should all be converted.
|
Your annotations should all be converted.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user