Code Generation Settings
APIMATIC’s code generation engine has various code generation configurations to customize the behaviour and outlook across the generated SDKS. Code generation settings can be accessed via
Settings > CodeGen Settings in the API editor.
Generic Code Styling
These configurations change the overall look and feel of the generated code.
|Asynchronous Code||Enabling this generates asynchronous code.|
Note Objective C generates asynchronous code irrespective of this option.
|HTTP Method Prefix||Enabling this will prefix the HTTP method i.e Get, Create, Update or Delete to the name of the methods. For e.g the endpoint ‘Contact’ using POST becomes CreateContact|
|Model Postfix||Postfixes each model class with the word Model. For e.g the model Contact becomes ContactModel.|
|Enum Postfix||Postfixes each enum class with the word Enum. For e.g the enum Days becomes DaysEnum.|
|Controller Postfix||Postfixes each controller class with the word Controller. For e.g the controller User becomes UserController.|
|Append JSON Headers||Automatically determines the request and response content types and appends appropriate “accept” and “content-type” headers.|
|Use Common Library||Uses a common library comprising of common classes used by the generated SDKs leading to reduced code duplication.|
|Generate Interfaces||Generates interfaces for controller classes in the generated SDKs.|
Note Objective C and GO generate interfaces irrespective of this option.
|Enable Logging||Enabling this generates code in the SDKs for logging events in the API cycle using a libary. Logger can be configured in the SDK.|
These configurations are pre dominantly platform specific settings choosing between different programming paradigms for that particular language
|Use AndroidManifest.xml||Configuration paramters are populated in the Anroid Manifest file if this option is enabled.|
|Use AppInfo.plist||Configuration parameters are populated in the Appinfo.plist file if this option is enabled.|
|Generate CoreData||CoreData is a native framework for persistence in iOS. Enabling this option generates a CoreData model document combining all the models in the project. It also generates entity classes which are required for CoreData.|
|Enable PHP Composer Version String||Enable to add |
These configurations manage the endpoints specific behaviour in the generated SDKs.
|Collect Prameters||Enabling this option collects API endpoint parameters as collections instead of individual method parameters.|
|Nullify 404||Enabling this would return null response on the HTTP status code 404.|
|Validate Required Prameters||Enabling this option validates required API endpoint parameters to be not null.|
Note Default values for required parameters are ignored.
|Preserve Parameter Order||Enabling this attempts to preserve the parameter order in endpoints and models as defined by the user.|
|Timeout||This option specifies the duration (in seconds) after which requests would timeout.|
These configurations manage the models specific behaviour in the generated SDKs.
|Enable Additional Model Properties||Enabling this option allows models to have additonal properties.|
Continuous Integration Settings
Apimatic also generates configuration files for CI tools. The user can use these settings to toggle the generation of configuration file for specific CI tools.
|Generate AppVeyor||Enabling this option generates configuration file appveyor.yml for AppVeyor.|
|Generate CircleCI||Enabling this option generates configuration file circle.yml for CircleCI.|
|Generate Travis||Enabling this option generates configuration file .travis.yml for Travis.|
|Generate Jenkins||Enabling this option generates configuration file Jenkinsfile for Jenkins.|
Code Branding Options
These configurations allow personalisation of generated SDK’s.
|Brand Label||The specified brand label will be added to the header of all generated files.|
|User Agent||The user agent is added to the headers of all API calls to identify the sender of the request.|
|C# default namespace||The default value of the root namespace to be used in C# SDKs.|
|Java package name||The default value of the pacakge name to be used in Java SDKs.|
|Project name||The name of the project for Generated SDKs.|
Note API name is used as the project name by default.
API Monitoring Powered by Runscope
Runscope is a service which allows API providers to monitor their API. In case of any downtime or failing requests, Runscope will notify them so that the issue can be resolved at the earliest.
APIMatic partners with Runscope to enable API providers to inspect/debug all of the request and response data traveling back and forth from the clients using their SDKs.
|Enable Runscope||This flag enables API Monitoring and debugging using Runscope within the generated SDKs|
|Bucket Key||This is the key that you’ll get for a bucket (group of endpoints) from Runscope.|
Have questions? Submit a request.