🀠
Saloon
GithubSupport Project
v2
v2
  • 🀠Saloon
  • Upgrade
    • 🎁What's new in v2
    • 🌿Upgrading from v1
  • Getting Started
    • πŸ‘‹Installation
  • The Basics
    • πŸ”ŒConnectors
    • βœ‰οΈRequests
    • πŸ€“Headers
    • ❓Query Parameters
    • πŸ”§HTTP Client Config
    • πŸ“¦Sending Body/Data
      • JSON Body
      • Multipart Form Body
      • Form Body (URL Encoded)
      • XML Body
      • String / Plain Text Body
      • Stream Body
    • πŸ”Authentication
    • πŸš€Sending Requests
    • πŸ“‘Responses
    • πŸ›€οΈData Transfer Objects
    • πŸ”₯Handling Failures
    • πŸͺBuilding SDKs
  • Digging Deeper
    • ☝️Solo Requests
    • πŸ“–Pagination v1 (Old)
    • πŸ“–Pagination v2
      • Paged Pagination
      • Limit/Offset Pagination
      • Cursor Pagination
      • Custom Pagination
    • 🎯Retrying Requests
    • 🏎️Concurrency & Pools
    • πŸ”‘OAuth2 Authentication
      • Authorization Code Grant
      • Client Credentials Grant
    • πŸ’‚Middleware
    • ⏸️Request Delay
    • πŸ›©οΈSenders
    • πŸ‘ͺPlugins
  • Plugins
    • β›΅Laravel Helpers
    • πŸ”Caching Responses
    • β›”Handling Rate Limits
    • 🏭SDK Generator
  • Testing
    • πŸ“ΈRecording Responses
    • 🚧Mock Responses
  • Conclusion
    • 🍳Cookbook
    • πŸ“šTutorials & Blog Posts
    • 🐞Known Issues
    • πŸ€—Credits
    • πŸŽ–οΈShowcase
    • ❀️Support
    • πŸ‘‹About Me
Powered by GitBook
On this page
  • Installation
  • Basic Usage
  • Full Documentation
  • Issue Tracking
Edit on GitHub
  1. Plugins

SDK Generator

PreviousHandling Rate LimitsNextRecording Responses

Last updated 1 year ago

The Saloon SDK Generator is a third-party Saloon plugin written and maintained by () 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.

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