|
5 | 5 | AUTH_JSON=${1:-~/.composer/auth.json}; # Path to an auth.json file allowing to install the targeted edition and version |
6 | 6 | PHP_API_OUTPUT_DIR=${2:-./docs/api/php_api/php_api_reference}; # Path to the directory where the built PHP API Reference is hosted |
7 | 7 | REST_API_OUTPUT_FILE=${3:-./docs/api/rest_api/rest_api_reference/rest_api_reference.html}; # Path to the REST API Reference file |
| 8 | +REST_API_OPENAPI_FILE_YAML=${4:-./docs/api/rest_api/rest_api_reference/openapi.yaml}; # Path to the REST API OpenAPI spec file |
| 9 | +REST_API_OPENAPI_FILE_JSON=${5:-./docs/api/rest_api/rest_api_reference/openapi.json}; # Path to the REST API OpenAPI spec file |
8 | 10 |
|
9 | 11 | DXP_EDITION='commerce'; # Edition from and for which the Reference is built |
10 | 12 | DXP_VERSION='5.0.*'; # Version from and for which the Reference is built |
@@ -37,6 +39,8 @@ if [ ! -d $PHP_API_OUTPUT_DIR ]; then |
37 | 39 | fi; |
38 | 40 | PHP_API_OUTPUT_DIR=$(realpath $PHP_API_OUTPUT_DIR); # Transform into absolute path before changing the working directory |
39 | 41 | REST_API_OUTPUT_FILE=$(realpath $REST_API_OUTPUT_FILE); # Transform into absolute path before changing the working directory |
| 42 | +REST_API_OPENAPI_FILE_YAML=$(realpath $REST_API_OPENAPI_FILE_YAML); # Transform into absolute path before changing the working directory |
| 43 | +REST_API_OPENAPI_FILE_JSON=$(realpath $REST_API_OPENAPI_FILE_JSON); # Transform into absolute path before changing the working directory |
40 | 44 |
|
41 | 45 | if [ 1 -eq $FORCE_DXP_INSTALL ]; then |
42 | 46 | echo 'Remove temporary directory…'; |
@@ -217,10 +221,16 @@ echo 'Dump REST OpenAPI schema… '; |
217 | 221 | $PHP_BINARY bin/console ibexa:openapi --yaml \ |
218 | 222 | | sed "s@info:@info:\n x-logo:\n url: 'https://doc.ibexa.co/en/latest/images/ibexa-dxp-logo.png'@" \ |
219 | 223 | > openapi.yaml; |
| 224 | +$PHP_BINARY bin/console ibexa:openapi \ |
| 225 | + | sed 's@"info": {@"info": {\n "x-logo": {\n "url": "https://doc.ibexa.co/en/latest/images/ibexa-dxp-logo.png"\n },@' \ |
| 226 | +> openapi.json; |
220 | 227 | echo 'Fix REST OpenAPI schema… '; |
221 | 228 | $PHP_BINARY $OPENAPI_FIX; |
222 | 229 | echo 'Build REST Reference… '; |
223 | 230 | redocly build-docs openapi.yaml --output $REST_API_OUTPUT_FILE --config $REDOCLY_CONFIG --template $REDOCLY_TEMPLATE; |
| 231 | +echo 'Copy OpenAPI spec to documentation… '; |
| 232 | +cp openapi.yaml $REST_API_OPENAPI_FILE_YAML; |
| 233 | +cp openapi.json $REST_API_OPENAPI_FILE_JSON; |
224 | 234 |
|
225 | 235 | if [ 1 -eq $FORCE_DXP_INSTALL ]; then |
226 | 236 | echo 'Remove temporary directory…'; |
|
0 commit comments