Open aynaitlamine opened 4 months ago
It still works with Api Platform Core 3.x as openapiContext
attribute. I am using it extensively however as deprecated it will be removed in AP Core 4.x so one would have to face it in the future.
It seems that here is no elegant way to implement openapi
support in the shema-generator, ex. ApiPlatform\OpenApi\Model
classes implements fluent and immutable interface that is not too friendly for denormalizers so it needs manual explicit initialization.
Currently, overriding the OpenAPI documentation requires the use of the OpenApiFactory class, which can be less intuitive and harder to manage for complex configurations.
Maybe more clearly would be with some configurator pattern for ApiResource by decorating ResourceMetadataCollectionFactoryInterface
.
Description
I would like to request the addition of a feature that allows developers to override the OpenAPI documentation via a YAML file instead of using the OpenApiFactory class. This would make the process easier and more readable. Currently, overriding the OpenAPI documentation requires the use of the OpenApiFactory class, which can be less intuitive and harder to manage for complex configurations. By enabling YAML-based overrides, developers can leverage the simplicity and readability of YAML to define their custom OpenAPI documentation.
Example
Here is a simple example of how this feature could be implemented.
Current Method (Using OpenApiFactory Class):
Proposed Method (Using YAML File):
Example Configuration in services.yaml:
In this example, the custom OpenAPI modifications are specified in a YAML file, which is then injected into the OpenApiFactory class. This approach enhances readability and maintainability, especially for large-scale projects with complex OpenAPI customizations.