-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Hi,
The Swagger JSON generated on the api framework isn't Java compliant and it needs to be if we are going to generate an Android compliant jar. As the plugin automatically generates the JSON based on your function and object names it will require significant changes to your code. At the moment the issues that stick out are:
- some of your endpoints have a '-' in their name. In the SDK they equate to method names; java doesn't allow '-' in method names.
- there are issues with model objects and their cases, the swagger code generator created the files with lower case e.g. account.java and name the class inside that file with a capital at the start e.g. public class Account. The result is that files won't compile! You may need to capitalise your object models, even if this goes against the python ethos. In the generate-graph-api-sdk.sh file I added a line to capitalise the files (ls | awk '{system("mv " $0 " " toupper(substr($0,1,1)) substr($0,2))}') but there are still problems with capital letters in the VApi.java file.
- Some of the JSON is missing a type. When this is the case the auto-generated Java has method signatures that are missing the Object definition. e.g. public Status createAccount(details) where it should be public Status createAccount( AccountDetails details).
- It would also be great if ye used the extra_actions feature of the django-tastypie-swagger plugin to add a description to improve the API documentation (http://django-tastypie-swagger.readthedocs.org/en/latest/#using-extra-actions).
To generate the SDK pull the latest version of the vagrant environment, run the provision script, start openi, cd to the openi_android_sdk module and run the build-graph-api-sdk.sh file.
- git clone https://github.com/OPENi-ict/openi-dev-env
- cd openi-dev-env
- vagrant up
- vagrant halt
- vagrant up
- vagrant ssh
---- From within the machine ---- - sh provision_openi.sh
- sh tmux_openi.sh
- to exit tmux hit ctrl+b together follow by d
- cd /home/vagrant/repos/openi_android_sdk/
- sh build-graph-api-sdk.sh dev.openi-ict.eu
We had the same problems with the cloudlet framework but with the help of Velti we managed to update the JSON to eliminate the problems. If I cannot be contacted for assistance you may try Timos.
Metadata
Metadata
Assignees
Labels
No labels