Generate Saloon SDKs from Postman or OpenAPI

Packages

August 29th, 2023

Generate Saloon SDKs from Postman or OpenAPI

The Saloon SDK generator package for Saloon will help you generate SDKs from Postman collections and OpenAPI specifications.

This unlocks the potential to generate full clients that you can update quickly whenever your API spec changes. Imagine introducing a GitHub workflow in the API CI pipline that triggers an SDK repo and automatically tags a new version for release via composer!

This package also has a bunch of customization options and you can use the generator programmatically if you want to trigger an SDK build from PHP code.

You can get started with the package quickly, using the provided sdkgenerator command to generate code based on either a Postman collection or OpenAPI file:

sdkgenerator generate:sdk API_SPEC_FILE.{json|yaml|yml}
--type={postman|openapi}
[--name=SDK_NAME]
[--output=OUTPUT_PATH]
[--namespace=Company\\Integration]
[--force]
[--dry]
[--zip]

You can experiment with how it works by cloning the repository and running one of the provided composer commands. For example, composer generate:paddle would generate the Paddle Saloon SDK in the source repo's test folder.

You can learn more about this package, get full installation instructions, and view the source code on GitHub.

Filed in:

Paul Redmond

Full stack web developer. Author of Lumen Programming Guide and Docker for PHP Developers.