Re: GWT + Open API

2017-03-27 Thread Ireneusz Szcześniak
Wow, awesome! Thank you, Ignacio, so much! You gave me a lot to study! I need some time to look through it. Best, Irek On 26.03.2017 22:45, Ignacio Baca Moreno-Torres wrote: I have applied my generator to the swagger petstore api, hehe it is pretty unstable, but after some NPE fixes and mi

Re: GWT + Open API

2017-03-26 Thread Ignacio Baca Moreno-Torres
Ok, you can make it work but at least in chrome you need to accept the "load unsafe scripts" warning. On Sunday, March 26, 2017 at

Re: GWT + Open API

2017-03-26 Thread Ignacio Baca Moreno-Torres
I have applied my generator to the swagger petstore api, hehe it is pretty unstable, but after some NPE fixes and minor improvements I have generated the API Interface and models. Demo project here https://github.com/ibaca/petstore-client-gwt, uploaded with sourceMaps at https://ibaca.github.io

Re: GWT + Open API

2017-03-25 Thread Ireneusz Szcześniak
Thanks, Rogelio, for your instructions. I'm working on this now. I'll report on the progress later. On 23.03.2017 22:56, Rogelio Flores wrote: No, I have not tried generating API interfaces for a CXF client. I don't remember even seeing that option when we first created the api (more than a ye

Re: GWT + Open API

2017-03-25 Thread Ireneusz Szcześniak
I'm preparing laboratory exercises for students, and we're using the Swagger's Pet Store: http://petstore.swagger.io/v2/swagger.json On 25.03.2017 09:46, Ignacio Baca Moreno-Torres wrote: No :), just to see the complexity of the API and what happens if I add it to my generator. On Friday, Mar

Re: GWT + Open API

2017-03-25 Thread Ignacio Baca Moreno-Torres
No :), just to see the complexity of the API and what happens if I add it to my generator. On Friday, March 24, 2017 at 8:11:59 PM UTC+1, Irek Szczesniak wrote: > > It's public. Does it make some difference? > > On 23.03.2017 17:04, Ignacio Baca Moreno-Torres wrote: > > Just curious, the API i

Re: GWT + Open API

2017-03-24 Thread Ireneusz Szcześniak
It's public. Does it make some difference? On 23.03.2017 17:04, Ignacio Baca Moreno-Torres wrote: Just curious, the API is internal or external, the swagger spec is public? El jue., 23 mar. 2017 12:16, Ireneusz Szcześniak mailto:irek.szczesn...@gmail.com>> escribió: Thank you, Rogelio, f

Re: GWT + Open API

2017-03-23 Thread Rogelio Flores
No, I have not tried generating API interfaces for a CXF client. I don't remember even seeing that option when we first created the api (more than a year ago). I might try that out. To create our GWT "Models" module, we simply add a gwt module file with these 3 lines: to the generated

Re: GWT + Open API

2017-03-23 Thread Ignacio Baca Moreno-Torres
Just curious, the API is internal or external, the swagger spec is public? El jue., 23 mar. 2017 12:16, Ireneusz Szcześniak escribió: > Thank you, Rogelio, for your input. > > I like the idea of generating the data model from the OpenAPI > specification, because I will not have to write some bor

Re: GWT + Open API

2017-03-23 Thread Ireneusz Szcześniak
Thank you, Rogelio, for your input. I like the idea of generating the data model from the OpenAPI specification, because I will not have to write some boring error-prone code. I also like the optimization of the GWT compiler. The swagger-codegen can output Jaxrs Cxf Client, which has the API

Re: GWT + Open API

2017-03-22 Thread Rogelio Flores
Yes, those are the Models I was referring to. I can't compare my approach to JsInterop + RequestBuilder/XMLHttpRequest because I haven't tried it, but having used RequestBuilder (and direct XMLHttpRequest) before, I can't see how you will write less code using that approach. A benefit of doing

Re: GWT + Open API

