Saloon
GithubOfficial BookSponsor
v3
v3
  • 🀠Saloon
  • Upgrade
    • πŸͺ„What's new in v3
    • 🌳Upgrading from v2
  • The Basics
    • ⬇️Installation
    • πŸ”ŒConnectors
    • βœ‰οΈRequests
    • πŸ”Authentication
    • 🎁Sending Body/Data
      • JSON Body
      • Multipart Form Body
      • XML Body
      • URL Encoded Body (Form)
      • String / Plain Text Body
      • Stream Body
    • πŸš€Sending Requests
    • πŸ“‘Responses
    • πŸ”₯Handling Failures
    • πŸ”ŽDebugging
    • βœ…Testing
  • Digging Deeper
    • πŸ›ΈData Transfer Objects
    • ✨Building SDKs
    • ☝️Solo Requests
    • 🎯Retrying Requests
    • ⏸️Delaying Requests
    • 🏎️Concurrency & Pools
    • πŸ”‘OAuth2
      • Authorization Code Grant
      • Client Credentials Grant
    • πŸ’«Middleware
    • ⛩️PSR Support
  • Installable Plugins
    • πŸ“šPagination
      • Paged Pagination
      • Limit/Offset Pagination
      • Cursor Pagination
      • Custom Pagination
    • β›΅Laravel Plugin
    • πŸ”Caching
    • β›”Rate Limit Handler
    • 🏭Auto SDK Generator
    • 🀠Lawman
    • πŸ‡XML Wrangler
    • πŸ—οΈBuilding Your Own Plugins
  • Conclusion
    • πŸ“˜Official Book!
    • πŸ“”How-to Guides
      • Improving Speed With Laravel
      • Per-request Authentication
    • πŸ“–Tutorials & Blog Posts
    • πŸŽ–οΈShowcase
    • πŸ’₯Known Issues
    • πŸ€—Credits
    • ❀️Support Saloon
Powered by GitBook
On this page
  • Installation
  • Basic Usage
  • Full Documentation
  • Issue Tracking
Edit on GitHub
  1. Installable Plugins

🏭Auto SDK Generator

PreviousRate Limit HandlerNextLawman

Last updated 1 year ago

The Saloon SDK Generator is a third-party Saloon plugin written and maintained by Crescat (Helge Sverre) and allows people to easily generate Saloon SDKs from an OpenAPI file or Postman collection. The generator can automatically create connectors, requests and responses for you to help save you time when starting a new SDK.

Note: This tool helps you set up the foundation for your SDK, but it might not create a complete, ready-to-use solution.

Installation

You can install the Saloon SDK Generator through Composer. You can install it globally on your machine and have a simple CLI to generate SDKs.

composer global require crescat-io/saloon-sdk-generator

The library requires PHP 8.1 and above

Basic Usage

To generate the PHP SDK from an API specification file, run the following command:

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

Replace the placeholders with the appropriate values:

  • API_SPEC_FILE: Path to the API specification file (JSON or YAML format).

  • --type: Specify the type of API specification (postman or openapi).

  • --name: (Optional) Specify the name of the generated SDK (default: Unnamed).

  • --namespace: (Optional) Specify the root namespace for the SDK (default: App\\Sdk).

  • --output: (Optional) Specify the output path where the generated code will be created (default: ./Generated).

  • --force: (Optional) Force overwriting existing files.

  • --dry: (Optional) Perform a dry run. It will not save generated files, only show a list of them.

  • --zip: (Optional) Use this flag to generate a zip archive containing all the generated files.

Full Documentation

The full documentation can be found by visiting the Github repository here:

Issue Tracking

As this is not directly affiliated with Saloon, please report any issues you have directly on the repository linked above.

LogoGitHub - crescat-io/saloon-sdk-generator: Generate Saloon SDKs from Postman Collections and OpenAPI Specifications.GitHub