Skip to main content

Miscellaneous

This section contains a collection of code generation settings that don't fit into any specific category but are still crucial for fine-tuning and customizing your developer experience.

Disable Linting

APIMatic-generated SDKs are designed to successfully pass lint tests. These SDK packages include the settings and commands necessary for running lint tests, allowing you to independently verify our claim. But you also have the option to disable this feature.

This setting allows you to disable generation of the files and commands that are used for lint testing.

Usage

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

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

Language Support

C#JavaPHPPythonRubyTSGo
✔️✔️✔️

Disable Multiple Auth

APIMatic-generated SDKs are equipped with multiple authentication support. If you happen to have multiple security schemes defined in your API specifications and used it to generate SDKs before the release of the Multiple Authentication Schemes feature, you might find breaking changes in your SDKs if you try to regenerate after the release of the feature.

This setting allows you to disable multiple authentication support. So you can continue using only the first security scheme from your API specification. However, we recommend you should stick with the newly improved multiple-authentication flow of your SDKs because this flag will be deprecated eventually.

Usage

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

"info": {
...,
"x-codegen-settings": {
"DisableMultipleAuth": true
}
}

Language Support

C#JavaPHPPythonRubyTSGo
✔️✔️✔️✔️✔️✔️✔️

Add Single Auth Deprecated Code

If your API definition uses a single security scheme, then the APIMatic generated SDKs will contain the deprecated code to set up a client with authentication credentials. Since, our SDKs are now equipped with an improved flow to set authentication credentials for your client. The deprecated older flow is only kept in the SDKs to avoid breaking changes for our existing customers.

So, if you are new to the APIMatic or looking to exclude the deprecated code from your SDKs, this setting allows you to remove all the deprecated code related to single authentication credentials setup from the SDKs.

Usage

To remove the deprecated code, you need to specify a Boolean value. By default, its value is set to true.

"info": {
...,
"x-codegen-settings": {
"AddSingleAuthDeprecatedCode": true
}
}

Language Support

C#JavaPHPPythonRubyTSGo
✔️✔️✔️✔️✔️✔️
note

The symbol ➖ shows that the setting is not applicable.

Change in SDK

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

Value Change
true (default)
const client = new Client({
basicAuthUsername: "Username", // Deprecated
basicAuthPassword: "Password", // Deprecated
basicAuthCredentials: {
username: "Username",
password: "Password",
},
});
false
const client = new Client({
basicAuthCredentials: {
username: "Username",
password: "Password",
},
});

Use Java Properties Config

You can initialize a Java SDK to load SDK configuration directly from the properties file. To use this feature, set this setting to true.

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": {
"JavaUsePropertiesConfig": false
}
}

Language Support

This setting only applies to Java SDKs.

License Text

This setting sets the license text to use in place of the standard MIT license. This text will go in the license file that is shipped with the SDK package.

Usage

To use this feature, you need to specify a String value. If no value is provided, APIMatic Code Generator will add the standard MIT license inside the SDK.

"info": {
...,
"x-codegen-settings": {
"LicenseText": "License text here..."
}
}

Language Support

C#JavaPHPPythonRubyTSGo
✔️✔️✔️✔️✔️✔️

Store Timezone Information

Enable this setting to store timezone information with date-time types. If disabled, SDKs will attempt to convert all date-time values to UTC.

Usage

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

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

Language Support

C#JavaPHPPythonRubyTSGo
✔️✔️

Change in SDK

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

Value Change
true
DateTimeOffset datetime = DateTime.ParseExact(
"2023-03-13T12:52:32.123Z",
"yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK",
provider: CultureInfo.InvariantCulture,
DateTimeStyles.RoundtripKind);
false (default)
DateTime datetime = DateTime.ParseExact(
"2023-03-13T12:52:32.123Z",
"yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK",
provider: CultureInfo.InvariantCulture,
DateTimeStyles.RoundtripKind);

Apply Customizations

This setting sets customer-specific customizations to be applied during SDK and documentation generation. Each customization is a customer-specific key. It triggers specific customization in CodeGen and dependent projects. These keys are provided by the APIMatic support team where necessary.

Usage

To use this feature, you need to specify a set of keys in a list of string List<string>.

"info": {
...,
"x-codegen-settings": {
"ApplyCustomizations": [ "custom-abc", "custom-xyz" ]
}
}

Language Support

C#JavaPHPPythonRubyTSGo
✔️✔️✔️✔️✔️✔️

Enforce Standardized Casing

Use this setting to enforce standardized casing during SDK and docs generation.

Usage

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

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

Language Support

C#JavaPHPPythonRubyTSGo
✔️✔️✔️✔️✔️✔️✔️

Deprecated Settings

We have marked the following CodeGen settings as deprecated since we will no longer provide support for them in the future.

Custom Dependencies

Use this setting to add custom dependencies to the project.

Usage

To use this feature, you need to specify a list of custom dependencies List<CustomDependencies> like:

"info": {
...,
"x-codegen-settings": {
"CustomDependencies": [{
"Version": "1.0.0",
"Name": "uuid",
"Scope": "Compile"
}]
}
}

Language Support

C#JavaPHPPythonRubyTSGo
✔️✔️✔️✔️✔️✔️