Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@
},
"conflict": {
"doctrine/common": "<2.7",
"doctrine/mongodb-odm": "<2.0"
"doctrine/mongodb-odm": "<2.0",
"doctrine/mongodb-odm-bundle": "4.0.0-RC2"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't do this...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will forget it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And it only conflicts with a specific version so when RC3 is out it'll break again. 😆

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RC3 should resolve the issue so I don't think it will break.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, okay. If it's a bug in the bundle, then I'm kind of fine with this. We can remove this conflict when RC3 is released.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyway, this commit doesn't belong here. 😆

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's a cherry pick to make things green :)

},
"suggest": {
"doctrine/mongodb-odm-bundle": "To support MongoDB. Only versions 4.0 and later are supported.",
Expand Down
2 changes: 1 addition & 1 deletion src/JsonSchema/SchemaFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ private function getMetadata(string $resourceClass, string $type = Schema::TYPE_
$inputOrOutput = $resourceMetadata->getTypedOperationAttribute($operationType, $operationName, $attribute, ['class' => $resourceClass], true);
}

if (false === ($inputOrOutput['class'] ?? false)) {
if (null === ($inputOrOutput['class'] ?? null)) {
// input or output disabled
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function create(string $resourceClass): ResourceMetadata
if ($this->needsDefaultGetOperation($resourceMetadata)) {
$resourceMetadata = $resourceMetadata->withItemOperations(array_merge(
$resourceMetadata->getItemOperations(),
['get' => ['method' => 'GET', 'read' => false, 'output' => ['class' => false], 'controller' => NotFoundAction::class]])
['get' => ['method' => 'GET', 'read' => false, 'output' => ['class' => null], 'controller' => NotFoundAction::class]])
);
}

Expand Down Expand Up @@ -162,7 +162,7 @@ private function needsDefaultGetOperation(ResourceMetadata $resourceMetadata): b
$itemOperations = $resourceMetadata->getItemOperations();

foreach ($itemOperations as $itemOperation) {
if ('GET' === ($itemOperation['method'] ?? false)) {
if ('GET' === ($itemOperation['method'] ?? null)) {
return false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@ private function getOperations(array $names, $operationType = OperationType::ITE

private function getPlaceholderOperation(): array
{
return ['get' => ['method' => 'GET', 'read' => false, 'output' => ['class' => false], 'controller' => NotFoundAction::class]];
return ['get' => ['method' => 'GET', 'read' => false, 'output' => ['class' => null], 'controller' => NotFoundAction::class]];
}
}