Skip to content

Commit

Permalink
fix(tests): import attributes in functional test controllers
Browse files Browse the repository at this point in the history
  • Loading branch information
jankal committed Jan 7, 2025
1 parent 8e56941 commit ef7712e
Show file tree
Hide file tree
Showing 9 changed files with 99 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Nelmio\ApiDocBundle\Tests\Functional\Controller;

use OpenApi\Attributes as OA;
use Symfony\Component\HttpKernel\Attribute\MapQueryParameter;
use Symfony\Component\Routing\Annotation\Route;

Expand Down
1 change: 1 addition & 0 deletions tests/Functional/Controller/MapQueryStringController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Nelmio\ApiDocBundle\Tests\Functional\Entity\QueryModel\SortQueryModel;
use Nelmio\ApiDocBundle\Tests\Functional\Entity\SymfonyConstraintsWithValidationGroups;
use Nelmio\ApiDocBundle\Tests\Functional\Entity\SymfonyMapQueryString;
use OpenApi\Attributes as OA;
use Symfony\Component\HttpKernel\Attribute\MapQueryString;
use Symfony\Component\Routing\Annotation\Route;

Expand Down
1 change: 1 addition & 0 deletions tests/Functional/Controller/MapRequestPayloadArray.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace Nelmio\ApiDocBundle\Tests\Functional\Controller;

use Nelmio\ApiDocBundle\Tests\Functional\Entity\Article81;
use OpenApi\Attributes as OA;
use Symfony\Component\HttpKernel\Attribute\MapRequestPayload;
use Symfony\Component\Routing\Annotation\Route;

Expand Down
2 changes: 2 additions & 0 deletions tests/Functional/Controller/MapRequestPayloadController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@

use Nelmio\ApiDocBundle\Annotation\Model;
use Nelmio\ApiDocBundle\Tests\Functional\Entity\Article81;
use Nelmio\ApiDocBundle\Tests\Functional\Entity\EntityWithNullableSchemaSet;
use Nelmio\ApiDocBundle\Tests\Functional\Entity\SymfonyConstraintsWithValidationGroups;
use OpenApi\Attributes as OA;
use Symfony\Component\HttpKernel\Attribute\MapRequestPayload;
use Symfony\Component\Routing\Annotation\Route;

Expand Down
22 changes: 13 additions & 9 deletions tests/Functional/Fixtures/MapQueryParameterController.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
}
],
"responses": {
"default": {
"200": {
"description": ""
}
}
Expand Down Expand Up @@ -147,7 +147,7 @@
}
],
"responses": {
"default": {
"200": {
"description": ""
}
}
Expand All @@ -168,7 +168,7 @@
}
],
"responses": {
"default": {
"200": {
"description": ""
}
}
Expand All @@ -189,7 +189,7 @@
}
],
"responses": {
"default": {
"200": {
"description": ""
}
}
Expand All @@ -202,24 +202,28 @@
{
"name": "id",
"in": "query",
"description": "Query parameter id description",
"required": false,
"schema": {
"type": "integer",
"nullable": true
}
},
"example": 123
},
{
"name": "changedType",
"in": "query",
"description": "Incorrectly described query parameter",
"required": false,
"schema": {
"type": "string",
"nullable": true
}
"type": "int",
"nullable": false
},
"example": 123
}
],
"responses": {
"default": {
"200": {
"description": ""
}
}
Expand Down
34 changes: 20 additions & 14 deletions tests/Functional/Fixtures/MapQueryStringCleanupComponents.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
}
],
"responses": {
"default": {
"200": {
"description": ""
}
}
Expand Down Expand Up @@ -115,7 +115,7 @@
}
],
"responses": {
"default": {
"200": {
"description": ""
}
}
Expand Down Expand Up @@ -166,7 +166,7 @@
}
],
"responses": {
"default": {
"200": {
"description": ""
}
}
Expand All @@ -179,14 +179,17 @@
{
"name": "id",
"in": "query",
"description": "Query parameter id description",
"required": true,
"schema": {
"type": "integer"
"type": "string",
"nullable": true
}
},
{
"name": "name",
"in": "query",
"description": "Query parameter name description",
"required": true,
"schema": {
"type": "string"
Expand All @@ -195,6 +198,7 @@
{
"name": "nullableName",
"in": "query",
"description": "Query parameter nullableName description",
"required": false,
"schema": {
"type": "string",
Expand All @@ -204,6 +208,7 @@
{
"name": "articleType81",
"in": "query",
"description": "Query parameter articleType81 description",
"required": true,
"schema": {
"$ref": "#/components/schemas/ArticleType81"
Expand All @@ -212,6 +217,7 @@
{
"name": "nullableArticleType81",
"in": "query",
"description": "Query parameter nullableArticleType81 description",
"required": false,
"schema": {
"nullable": true,
Expand All @@ -224,7 +230,7 @@
}
],
"responses": {
"default": {
"200": {
"description": ""
}
}
Expand Down Expand Up @@ -315,7 +321,7 @@
}
],
"responses": {
"default": {
"200": {
"description": ""
}
}
Expand Down Expand Up @@ -406,7 +412,7 @@
}
],
"responses": {
"default": {
"200": {
"description": ""
}
}
Expand Down Expand Up @@ -495,7 +501,7 @@
}
],
"responses": {
"default": {
"200": {
"description": ""
}
}
Expand Down Expand Up @@ -584,7 +590,7 @@
}
],
"responses": {
"default": {
"200": {
"description": ""
}
}
Expand Down Expand Up @@ -673,7 +679,7 @@
}
],
"responses": {
"default": {
"200": {
"description": ""
}
}
Expand Down Expand Up @@ -762,7 +768,7 @@
}
],
"responses": {
"default": {
"200": {
"description": ""
}
}
Expand Down Expand Up @@ -851,7 +857,7 @@
}
],
"responses": {
"default": {
"200": {
"description": ""
}
}
Expand Down Expand Up @@ -940,7 +946,7 @@
}
],
"responses": {
"default": {
"200": {
"description": ""
}
}
Expand Down Expand Up @@ -1029,7 +1035,7 @@
}
],
"responses": {
"default": {
"200": {
"description": ""
}
}
Expand Down
Loading

0 comments on commit ef7712e

Please sign in to comment.