Skip to content

Conversation

@JakovKnezovicc
Copy link
Contributor

@JakovKnezovicc JakovKnezovicc commented Jan 16, 2026

Adds mechanism for updating openapi spec by implementing custom processors that mutate openapi object in order of priority.
Included to container build if enabled as a feature in config passed via container parameter.

@JakovKnezovicc JakovKnezovicc self-assigned this Jan 16, 2026
new Reference('api_platform.openapi.factory.inner'),
new TaggedIteratorArgument(
tag: 'netgen_api_platform_extras.open_api_processor',
defaultPriorityMethod: 'getPriority',
Copy link
Member

Choose a reason for hiding this comment

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

This will be deprecated in Symfony 8.1, so better not to use it here. Instead, we should sort the processors list in the factory class.

Check here for more info symfony/symfony#62339

and here on how I solved in Layouts netgen-layouts/layouts-core@e17483b (it's for default_index_method, but the principle applies)

final readonly class OpenApiFactory implements OpenApiFactoryInterface
{
/**
* @param iterable<OpenApiProcessorInterface> $processors
Copy link
Member

Choose a reason for hiding this comment

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

FQCN missing.

use Symfony\Component\HttpKernel\Bundle\Bundle;

final class NetgenApiPlatformExtrasBundle extends Bundle {}
final class NetgenApiPlatformExtrasBundle extends Bundle
Copy link
Member

Choose a reason for hiding this comment

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

This will need to be rebased as it will conflict once we merge #2 .

use ApiPlatform\OpenApi\OpenApi;
use Netgen\ApiPlatformExtras\OpenApi\Processor\OpenApiProcessorInterface;

final readonly class OpenApiFactory implements OpenApiFactoryInterface
Copy link
Member

Choose a reason for hiding this comment

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

Unnecessary readonly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants