-
Notifications
You must be signed in to change notification settings - Fork 0
Ngstack 1017 schema processor #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
base: master
Are you sure you want to change the base?
Conversation
| new Reference('api_platform.openapi.factory.inner'), | ||
| new TaggedIteratorArgument( | ||
| tag: 'netgen_api_platform_extras.open_api_processor', | ||
| defaultPriorityMethod: 'getPriority', |
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.
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 |
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.
FQCN missing.
| use Symfony\Component\HttpKernel\Bundle\Bundle; | ||
|
|
||
| final class NetgenApiPlatformExtrasBundle extends Bundle {} | ||
| final class NetgenApiPlatformExtrasBundle extends Bundle |
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.
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 |
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.
Unnecessary readonly.
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.