From 725b7eaa3f41ade23f979aa42e90297f2512619d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Fayard-Le=20Barzic?= Date: Tue, 25 Nov 2025 09:18:03 +0100 Subject: [PATCH 1/2] feat(elasticsearch): add SSL options for Elasticsearch configuration (#2218) Co-authored-by: Vincent Amstoutz --- core/elasticsearch.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/core/elasticsearch.md b/core/elasticsearch.md index 53b9db80951..cadf83238df 100644 --- a/core/elasticsearch.md +++ b/core/elasticsearch.md @@ -47,6 +47,33 @@ api_platform: #... ``` +#### SSL Configuration + +When connecting to Elasticsearch over HTTPS with self-signed certificates or custom Certificate Authorities, you can configure SSL verification. + +**With a custom CA bundle:** + +```yaml +# config/packages/api_platform.yaml +api_platform: + elasticsearch: + hosts: ['%env(ELASTICSEARCH_HOST)%'] + ssl_ca_bundle: '/path/to/ca-bundle.crt' +``` + +**Disable SSL verification (dev/test only):** + +```yaml +# config/packages/api_platform.yaml +api_platform: + elasticsearch: + hosts: ['%env(ELASTICSEARCH_HOST)%'] + ssl_verification: false # Never use in production +``` + +> [!NOTE] +> You cannot use both options together. + ### Enabling Reading Support using Laravel ```php From b87ea1929e13096dc1428bf9e7f70b7e2c9eb569 Mon Sep 17 00:00:00 2001 From: Jan Esser Date: Tue, 25 Nov 2025 09:38:08 +0100 Subject: [PATCH 2/2] docs(symfony/maker): add documentation for the maker with new namespace prefix support (#2224) --- symfony/index.md | 1 + symfony/maker.md | 89 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 symfony/maker.md diff --git a/symfony/index.md b/symfony/index.md index 1333f139cec..02251141d9c 100644 --- a/symfony/index.md +++ b/symfony/index.md @@ -473,6 +473,7 @@ Modify these files as described in these patches: ```console docker compose exec php bin/console make:entity --api-resource ``` +For more information on the available makers see [Maker documentation](./maker.md). Doctrine's [attributes](https://www.doctrine-project.org/projects/doctrine-orm/en/current/reference/attributes-reference.html) map these entities to tables in the database. Mapping through [annotations](https://www.doctrine-project.org/projects/doctrine-annotations/en/current/index.html) is still supported for backward compatibility, but they are considered deprecated and attributes are now the recommended approach. diff --git a/symfony/maker.md b/symfony/maker.md new file mode 100644 index 00000000000..451c1187b3a --- /dev/null +++ b/symfony/maker.md @@ -0,0 +1,89 @@ +# Symfony maker commands + +API Platform comes with a set of maker commands to help you create API Resources and other related classes. + +## Available commands + +### Create an entity that is an API Resource + +You can use Symfony [MakerBundle](https://symfonycasts.com/screencast/symfony-fundamentals/maker-command?cid=apip) to generate a Doctrine entity that is also a resource thanks to the `--api-resource` option: + +```bash +bin/console make:entity --api-resource +``` + +### Create an API Filter + +You can create an API Filter class using the following command: + +```bash +bin/console make:filter +``` +Where `` is the filter type and `` is the name of the filter class. +Supported types are `orm` and `odm` + +> [!NOTE] +> Elasticsearch filters are not yet supported + +### Create a State Provider + +You can create a State Provider class using the following command: + +```bash +bin/console make:state-provider +``` + +### Create a State Processor + +You can create a State Processor class using the following command: + +```bash +bin/console make:state-processor +``` + +## Configuration + +You can disable the maker commands by setting the following configuration in your `config/packages/api_platform.yaml` file: + +```yaml +api_platform: + maker: false +``` +By default, the maker commands are enabled if the maker bundle is detected. + +### Namespace configuration + +The makers creates all classes in the configured maker bundle root_namespace (default `App`). +Filters are created in `App\\Filter` +State Providers are created in `App\\State` +State Processors are created in `App\\State` + +Should you customize the base namespace for all API Platform generated classes you can so in 2 ways: + +- Bundle configuration +- Console Command Option + +#### Bundle configuration + +To change the default namespace prefix (relative to the maker.root_namespace), you can set the following configuration in your `config/packages/api_platform.yaml` file: + +```yaml +api_platform: + maker: + namespace_prefix: 'Api' +``` + +#### Console Command Option + +You can override the default namespace prefix by using the `--namespace-prefix` option when running the maker commands: + +```bash +bin/console make:filter orm MyCustomFilter --namespace-prefix Api\\Filter +bin/console make:state-provider MyProcessor --namespace-prefix Api\\State +bin/console make:state-processor MyProcessor --namespace-prefix Api\\State +``` + +> [!NOTE] +> Namespace prefixes passed to the cli command will be relative to the maker.root_namespace and **not** +> the configured API Platform namepace_prefix. +