diff --git a/README.md b/README.md index 2ada5b49..54beed5f 100644 --- a/README.md +++ b/README.md @@ -157,4 +157,8 @@ Note that the HTTP Client **must not** throw exceptions for 4xx and 5xx response The classes under the `ShipStream\Ups\Api` namespace are all generated using [janephp](https://jane.readthedocs.io/en/latest/index.html). +**ARM/Docker Setups:**\ Run the `generate.sh` script to regenerate the classes when needed. + +**AMD64 (WSL/Linux) Setups:**\ +Run the `generate-amd64.sh` script to regenerate the classes when needed. \ No newline at end of file diff --git a/composer.json b/composer.json index 17c9e500..3f3c5c3a 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,9 @@ "require-dev": { "jane-php/open-api-3": "^7.10", "nyholm/psr7": "^1.8", - "phpunit/phpunit": "^9.6" + "phpunit/phpunit": "^9.6", + "elidrissidev/openapi-merge": "1.5.2", + "cebe/php-openapi": "1.7.0" }, "autoload": { "psr-4": { diff --git a/generate-amd64.sh b/generate-amd64.sh new file mode 100755 index 00000000..38a4e06a --- /dev/null +++ b/generate-amd64.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# This version of the generate.sh script should work on any x86/amd64 linux based systems. +# You must run `composer install` prior to executing this. +set -euo pipefail +cd "$(dirname "${BASH_SOURCE[0]}")" +# Merge the individual OpenAPI definitions into a single file +[[ -e openapi.yaml ]] && rm -f openapi.yaml +vendor/bin/openapi-merge \ + --resolve-references 0 \ + -o openapi.yaml \ + openapi/Base.yaml \ + openapi/*.yaml +# Generate API classes with Jane +php -d memory_limit=512M vendor/bin/jane-openapi generate -c .jane-openapi.php \ No newline at end of file