Skip to content

Commit fa1305f

Browse files
committed

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

features/openapi/docs.feature

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ Feature: Documentation support
4949
And the OpenAPI class "CustomNormalizedDummy-output" exists
5050
And the OpenAPI class "CustomWritableIdentifierDummy" exists
5151
And the OpenAPI class "Dummy" exists
52+
And the OpenAPI class "Dummy.jsonld" exists
53+
And the OpenAPI class "Dummy.jsonld.input" exists
5254
And the OpenAPI class "DummyBoolean" exists
5355
And the OpenAPI class "RelatedDummy" exists
5456
And the OpenAPI class "DummyTableInheritance" exists
@@ -80,7 +82,11 @@ Feature: Documentation support
8082
And the JSON node "paths./api/custom-call/{id}.put" should exist
8183
# Properties
8284
And the "id" property exists for the OpenAPI class "Dummy"
83-
And the "name" property is required for the OpenAPI class "Dummy.jsonld"
85+
And the "name" property is required for the OpenAPI class "Dummy"
86+
And the JSON node "components.schemas.Dummy\.jsonld.allOf[0].$ref" should be equal to "#/components/schemas/HydraOutputBaseSchema"
87+
And the JSON node "components.schemas.Dummy\.jsonld.allOf[1].$ref" should be equal to "#/components/schemas/Dummy"
88+
And the JSON node "components.schemas.Dummy\.jsonld\.input.allOf[0].$ref" should be equal to "#/components/schemas/HydraItemBaseSchema"
89+
And the JSON node "components.schemas.Dummy\.jsonld\.input.allOf[1].$ref" should be equal to "#/components/schemas/Dummy"
8490
And the "genderType" property exists for the OpenAPI class "Person"
8591
And the "genderType" property for the OpenAPI class "Person" should be equal to:
8692
"""

tests/Behat/OpenApiContext.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ public function assertThePropertyIsRequiredForTheOpenAPIClass(string $propertyNa
106106
break;
107107
}
108108
}
109+
} else {
110+
$ok = isset($schema->required) && \in_array($propertyName, $schema->required, true);
109111
}
110112

111113
if (!$ok) {

0 commit comments

Comments
 (0)