2017-03-21 Thread Ireneusz Szcześniak
Thanks, Rogelio! When you auto-generate Java source code, do you use swagger-codegen to generate Java client code, so that you get Java classes implementing the types from the OpenAPI #/definitions? On 21.03.2017 20:50, Rogelio Flores wrote: We do auto-generate Java source code out of the sw

Re: GWT + Open API

2017-03-21 Thread Ireneusz Szcześniak
Thanks, Ignacio! Your description sounds very convincing. If JsInterop + RequestBuilder do the trick (out of the GWT box), then that's awsome! I'll give it a try. Thanks again! On 21.03.2017 20:47, Ignacio Baca Moreno-Torres wrote: Accessing REST apis using JsInterop is easy and natural. R

Re: GWT + Open API

2017-03-21 Thread Rogelio Flores
We do auto-generate Java source code out of the swagger api (including a GWT module). That allows us to use the Models on both client and server side. So we don't have to write much code. Basically all we do is specify some options for RestyGWT and specify the endpoints. On Monday, March 20, 2

Re: GWT + Open API

2017-03-21 Thread Ignacio Baca Moreno-Torres
Accessing REST apis using JsInterop is easy and natural. RestyGWT add almost nothing if you use JsInterop so you better use XMLHttpRequest directly (RequestBuilder is easier, and is a thin wrapper around XMLHttpRequest). If you want a bit of code-organization, you might use AutoREST, but this d

Re: GWT + Open API

2017-03-21 Thread Ireneusz Szcześniak
Thanks, Jens! This sounds interesting. Are there some examples on how to do that? I guess, the problem is not how to use JsInterop, but how to handle asynchronous HTTP requests with the generated data model. Best, Irek On 21.03.2017 10:43, Jens wrote: Swagger itself has also a code gener

Re: GWT + Open API

2017-03-21 Thread Jens
Swagger itself has also a code generator that already can output JavaScript so you could wrap it using JsInterop. You could also write a custom plugin for Swagger's code generator that outputs GWT compatible Java code directly. Just open your swagger JSON in http://editor.swagger.io/#!/ and down

Re: GWT + Open API

2017-03-20 Thread Ireneusz Szcześniak
Thank you, Ignacio, for your input. What's cool in your solution is that it uses the JsInterop provided by GWT. I wonder what are the pro and cons of the JsInterop approach versus the RestyGWT approach. On 21.03.2017 00:00, Ignacio Baca Moreno-Torres wrote: JsInterop and XMLHttpRequest is

Re: GWT + Open API

2017-03-20 Thread Ireneusz Szcześniak
Thank you, Rogelio, for your info. But I guess no code is generated automatically, you have to develop it yourself. Is this right? I'm not fully for code generation (such code is usually messy and hard to read), but generating some bits, like a model of the data structures could be useful.

Re: GWT + Open API

2017-03-20 Thread Ignacio Baca Moreno-Torres
JsInterop and XMLHttpRequest is a good option too, aka. autorest ;)... this WIP generator reads openapi from apisguru and generates the GWT JsInterop spec. On Mon, Mar 20, 2017 at 6:24 PM Rogelio Flores wrote: > We use RestyGWT to consume a swagger REST API and are very pleased with it: > > http

Re: GWT + Open API

2017-03-20 Thread Rogelio Flores
We use RestyGWT to consume a swagger REST API and are very pleased with it: https://resty-gwt.github.io/index.html On Monday, March 20, 2017 at 7:06:08 AM UTC-6, Irek Szczesniak wrote: > > Hi, > > I need to develop a web client with GWT, which consumes a web service > defined with Open API (fo

GWT + Open API

2017-03-20 Thread Irek Szczesniak
Hi, I need to develop a web client with GWT, which consumes a web service defined with Open API (formerly Swagger). I wonder whether someone could offer some advice on how to do it best with GWT. Thanks, Irek -- You received this message because you are subscribed to the Google Groups "GWT