Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/api_refs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ jobs:
git diff-index --quiet --cached HEAD || git commit -m "PHP API Ref HTML"
git add docs/api/rest_api/rest_api_reference/rest_api_reference.html
git diff-index --quiet --cached HEAD || git commit -m "REST API Ref HTML"
git add docs/api/rest_api/rest_api_reference/openapi.yaml
git diff-index --quiet --cached HEAD || git commit -m "REST API OpenAPI spec"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
Expand Down
1 change: 1 addition & 0 deletions docs/api/rest_api/rest_api_usage/openapi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test
4 changes: 3 additions & 1 deletion docs/api/rest_api/rest_api_usage/rest_api_usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@

The REST API is built on top of [API Platform](https://api-platform.com/docs/symfony/) and meets the [OpenAPI](https://www.openapis.org/) standard.

You can download the OpenAPI specification from the [REST API Reference](/api/rest_api/rest_api_reference/rest_api_reference.html), or generate it for your project by running one of the commands below:
You can download the OpenAPI specification in [YAML format](openapi.yaml) or in JSON format from the [REST API Reference](/api/rest_api/rest_api_reference/rest_api_reference.html)

You can also generate one for your project by running one of the commands below:

Check warning on line 20 in docs/api/rest_api/rest_api_usage/rest_api_usage.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/api/rest_api/rest_api_usage/rest_api_usage.md#L20

[Ibexa.EOLWhitespace] Remove whitespace characters from the end of the line.
Raw output
{"message": "[Ibexa.EOLWhitespace] Remove whitespace characters from the end of the line.", "location": {"path": "docs/api/rest_api/rest_api_usage/rest_api_usage.md", "range": {"start": {"line": 20, "column": 81}}}, "severity": "WARNING"}

``` bash
php bin/console ibexa:openapi --output=openapi.json # JSON output
Expand Down
4 changes: 4 additions & 0 deletions tools/api_refs/api_refs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ set +x;
AUTH_JSON=${1:-~/.composer/auth.json}; # Path to an auth.json file allowing to install the targeted edition and version
PHP_API_OUTPUT_DIR=${2:-./docs/api/php_api/php_api_reference}; # Path to the directory where the built PHP API Reference is hosted
REST_API_OUTPUT_FILE=${3:-./docs/api/rest_api/rest_api_reference/rest_api_reference.html}; # Path to the REST API Reference file
REST_API_OPENAPI_FILE=${4:-./docs/api/rest_api/rest_api_reference/openapi.yaml}; # Path to the REST API OpenAPI spec file

DXP_EDITION='commerce'; # Edition from and for which the Reference is built
DXP_VERSION='5.0.*'; # Version from and for which the Reference is built
Expand Down Expand Up @@ -37,6 +38,7 @@ if [ ! -d $PHP_API_OUTPUT_DIR ]; then
fi;
PHP_API_OUTPUT_DIR=$(realpath $PHP_API_OUTPUT_DIR); # Transform into absolute path before changing the working directory
REST_API_OUTPUT_FILE=$(realpath $REST_API_OUTPUT_FILE); # Transform into absolute path before changing the working directory
REST_API_OPENAPI_FILE=$(realpath $REST_API_OPENAPI_FILE); # Transform into absolute path before changing the working directory

if [ 1 -eq $FORCE_DXP_INSTALL ]; then
echo 'Remove temporary directory…';
Expand Down Expand Up @@ -221,6 +223,8 @@ echo 'Fix REST OpenAPI schema… ';
$PHP_BINARY $OPENAPI_FIX;
echo 'Build REST Reference… ';
redocly build-docs openapi.yaml --output $REST_API_OUTPUT_FILE --config $REDOCLY_CONFIG --template $REDOCLY_TEMPLATE;
echo 'Copy OpenAPI spec to documentation… ';
cp openapi.yaml $REST_API_OPENAPI_FILE;

if [ 1 -eq $FORCE_DXP_INSTALL ]; then
echo 'Remove temporary directory…';
Expand Down
Loading