This article is outdated. Please click here to see the newer version.
One of the unique features of APIMATIC is its Code Generation settings, enabling the developer to easy modify the way generated code looks and behaves across the entire SDK.
Generic Code Styling
This section of Code Generation settings includes options which change the look and feel of the generated code. Some of these options are applicable only to a few platforms, while others affect all of the platforms supported by APIMATIC.
|Asynchronous Code||When set, the code generator prefers generating asynchronous code. This setting is currently applicable only to C# and Java.|
|HTTP Method Prefix||Enabling this will prefix either get, create, update or delete to name of the methods. For e.g CreateContact where 'Contact' was the name of the endpoint using POST.|
|Model Prefix||Postfixes each model class with the word 'Model'. For e.g ContactModel where 'Contact' was the name of the model.|
|Enum Postfix||Constructor Config: Any configuration parameters such as query parameter or headers are passed as arguments when instantiating a controller.|
This section of Code Generation settings determines more of the lower level workings of the SDK. These are predominantly platform-specific settings that will choose between different programming paradigms for a platform.
|Constructor Config||Any configuration parameters such as query parameter or headers are passed as arguments when instantiating a controller.|
|Use AndroidManifest.xml||Following the Android developement style, configuration parameters are to be populated in the android manifest file of the generated project.|
|Use AppInfo.plist||Following the iOS developement style, developers populate configuration parameters such as authentication parameters in the AppInfo.plist of the generated project.|
|Generate CoreData||CoreData is iOS native framework for persistance. Enabling this option generates a CoreData model document combining all the models in the project. It also generates entity classes to which are required for CoreData.|
Asynchronous Code Description is incorrectly for : Constructor Config (Any configuration parameters such as query parameter or headers are passed as arguments when instantiating a controller.)
It would be great to have the option of generating both aSync and Sync within the same API, to provide the developer an option of either.
Thanks for pointing out the mistake. I have fixed it now. You can always "duplicate" an API definition and have two different settings. Or, you can generate code once with this option set, and then another time without it.
Please sign in to leave a comment.