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
- The
--specflag for theapimatic sdk generateCLI command has been renamed to--input. - Default input path changed from
./src/specto./. - The input path now points to the parent directory containing the
srcdirectory that contains all the configurations along with the API specification files.
The following example shows the directory structure required for --spec and --input flags.
- OLD: Spec Flag
- NEW: Input Flag
apimatic sdk generate --langauge=php --spec=./spec
spec
├─ APIMATIC-META.json # Defines customization for SDK generation
└─ openapi.json
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:
- No change is required in CI workflows if you are not using the
--specflag. - Replace
--specwith--inputin scripts and CI workflows and point--inputto the project root (or other parent directory that containssrc).
Replace:
apimatic sdk generate --language=csharp --spec="/path/to/spec/dir"
With:
apimatic sdk generate --language=csharp --input="path/to/root/dir/of/src"