Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    justjacksonn
    @justjacksonn
    What tends to happen is, you build your own sort of SDK to make rest calls easier to do.
    Sam Duke
    @samskiter
    yes. certainly each will need a lot of options (as jsonschema2pojo has). by the same token therefore, 1 sdk per laguage isn't going to meet everyones' needs
    typical retrofit error handling that i could do without writing:
    RetrofitError.Kind kind = ((RetrofitError) cause).getKind();
                    switch (kind)
                    {
                        case HTTP:
                            if (re.getResponse().getStatus() == 409)
                            {
                                //409=Player is already a member of a team
                                gameCreatedHandler.onGameCreateFailed(GameCreateFailureReasons.NAME_EXISTS);
                                return;
                            }
                            break;
                        case CONVERSION:
                        case UNEXPECTED:
                            gameCreatedHandler.onGameCreateFailed(GameCreateFailureReasons.GENERAL);
                            throw re;
                    }
    justjacksonn
    @justjacksonn
    Our generator actually has a set of maps based on http codes to java exceptions. Based on the 4xx or 5xx we build up a list of Throws... for the method.
    So consumers of the SDK then wrap a try..catch block and handle it like Java exceptions.
    in other words... its yet another way to do it. :D
    Sam Duke
    @samskiter
    yup, an example of a good thing to have as an option
    errors as exception/enum
    justjacksonn
    @justjacksonn
    the bigger question to me is.. if youre a small startup.. presenting your rest API with a generated SDK using a library built by one guy in his spare time that may never receive support again... may be ok to use.. especially given if its open source and you can grab the source and maintain it yourself. Hell in most cases the original authors will probably be all to happy to add another contributor or two to keep it going.
    But mid to larger sized companies offering up public SDKs from their APIs are going to want some level of support commitment around the tools they use.
    So something like the retrofit raml2code would not work in these sorts of cases.
    at least in most.. I am sure there are some that would overlook that.
    Sam Duke
    @samskiter
    theres no other choice currently
    justjacksonn
    @justjacksonn
    This is partly why I want to stick with Mulesofts/RAML raml-generator project.
    I know it will get updated to the 1.0 parser soon as it can
    yes that is true
    How likely would you be to use a docker published build engine vs downloading a tool like retrofit?
    Sam Duke
    @samskiter
    no idea what docker is
    justjacksonn
    @justjacksonn
    meaning, if there were an SDK generator that put out a couple languages from a RAML feed... but it was only available as a docker image that you had to run..
    Ah.. ok
    docker is basically a virtual machine
    but light weight
    Sam Duke
    @samskiter
    ah yes i think i have heard of it
    retrofit isnt a build engine, so your question confuses me
    justjacksonn
    @justjacksonn
    you install a docker daemon... and it acts as if you have installed an entire VM... but it shares base level resources and runs images in their own sandboxes
    Well, if you could simply do something like docker run ramlsdkgenerator -i my/path/to/raml -o target
    and the result would be one or more SDKs generated (different languages)
    would that be useful versus downloading a nodejs app and running it?
    docker is a company and they have a public docker repository where you can publish shareable docker images
    that anyone can run
    Sam Duke
    @samskiter
    id rather it was a gradle plugin tbh, no need for docker or anything
    i dont want to run this standalone
    justjacksonn
    @justjacksonn
    ok..why is that?
    Sam Duke
    @samskiter
    i want my raml api checked into my repo so the generated code is always up to date with the API and api docs
    so i check out the code and on building, it generates the retrofit client and the Pojos
    justjacksonn
    @justjacksonn
    Oh..this wouldnt change that at all.. the only thing what I am describing replaces is having to run something like raml-retrofit by installing it via node locally..
    Sam Duke
    @samskiter
    well i dont i have it all in a gradle script
    justjacksonn
    @justjacksonn
    with a sort of global build tool.. your raml, schemas, generated SDKs, etc are all yours.
    Sam Duke
    @samskiter
    but if some one could wrap that gradle script up for me into a nicely maintained thing then yea, great. i dont really care how it come down. just abstract the controls to me.
    justjacksonn
    @justjacksonn
    you could certainly add the docker run command in your gradle script as well
    exactly
    Sam Duke
    @samskiter
    yea sure i could. sounds like just as much of a faff.
    justjacksonn
    @justjacksonn
    the use of it is abstracted so you just make a call pss in raml/schems, get out generated docs, sdks, etc
    Sam Duke
    @samskiter
    what really matters is what options are available.
    justjacksonn
    @justjacksonn
    agreed
    Sam Duke
    @samskiter
    right now raml-client-generator comes down as an npm module so will be just as much of a pain to use
    so yea that would be great as a gradle plugin like jsonschema2pojo... i'm sure someone will do it eventually
    btw, regarding 1.0 support, raml2code is based on raml-js-parser, maintained by raml-org, so im not too worried about that
    Sam Duke
    @samskiter
    (as is raml-generator)
    justjacksonn
    @justjacksonn
    yup..very true.