Nelmioapidocbundle: [3.0] @Model annotation always generate array (items)

Created on 12 Sep 2017  路  1Comment  路  Source: nelmio/NelmioApiDocBundle

Example 1:

    /**
     * @SWG\Get(
     *   @SWG\Response(
     *     response="200",
     *     description="Returned when successful",
     *     @SWG\Schema(@Model(type=DictionaryStatus::class))
     *   )
     * )
     */

Example 2:

    /**
     * @SWG\Get(
     *   @SWG\Response(
     *     response="200",
     *     description="Returned when successful",
     *     @SWG\Schema(type="array", @Model(type=DictionaryStatus::class))
     *   )
     * )
     */

Both of examples produces this json:

{"schema":{"items":{"$ref":"#/definitions/DictionaryStatus"}}}

Expected behavior: For example 1 json should be:

{"schema":{"$ref":"#/definitions/DictionaryStatus"}}

Most helpful comment

You have to remove the @Schema annotation around @Model.

>All comments

You have to remove the @Schema annotation around @Model.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Gemorroj picture Gemorroj  路  6Comments

manseuk picture manseuk  路  6Comments

jhkchan picture jhkchan  路  4Comments

DavidGarciaCat picture DavidGarciaCat  路  4Comments

andydandy80 picture andydandy80  路  4Comments