Skip to main content

CLI Pre-Release: Updated SDK Generation Input Flag and Path Semantics

· 2 min read

We are updating the SDK generation CLI command to make inputs for SDK and Portal generation CLI commands consistent. Now Portals and SDKs can be generated using the same input, simplifying CI/CD scripts.

What's Changed

  1. The --spec flag for the apimatic sdk generate CLI command has been renamed to --input.
  2. Default input path changed from ./src/spec to ./.
  3. The input path now points to the parent directory containing the src directory that contains all the configurations along with the API specification files.

The following example shows the directory structure required for --spec and --input flags.

apimatic sdk generate --langauge=php --input=./build
build
└─ src
├─ spec # Required; Contains all API definition files
| ├─ APIMATIC-META.json # Defines customization for SDK generation
| └─ openapi.json
├── APIMATIC-BUILD.json # Optional; Defines configurations for Portal generation
├── static # Optional; Contains all static files for the Portal
└── content # Optional; Contains custom documentation pages for the Portal

Migration Guidance

If you are upgrading from a CLI version that only supports the --spec flag (for example, 1.1.0-beta.6) to a version that supports the newer --input flag:

  1. No change is required in CI workflows if you are not using the --spec flag.
  2. Replace --spec with --input in scripts and CI workflows and point --input to the project root (or other parent directory that contains src).

Replace:

apimatic sdk generate --language=csharp --spec="/path/to/spec/dir"

With:

apimatic sdk generate --language=csharp --input="path/to/root/dir/of/src"