Swagger IO: Automate client code generation

The [Swagger.IO Editor] UI is great for generating code, but sometimes you want to automate the whole process. You might have to do that if your REST API has upcoming changes and if you always want to keep your client up to date.

[swagger-codegen]

Make sure you have [JDK7] (or better) and [Maven] in your path.

[Getting Started] shows a quick example for getting the project with GIT clone and generating a client on the command-line.

1 GIT Clone [tgraupmann-swagger-codegen]

2 Run [maven_clean_package] after cloning the repo

3 The [generate_java_clients.cmd] script will auto-generate the Razer Arena JAVA clients.

@todo: [automate these changes in the swagger java templates]

NDK Target 23

Here is a strange [NDK issue]. I had to move the native code to its own module with a min SDK, target SDK, and compile tools set to API 21 in order to get the native library to load properly. This started happening after upgrading to `android-ndk-r12b`.

Swagger.io Java Client

[Swagger] is a powerful open source framework backed by a large ecosystem of tools that helps you design, build, document, and consume your RESTful APIs.

The [Swagger Editor] will autogenerate code for a ton of languages.

I was having [some trouble with the Swagger Android client] but it turns out the JAVA export also works on Android.

I was able to [automate] the [changes] needed to make the JAVA client run on Android.

image_1

From now on, keeping REST clients updated should be a snap using [Swagger]!

Swagger.io

[Swagger] is a powerful open source framework backed by a large ecosystem of tools that helps you design, build, document, and consume your RESTful APIs.

The [Swagger Editor] will autogenerate code for a ton of languages.

image_2

**Note on code generation issues**
Please open an issue in [Swagger Codegen] repository for any issue with generating code or issues with generated codes.

[Ambiguous Object]
[Generating Enum Values]

Made a temporary [Windows.Forms] project to automate syntax fixes.

image_1

Two potential devs that worked on the Java client.
[David Kiss] from Toronto, Canada
[Xu Hui Hui] from Lianyungang, China

I do have [some questions] about the Swagger Android client.

OUYA Plugin With Turret Mouse Support

I made some changes to the OUYA Unity Plugin and placed the updates into a new repository. I moved the Java source into an Android Studio project and removed the Java/NDK compile options from the editor. And then I added support for the Razer Turret Mouse service with an API to access the mouse position and button information on the Forge TV.

https://github.com/ouya/ouya-unity-plugin

Xamarin: Bypass JAR Binding

Xamarin has a nice C# binding process that automatically wraps Java so that it can be called from C#. In my case the binding was causing an Input ANR (activity-not-responding) crash during startup. [This post] provided enough detail to be able to bypass the binding process so that I could use a raw Java activity to bypass the crash that was happening.

org.apache.http.legacy

There’s a handy Gradle setting if you are using `Google Play` and try to target API `23` you’ll see `org.apache.http` went missing. This handy Gradle setting brings the legacy packages back.

apply plugin: 'com.android.library'

android {
    compileSdkVersion 23
    buildToolsVersion '24.0.1'
    useLibrary 'org.apache.http.legacy'

Cocos2d Plugin for Razer SDK

I created a Cocos2d Plugin for the Razer SDK. There’s several ways to build Cocos2d (i.e. Visual Studio, Android Studio, and XCode). The Visual Studio build process doesn’t support the AAR format yet, so the plugin uses the JAR format. The Android Studio gradle files do support AAR files.
[Cocos2d Plugin Razer SDK]