diff --git a/tests/Functional/Controller/MapQueryParameterController.php b/tests/Functional/Controller/MapQueryParameterController.php index 4cc128c8c..a09385a0d 100644 --- a/tests/Functional/Controller/MapQueryParameterController.php +++ b/tests/Functional/Controller/MapQueryParameterController.php @@ -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; diff --git a/tests/Functional/Controller/MapQueryStringController.php b/tests/Functional/Controller/MapQueryStringController.php index 4242d1c7d..661323da7 100644 --- a/tests/Functional/Controller/MapQueryStringController.php +++ b/tests/Functional/Controller/MapQueryStringController.php @@ -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; diff --git a/tests/Functional/Controller/MapRequestPayloadArray.php b/tests/Functional/Controller/MapRequestPayloadArray.php index c5434d8dc..a7ae43af6 100644 --- a/tests/Functional/Controller/MapRequestPayloadArray.php +++ b/tests/Functional/Controller/MapRequestPayloadArray.php @@ -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; diff --git a/tests/Functional/Controller/MapRequestPayloadController.php b/tests/Functional/Controller/MapRequestPayloadController.php index 7cded45bc..1bc0fbcba 100644 --- a/tests/Functional/Controller/MapRequestPayloadController.php +++ b/tests/Functional/Controller/MapRequestPayloadController.php @@ -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; diff --git a/tests/Functional/Fixtures/MapQueryParameterController.json b/tests/Functional/Fixtures/MapQueryParameterController.json index 9d626a46a..8606277e2 100644 --- a/tests/Functional/Fixtures/MapQueryParameterController.json +++ b/tests/Functional/Fixtures/MapQueryParameterController.json @@ -53,7 +53,7 @@ } ], "responses": { - "default": { + "200": { "description": "" } } @@ -147,7 +147,7 @@ } ], "responses": { - "default": { + "200": { "description": "" } } @@ -168,7 +168,7 @@ } ], "responses": { - "default": { + "200": { "description": "" } } @@ -189,7 +189,7 @@ } ], "responses": { - "default": { + "200": { "description": "" } } @@ -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": "" } } diff --git a/tests/Functional/Fixtures/MapQueryStringCleanupComponents.json b/tests/Functional/Fixtures/MapQueryStringCleanupComponents.json index e34e9aa3b..3e8d612da 100644 --- a/tests/Functional/Fixtures/MapQueryStringCleanupComponents.json +++ b/tests/Functional/Fixtures/MapQueryStringCleanupComponents.json @@ -57,7 +57,7 @@ } ], "responses": { - "default": { + "200": { "description": "" } } @@ -115,7 +115,7 @@ } ], "responses": { - "default": { + "200": { "description": "" } } @@ -166,7 +166,7 @@ } ], "responses": { - "default": { + "200": { "description": "" } } @@ -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" @@ -195,6 +198,7 @@ { "name": "nullableName", "in": "query", + "description": "Query parameter nullableName description", "required": false, "schema": { "type": "string", @@ -204,6 +208,7 @@ { "name": "articleType81", "in": "query", + "description": "Query parameter articleType81 description", "required": true, "schema": { "$ref": "#/components/schemas/ArticleType81" @@ -212,6 +217,7 @@ { "name": "nullableArticleType81", "in": "query", + "description": "Query parameter nullableArticleType81 description", "required": false, "schema": { "nullable": true, @@ -224,7 +230,7 @@ } ], "responses": { - "default": { + "200": { "description": "" } } @@ -315,7 +321,7 @@ } ], "responses": { - "default": { + "200": { "description": "" } } @@ -406,7 +412,7 @@ } ], "responses": { - "default": { + "200": { "description": "" } } @@ -495,7 +501,7 @@ } ], "responses": { - "default": { + "200": { "description": "" } } @@ -584,7 +590,7 @@ } ], "responses": { - "default": { + "200": { "description": "" } } @@ -673,7 +679,7 @@ } ], "responses": { - "default": { + "200": { "description": "" } } @@ -762,7 +768,7 @@ } ], "responses": { - "default": { + "200": { "description": "" } } @@ -851,7 +857,7 @@ } ], "responses": { - "default": { + "200": { "description": "" } } @@ -940,7 +946,7 @@ } ], "responses": { - "default": { + "200": { "description": "" } } @@ -1029,7 +1035,7 @@ } ], "responses": { - "default": { + "200": { "description": "" } } diff --git a/tests/Functional/Fixtures/MapQueryStringController.json b/tests/Functional/Fixtures/MapQueryStringController.json index 0b53a3eb2..a0e8c7795 100644 --- a/tests/Functional/Fixtures/MapQueryStringController.json +++ b/tests/Functional/Fixtures/MapQueryStringController.json @@ -57,7 +57,7 @@ } ], "responses": { - "default": { + "200": { "description": "" } } @@ -115,7 +115,7 @@ } ], "responses": { - "default": { + "200": { "description": "" } } @@ -166,7 +166,7 @@ } ], "responses": { - "default": { + "200": { "description": "" } } @@ -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" @@ -195,6 +198,7 @@ { "name": "nullableName", "in": "query", + "description": "Query parameter nullableName description", "required": false, "schema": { "type": "string", @@ -204,6 +208,7 @@ { "name": "articleType81", "in": "query", + "description": "Query parameter articleType81 description", "required": true, "schema": { "$ref": "#/components/schemas/ArticleType81" @@ -212,6 +217,7 @@ { "name": "nullableArticleType81", "in": "query", + "description": "Query parameter nullableArticleType81 description", "required": false, "schema": { "nullable": true, @@ -224,7 +230,7 @@ } ], "responses": { - "default": { + "200": { "description": "" } } @@ -315,7 +321,7 @@ } ], "responses": { - "default": { + "200": { "description": "" } } @@ -406,7 +412,7 @@ } ], "responses": { - "default": { + "200": { "description": "" } } @@ -495,7 +501,7 @@ } ], "responses": { - "default": { + "200": { "description": "" } } @@ -584,7 +590,7 @@ } ], "responses": { - "default": { + "200": { "description": "" } } @@ -673,7 +679,7 @@ } ], "responses": { - "default": { + "200": { "description": "" } } @@ -762,7 +768,7 @@ } ], "responses": { - "default": { + "200": { "description": "" } } @@ -851,7 +857,7 @@ } ], "responses": { - "default": { + "200": { "description": "" } } @@ -940,7 +946,7 @@ } ], "responses": { - "default": { + "200": { "description": "" } } @@ -1029,7 +1035,7 @@ } ], "responses": { - "default": { + "200": { "description": "" } } diff --git a/tests/Functional/Fixtures/MapRequestPayloadArray.json b/tests/Functional/Fixtures/MapRequestPayloadArray.json index afbdb221f..ca2c41519 100644 --- a/tests/Functional/Fixtures/MapRequestPayloadArray.json +++ b/tests/Functional/Fixtures/MapRequestPayloadArray.json @@ -22,7 +22,7 @@ } }, "responses": { - "default": { + "200": { "description": "" } } @@ -46,7 +46,7 @@ } }, "responses": { - "default": { + "200": { "description": "" } } diff --git a/tests/Functional/Fixtures/MapRequestPayloadController.json b/tests/Functional/Fixtures/MapRequestPayloadController.json index 4e39dd338..6c6431592 100644 --- a/tests/Functional/Fixtures/MapRequestPayloadController.json +++ b/tests/Functional/Fixtures/MapRequestPayloadController.json @@ -19,7 +19,7 @@ } }, "responses": { - "default": { + "200": { "description": "" } } @@ -44,7 +44,7 @@ } }, "responses": { - "default": { + "200": { "description": "" } } @@ -54,17 +54,18 @@ "post": { "operationId": "post_nelmio_apidoc_tests_functional_maprequestpayload_createarticlefrommaprequestpayloadoverwrite", "requestBody": { + "description": "Request body description", "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Article81" + "$ref": "#/components/schemas/EntityWithNullableSchemaSet" } } } }, "responses": { - "default": { + "200": { "description": "" } } @@ -74,6 +75,7 @@ "post": { "operationId": "post_nelmio_apidoc_tests_functional_maprequestpayload_createarticlefrommaprequestpayloadhandlesalreadysetcontent", "requestBody": { + "description": "Request body description", "required": true, "content": { "application/json": { @@ -84,7 +86,7 @@ } }, "responses": { - "default": { + "200": { "description": "" } } @@ -104,7 +106,7 @@ } }, "responses": { - "default": { + "200": { "description": "" } } @@ -174,6 +176,37 @@ }, "type": "object" }, + "EntityWithNullableSchemaSet": { + "required": [ + "nullablePropertyNullableFalseSet", + "nonNullablePropertyNullableNotSet", + "nonNullablePropertyNullableFalseSet" + ], + "properties": { + "nullablePropertyNullableNotSet": { + "type": "string", + "nullable": true + }, + "nullablePropertyNullableFalseSet": { + "type": "string" + }, + "nullablePropertyNullableTrueSet": { + "type": "string", + "nullable": true + }, + "nonNullablePropertyNullableNotSet": { + "type": "string" + }, + "nonNullablePropertyNullableFalseSet": { + "type": "string" + }, + "nonNullablePropertyNullableTrueSet": { + "type": "string", + "nullable": true + } + }, + "type": "object" + }, "ArticleType81": { "type": "string", "enum": [