From fa3158ce673589254b113853a4731eb02799975a Mon Sep 17 00:00:00 2001 From: Guilhem Niot Date: Sun, 12 Jul 2020 15:21:14 +0200 Subject: [PATCH] Document the support of OA annotations on methods --- Resources/doc/index.rst | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Resources/doc/index.rst b/Resources/doc/index.rst index bfea8e1..73ee292 100644 --- a/Resources/doc/index.rst +++ b/Resources/doc/index.rst @@ -17,12 +17,12 @@ This bundle supports *Symfony* route requirements, PHP annotations, `Swagger-Php For models, it supports the `Symfony serializer`_ , the `JMS serializer`_ and the `willdurand/Hateoas`_ library. It does also support `Symfony form`_ types. -Migrate from 2.x to 3.0 +Migrate from 3.x to 4.0 ----------------------- -`To migrate from 2.x to 3.0, just follow our guide.`__ +`To migrate from 3.x to 4.0, follow our guide.`__ -__ https://github.com/nelmio/NelmioApiDocBundle/blob/master/UPGRADE-3.0.md +__ https://github.com/nelmio/NelmioApiDocBundle/blob/master/UPGRADE-4.0.md Installation ------------ @@ -241,7 +241,7 @@ You can customize the documentation of a form field using the ``documentation`` ], ]); -See the `OpenAPI 3.0 specification`__ to see all the available fields of the ``documentation`` option. +See the `OpenAPI 3.0 specification`__ to see all the available fields of the ``documentation`` option (it accepts the same fields as the OpenApi ``Property`` object). __ https://swagger.io/specification/ @@ -293,6 +293,13 @@ If you want to customize the documentation of an object's property, you can use * @OA\Property(ref=@Model(type=User::class)) */ public $friend; + + /** + * @OA\Property(description="This is my coworker!") + */ + public setCoworker(User $coworker) { + // ... + } } See the `OpenAPI 3.0 specification`__ to see all the available fields of ``@OA\Property``.