From 22995df682fcdf7d35e4d8dc45e7a822b431865e Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Tue, 12 May 2026 13:47:11 +0200 Subject: [PATCH] rm openapi.php: Now sorted in the source in-code doc --- tools/api_refs/api_refs.sh | 3 --- tools/api_refs/openapi.php | 25 ------------------------- 2 files changed, 28 deletions(-) delete mode 100644 tools/api_refs/openapi.php diff --git a/tools/api_refs/api_refs.sh b/tools/api_refs/api_refs.sh index 33f8e5ad9c..f8e9603112 100755 --- a/tools/api_refs/api_refs.sh +++ b/tools/api_refs/api_refs.sh @@ -21,7 +21,6 @@ PHPDOC_DIR="$(pwd)/tools/api_refs/.phpdoc"; # Absolute path to phpDocumentor res REDOCLY_CONFIG_TEMPLATE="$(pwd)/tools/api_refs/redocly.yaml.template"; # Absolute path to Redocly configuration template file REDOCLY_CONFIG="$(pwd)/tools/api_refs/redocly.yaml"; # Absolute path to Redocly configuration file (generated from template) REDOCLY_TEMPLATE="$(pwd)/tools/api_refs/redocly.hbs"; # Absolute path to Redocly wrapping template -OPENAPI_FIX="$(pwd)/tools/api_refs/openapi.php"; # A script editing and fixing few things on the dumped schema (should be temporary and fixes reported to source) PHP_BINARY="php -d error_reporting=`php -r 'echo E_ALL & ~E_DEPRECATED;'`"; # Avoid depreciation messages from phpDocumentor/Reflection/issues/529 when using PHP 8.2 or higher TMP_DXP_DIR=/tmp/ibexa-dxp-phpdoc; # Absolute path of the temporary directory in which Ibexa DXP will be installed and the PHP API Reference built @@ -225,8 +224,6 @@ $PHP_BINARY bin/console ibexa:openapi --yaml \ $PHP_BINARY bin/console ibexa:openapi \ | sed 's@"info": {@"info": {\n "x-logo": {\n "url": "https://doc.ibexa.co/en/latest/images/ibexa-dxp-logo.png"\n },@' \ > openapi.json; -echo 'Fix REST OpenAPI schema… '; -$PHP_BINARY $OPENAPI_FIX; echo 'Build REST Reference… '; echo 'Generate Redocly config from template… '; # Replace version with the base branch diff --git a/tools/api_refs/openapi.php b/tools/api_refs/openapi.php deleted file mode 100644 index cd1b09627c..0000000000 --- a/tools/api_refs/openapi.php +++ /dev/null @@ -1,25 +0,0 @@ - &$pathMethods) { - foreach ($pathMethods as $method => &$methodDefinition) { - if (array_key_exists('requestBody', $methodDefinition) && array_key_exists('content', $methodDefinition['requestBody'])) { - ksort($methodDefinition['requestBody']['content']); - } - foreach ($methodDefinition['responses'] as $responseCode => &$responseDefinition) { - if (array_key_exists('content', $responseDefinition)) { - ksort($responseDefinition['content']); - } - } - } - } -} - -$openApi = yaml_parse_file('openapi.yaml'); -sortOpenApiContent($openApi); -yaml_emit_file('openapi.yaml', $openApi); - -$openApiJson = json_decode(file_get_contents('openapi.json'), true); -sortOpenApiContent($openApiJson); -file_put_contents('openapi.json', json_encode($openApiJson, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));