Skip to content

Commit

Permalink
Expand tests with required field
Browse files Browse the repository at this point in the history
  • Loading branch information
DjordyKoert committed Oct 27, 2023
1 parent c7396d5 commit a387f9c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
2 changes: 0 additions & 2 deletions OpenApiPhp/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,6 @@ public static function getOperationParameter(OA\Operation $operation, $name, $in
* it is expected to be a string nested property.
*
* @see OA\AbstractAnnotation::$_nested
*
* @param $class
*/
public static function getChild(OA\AbstractAnnotation $parent, $class, array $properties = []): OA\AbstractAnnotation
{
Expand Down
20 changes: 20 additions & 0 deletions Tests/Functional/FunctionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,15 @@ public function testUserModel()
],
],
'schema' => 'User',
'required' => [
'id',
'roles',
'money',
'creationDate',
'users',
'status',
'dateAsInterface',
],
],
json_decode($this->getModel('User')->toJson(), true)
);
Expand Down Expand Up @@ -428,6 +437,17 @@ public function testSymfonyConstraintDocumentation()
'required' => [
'propertyNotBlank',
'propertyNotNull',
'propertyAssertLength',
'propertyRegex',
'propertyCount',
'propertyChoice',
'propertyChoiceWithCallback',
'propertyChoiceWithCallbackWithoutClass',
'propertyChoiceWithMultiple',
'propertyExpression',
'propertyRange',
'propertyLessThan',
'propertyLessThanOrEqual',
],
'properties' => [
'propertyNotBlank' => [
Expand Down
4 changes: 4 additions & 0 deletions Tests/Functional/ValidationGroupsFunctionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ public function testConstraintDefaultGroupsAreRespectedWhenReadingAnnotations()
],
'type' => 'object',
'schema' => 'SymfonyConstraintsDefaultGroup',
'required' => [
'property',
'propertyInDefaultGroup',
],
];

$this->assertEquals(
Expand Down

0 comments on commit a387f9c

Please sign in to comment.