-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IBX-8335: Initial integration with API Platform #114
base: main
Are you sure you want to change the base?
Conversation
ae550d9
to
3b250ed
Compare
fb103f5
to
40cff86
Compare
b161278
to
50f6a84
Compare
Quality Gate passedIssues Measures |
/** | ||
* @var array<string> | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We tend to use one-liner here.
/** | ||
* @internal | ||
*/ | ||
final class ClassNameResourceNameCollectionFactory implements ResourceNameCollectionFactoryInterface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can it be readonly?
private readonly OpenApiFactoryInterface $decorated, | ||
private readonly SchemasCollectionFactory $schemaCollectionFactory, | ||
private readonly KernelInterface $kernel, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cannot the whole class be readonly
instead?
} | ||
|
||
$responses = $operation->getResponses(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @var int $responseCode | ||
* @var \ApiPlatform\OpenApi\Model\Response|array<string, array<mixed>> $response | ||
*/ | ||
foreach ($operation->getResponses() as $responseCode => $response) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
foreach ($operation->getResponses() as $responseCode => $response) { | |
foreach ($responses as $responseCode => $response) { |
index_1: '@ibexa.api_platform.ibexa_openapi.factory' | ||
|
||
ibexa.api_platform.ibexa_openapi.factory: | ||
class: 'Ibexa\Bundle\Rest\ApiPlatform\OpenApiFactory' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class: 'Ibexa\Bundle\Rest\ApiPlatform\OpenApiFactory' | |
class: Ibexa\Bundle\Rest\ApiPlatform\OpenApiFactory |
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
# Collecting schemas | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
namespace Ibexa\Rest\ApiPlatform; | ||
|
||
final class SchemasCollection implements \IteratorAggregate, \Countable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
final class SchemasCollection implements \IteratorAggregate, \Countable | |
final readonly class SchemasCollection implements \IteratorAggregate, \Countable |
use Symfony\Component\HttpKernel\KernelInterface; | ||
use Symfony\Component\Yaml\Yaml; | ||
|
||
final class SchemasProvider implements SchemasProviderInterface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Readonly class instead of all properties?
Warning
Merge after Symfony 6 introduction in the DXP
Description:
Initial API Platform core integration with Language endpoint specification as an example.
Installation
Because we have not moved from Symfony 5.4 to a higher version, fork of
api-platform/core
with dependencies downgraded to Symfony 5.4 (and related likepsr
etc) is needed.This fork can be found here (branch
downgraded-deps
): https://github.com/tischsoic/core/tree/downgraded-depsAnd diff of changes can be found here: tischsoic/core@69b4d35...tischsoic:core:downgraded-deps
My setup of the
composer.json
from the project root:Because of inconsistencies between. PHP version in different packages composer needs to ignore PHP version requirement:
composer update --ignore-platform-req=php
For QA:
Documentation: