From 95aa4eb817ea4b09539d5639b8eff9d68355be69 Mon Sep 17 00:00:00 2001 From: Pierre Millot Date: Mon, 14 Oct 2024 14:46:03 +0200 Subject: [PATCH] okay ? --- .../algoliasearch-client-php/lib/Algolia.php | 22 +++++++++++-------- .../algolia/codegen/utils/ModelPruner.java | 7 +++++- specs/common/schemas/IndexSettings.yml | 1 - 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/clients/algoliasearch-client-php/lib/Algolia.php b/clients/algoliasearch-client-php/lib/Algolia.php index c64849aa5e..07b705736b 100644 --- a/clients/algoliasearch-client-php/lib/Algolia.php +++ b/clients/algoliasearch-client-php/lib/Algolia.php @@ -3,8 +3,12 @@ namespace Algolia\AlgoliaSearch; use Algolia\AlgoliaSearch\Cache\NullCacheDriver; +use Algolia\AlgoliaSearch\Http\CurlHttpClient; +use Algolia\AlgoliaSearch\Http\GuzzleHttpClient; use Algolia\AlgoliaSearch\Http\HttpClientInterface; use Algolia\AlgoliaSearch\Log\DebugLogger; +use GuzzleHttp\Client; +use GuzzleHttp\ClientInterface; use Psr\Log\LoggerInterface; use Psr\SimpleCache\CacheInterface; @@ -15,19 +19,19 @@ final class Algolia /** * Holds an instance of the simple cache repository (PSR-16). * - * @var null|\Psr\SimpleCache\CacheInterface + * @var null|CacheInterface */ private static $cache; /** * Holds an instance of the logger (PSR-3). * - * @var null|\Psr\Log\LoggerInterface + * @var null|LoggerInterface */ private static $logger; /** - * @var \Algolia\AlgoliaSearch\Http\HttpClientInterface + * @var HttpClientInterface */ private static $httpClient; @@ -43,7 +47,7 @@ public static function isCacheEnabled() /** * Gets the cache instance. * - * @return \Psr\SimpleCache\CacheInterface + * @return CacheInterface */ public static function getCache() { @@ -65,7 +69,7 @@ public static function setCache(CacheInterface $cache) /** * Gets the logger instance. * - * @return \Psr\Log\LoggerInterface + * @return LoggerInterface */ public static function getLogger() { @@ -90,23 +94,23 @@ public static function getHttpClient() if (interface_exists('\GuzzleHttp\ClientInterface')) { if (defined('\GuzzleHttp\ClientInterface::VERSION')) { $guzzleVersion = (int) mb_substr( - \GuzzleHttp\Client::VERSION, + Client::VERSION, 0, 1 ); } else { - $guzzleVersion = \GuzzleHttp\ClientInterface::MAJOR_VERSION; + $guzzleVersion = ClientInterface::MAJOR_VERSION; } } if (null === self::$httpClient) { if (class_exists('\GuzzleHttp\Client') && 6 <= $guzzleVersion) { self::setHttpClient( - new \Algolia\AlgoliaSearch\Http\GuzzleHttpClient() + new GuzzleHttpClient() ); } else { self::setHttpClient( - new \Algolia\AlgoliaSearch\Http\CurlHttpClient() + new CurlHttpClient() ); } } diff --git a/generators/src/main/java/com/algolia/codegen/utils/ModelPruner.java b/generators/src/main/java/com/algolia/codegen/utils/ModelPruner.java index e89ecab868..0ad533fb88 100644 --- a/generators/src/main/java/com/algolia/codegen/utils/ModelPruner.java +++ b/generators/src/main/java/com/algolia/codegen/utils/ModelPruner.java @@ -86,7 +86,12 @@ private void exploreGraph(OperationsMap operations) { } } for (CodegenParameter param : ope.allParams) { - CodegenModel paramType = getModel(param.baseType != null ? param.baseType : param.getSchema().getOpenApiType()); + String paramName = param.baseType != null ? param.baseType : param.dataType; + // php has a fully qualified name for the parameter type + if (paramName.contains("\\")) { + paramName = paramName.substring(paramName.lastIndexOf("\\") + 1); + } + CodegenModel paramType = getModel(paramName); if (paramType != null) { visitedModels.add(paramType.name); } diff --git a/specs/common/schemas/IndexSettings.yml b/specs/common/schemas/IndexSettings.yml index 995ed8c071..8ff1619c35 100644 --- a/specs/common/schemas/IndexSettings.yml +++ b/specs/common/schemas/IndexSettings.yml @@ -1035,7 +1035,6 @@ widgets: banners: description: banners defined in the merchandising studio for the given search. type: array - additionalProperties: false items: $ref: '#/banner'