Skip to main content

Package Configuration

The following CodeGen settings allow you to configure the package settings for the generated SDKs.

note

Multitarget Dotnet Versions

APIMatic generated C# SDK can be compiled with more than one dotnet versions. You can use this setting to decide whether to use multiple target frameworks in the SDK or not.

note

This is an experimental setting so it might not work in all cases. Please contact our support if you run into an issue.

Usage

To use this feature, you need to specify a Boolean type. By default, its value is set to false.

"info": {
...,
"x-codegen-settings": {
"MultitargetDotnetVersions": false
}
}

Language Support

This setting only applies to C# SDKs.

Change in SDK

Configuring this setting has the following effect on the generated SDK:

Value Change
true
<TargetFrameworks>netstandard2.0;net45</TargetFrameworks>
false (default)
<TargetFramework>netstandard2.0</TargetFramework>

Java Group ID

This setting sets Java GroupId to be used in Maven POM file generated in Java SDKs. This group ID must follow Java package name rules.

Usage

To use this feature, you need to specify a String value. By default, its value will be the Java package name set in your specification file.

"info": {
...,
"x-codegen-settings": {
"JavaGroupId": "io.apimatic"
}
}

Language Support

This setting only applies to Java SDKs.

Change in SDK

You can notice the change in Java group ID by accessing the pom.xml file.

Value Change
Default
<groupId>TesterLib</groupId>
Configured
<groupId>io.apimatic</groupId>

Java Artifact ID

This setting sets the Java ArtifactId used by package managers.

Usage

To use this feature, you need to specify the ArtifactId as a String value. If no value is provided, the value used will be Java's project name separated by dashes.

"info": {
...,
"x-codegen-settings": {
"JavaArtifactId": "com.spring-boot"
}
}

Language Support

This setting only applies to Java SDKs.

Change in SDK

You can notice the change in Java artifact ID by accessing the pom.xml file.

Value Change
Default
<artifactId>tester-lib</artifactId>
Configured
<artifactId>com.spring-boot</artifactId>

PHP Composer Package Name

This setting sets name in composer.json file for PHP SDKs.

Usage

You must provide a String with the format your-vendor-name/package-name. By default, its value is apimatic/APIName.

"info": {
...,
"x-codegen-settings": {
"PHPComposerPackageName": "company/tester"
}
}

Language Support

This setting only applies to PHP SDKs.

Change in SDK

Configuring this setting has the following change in the PHP composer.json file:

Value Change
Default
{
"name": "apimatic/API",
"description": "Testing various api features",
"type": "library",
...
}
Configured
{
"name": "company/tester",
"description": "Testing various api features",
"type": "library",
...
}

Enable PHP Composer Version String

Enable this setting to add version component to the composer.json file in PHP SDKs.

caution

This approach is not the best practice to release the PHP package as it can cause conflicts with Git tag-based version publishing. Please use this setting with caution.

Usage

To use this feature, you need to specify a Boolean value. By default, its value is set to false.

"info": {
...,
"x-codegen-settings": {
"EnablePHPComposerVersionString": false
}
}

Language Support

This setting only applies to PHP SDKs.

Change in SDK

Configuring this setting changes the composer.json as follows:

Value Change
true
{
"name": "apimatic/tester",
"description": "Testing various api features",
"version": "1.1.0",
"type": "library",
...
}
false (default)
{
"name": "apimatic/tester",
"description": "Testing various api features",
"type": "library",
...
}