Postman SDK core configuration options
The core Postman SDK options configure the basic settings, such as the location of the specification to use, the SDK languages to generate, and the authentication type to use. These options are set at the top level of the postman-sdk.config.json file.
sdkName
The sdkName is used to set the name for your SDK. This name is used for the package name for the different SDKs, it’s used to name the class that provides SDK access, and is used in the README and other documentation.
The name is re-cased to be idiomatic for the SDK language.
apiName
The name of the API. This is used to identify the API in the SDK documentation and README. If the apiName isn’t set, the API name is taken from the name in the API specification.
For Swagger and OpenAPI specs (spec.json), this is the title field in the info object.
For Postman Collections (postman-collection.json), this is the name field in the info object.
The API name is a required field for Swagger, OpenAPI and Postman Collections, so if this isn’t set in either the config file or the specification, an error will be raised.
apiVersion
The version of the API. This is used to identify the API in Postman. If the apiVersion isn’t set, the API version is taken from the version in the API specification.
For Swagger and OpenAPI specs (spec.json), this is the version field in the info object.
For Postman Collections (postman-collection.json), this is the version field in the info object.
The API name is a required field for Swagger and OpenAPI, but isn’t a required field for Postman Collections. Although this field isn’t required in the Postman SDK config file, If this isn’t set in either the config file or the specification, an error will be raised as a value for the version is required to generate an SDK.
baseUrl
The baseUrl is the URL for your API. If this isn’t set, the SDK defaults to using first value that’s found in the servers object of your API specification.
For Java SDKs, the baseUrl is also used as the group ID, unless you set the groupId language customization option. For example if you have:
Then your Java group ID will be soda.exciting:
This can be accessed from the soda.exciting package:
You can read more about configuring URLs and setting these at run time in the Environment management section of each language usage guide.
languages
The languages setting is an array of the languages you want to generate SDKs for.
Language specific customizations can be set in the languageOptions section of the config file.
auth
The postman-sdk.config.json auth setting defines the authentication your API uses. This setting is optional. If not set, the SDKs won’t include any authentication.
Valid values are:
If your API supports multiple authentication types, you can have multiple values as long as they don’t conflict. For example, both Basic authentication and Bearer token authentication use the Authentication header in your API, so you can’t have both set simultaneously.
The auth options can be customized using the authentication section of the customizations options. You can, for example, set the API key header or the access token prefix.