Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [kapua-dev] REST API SDK

Yeah, my experiences with Swagger generator is that clients are far from being readable. :(

But maybe let's try to generate client in the first place and let's see how nice it is from a developer point of view. Then let's decide which approach (generator vs manually created wrapper) will be the best.

Sounds fair?

wt., 28 mar 2017 o 15:22 użytkownik Jens Reimann <jreimann@xxxxxxxxxx> napisał:
One candidate could also be OkHttp. I've seen Cedric Brun do amazing things with this programming against the Mattermost API, creating his chat bot.

I have a few doubts that we can simple "generate" the client code though. And in many cases generated code looks ugly and overly complex compared to a well designed API.

So if we can automatically validate the API against the server REST interface, which should be possible during the build, then we should consider defining the Client API ourselves making it easy to understand. And would still catch incompatibilities pretty early. Which is also important as we need to provide some backward compatibility at some point.



On Tue, Mar 28, 2017 at 3:11 PM, Morson, Stefano <stefano.morson@xxxxxxxxxxxx> wrote:

Having a SDK to ease the writing of the client code is a good idea.

Client code is about building 3rd party apps on top of Kapua so we should also support multiple bindings to guarantee the highest level of access to the platform. More over, in my experience, not only it requires coding effort but it also needs to be constantly kept aligned with the API. So i think that the code generation approach is the best, 

- reduces the coding effort 

- automatically keeps the SDK aligned with the API

- supports multiple bindings


Swagger supports code generation but it is not the only tool, one may want to use 

wadl2java (also used in SOAPUI I guess), maybe there are plugins for IDEs. These will produce full-object wrappers.


When developing client code the most boring part of the job is to deal with model objects.

We could support a lightweight client library that uses apache http-components (which is rest framework agnostic) or jersey classes to manage http connections; swagger can then generate the code for model objects in the bindings that we want to support (which initially will be java).


So I wouldn't develop an on-purpose library here.


Stefano Morson


From: kapua-dev-bounces@xxxxxxxxxxx <kapua-dev-bounces@xxxxxxxxxxx> on behalf of Dejan Bosanac <dejanb@xxxxxxxxxxxx>
Sent: Tuesday, March 28, 2017 9:58:58 AM
To: kapua developer discussions
Subject: Re: [kapua-dev] REST API SDK
 
+1

On Tue, Mar 28, 2017 at 9:22 AM, Jens Reimann <jreimann@xxxxxxxxxx> wrote:
I any case, having a "ready-to-run" Kapua Client SDK would be awesome! And having a well-designed API would probably help!

On Mon, Mar 27, 2017 at 6:32 PM, Mezzasalma, Claudio <Claudio.Mezzasalma@xxxxxxxxxxxx> wrote:

Swagger itself (not the UI project of course) should be capable of something similar automatically. Have you looked into it?

 

-- 

Claudio Mezzasalma | Eurotech

 

Da: <kapua-dev-bounces@xxxxxxxxxxx> per conto di Henryk Konsek <hekonsek@xxxxxxxxx>
Risposta: kapua developer discussions <kapua-dev@xxxxxxxxxxx>
Data: lunedì 27 marzo 2017 18:12
A: kapua developer discussions <kapua-dev@xxxxxxxxxxx>
Oggetto: [kapua-dev] REST API SDK

 

Hi,

 

What do you think about adding REST API SDK module to Kapua? That would be useful both for testing purposes, as for end users. I'm thinking about creating SDK DSL wrapper around HTTP client similar to something like:

 

KapuaTokenProvider token = new KapuaTokenProvider(""username", "password");

List<User> users = new UserService(token).listUsers();

 

I can start working on such SDK module, as will need it anyway for OpenShift regression testing.

 

What do you think?

 

Cheers!

--


_______________________________________________
kapua-dev mailing list
kapua-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/kapua-dev




--
Jens Reimann
Senior Software Engineer / EMEA ENG Middleware
Werner-von-Siemens-Ring 14
85630 Grasbrunn
Germany
phone: +49 89 2050 71286
_____________________________________________________________________________

Red Hat GmbH, www.de.redhat.com,
Registered seat: Grasbrunn, Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Paul Argiry, Charles Cachera, Michael Cunningham, Michael O'Neill

_______________________________________________
kapua-dev mailing list
kapua-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/kapua-dev




--
Regards
--
Dejan Bosanac
http://sensatic.net/about

_______________________________________________
kapua-dev mailing list
kapua-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/kapua-dev




--
Jens Reimann
Senior Software Engineer / EMEA ENG Middleware
Werner-von-Siemens-Ring 14
85630 Grasbrunn
Germany
phone: +49 89 2050 71286
_____________________________________________________________________________

Red Hat GmbH, www.de.redhat.com,
Registered seat: Grasbrunn, Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Paul Argiry, Charles Cachera, Michael Cunningham, Michael O'Neill
_______________________________________________
kapua-dev mailing list
kapua-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/kapua-dev
--
Henryk Konsek

Back to the top