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 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 Java source code, package it into a jar file, and we
can import and use that module on any GWT app (and also on the server
side along with the rest of the generated files, so we can call the
same api programmatically).

Our API is externally available (to customers that buy our enterprise
product) so that customers can request/manipulate the data with their
own RESTful clients if they choose to.


On Thursday, March 23, 2017 at 5:16:58 AM UTC-6, Irek Szczesniak wrote:

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
interface defined with JAX-RS annotations.  So it seems that even the
interfaces could be auto-generated.  You only have to modify them so
that they extend RestService, required by RestyGWT.

Have you tried auto-generating the API interfaces with Jaxrs Cxf
Client?

In your previous message you wrote that you auto-generate a GWT
module.  What do you specifically mean by a module here?  Do you use
some publicly-available tools, or do you have something home-grown?

On 22.03.2017 23:51, Rogelio Flores wrote:
> 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
> things in Java is that GWT will optimize the resulting javascript
> (Java classes/methods from the generated api that don't get used
> aren't included).
>
>
> On Tuesday, March 21, 2017 at 10:39:09 PM UTC-6, Irek Szczesniak
wrote:
>
> 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 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, 2017 at 11:32:41 PM UTC-6, Irek
Szczesniak
> wrote:
> >
> > 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.
> >
> > On 20.03.2017 18:24, Rogelio Flores wrote:
> > > 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 (formerly Swagger).
> > >
> > > I wonder whether someone could offer some advice on
> how to
> > do it
> > > best with GWT.
> > >
> > >
> > > Thanks,
> > > Irek
> > >
> > > --
> > > You received this message be

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, 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 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 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
> interface defined with JAX-RS annotations.  So it seems that
even the
> interfaces could be auto-generated.  You only have to modify
them so
> that they extend RestService, required by RestyGWT.
>
> Have you tried auto-generating the API interfaces with Jaxrs
Cxf
> Client?
>
> In your previous message you wrote that you auto-generate a GWT
> module.  What do you specifically mean by a module here?  Do
you use
> some publicly-available tools, or do you have something
home-grown?
>
> On 22.03.2017 23:51, Rogelio Flores wrote:
> > 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
> > things in Java is that GWT will optimize the resulting
javascript
> > (Java classes/methods from the generated api that don't
get used
> > aren't included).
> >
> >
> > On Tuesday, March 21, 2017 at 10:39:09 PM UTC-6, Irek
Szczesniak
> wrote:
> >
> > 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
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, 2017 at 11:32:41 PM UTC-6, Irek
> Szczesniak
> > wrote:
> > >
> > > 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.
> > >
> > > On 20.03.2017 18:24, Rogelio Flores wrote:
> > > > 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 (forme

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 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 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 
> > interface defined with JAX-RS annotations.  So it seems that even 
> the 
> > interfaces could be auto-generated.  You only have to modify them so 
> > that they extend RestService, required by RestyGWT. 
> > 
> > Have you tried auto-generating the API interfaces with Jaxrs Cxf 
> > Client? 
> > 
> > In your previous message you wrote that you auto-generate a GWT 
> > module.  What do you specifically mean by a module here?  Do you use 
> > some publicly-available tools, or do you have something home-grown? 
> > 
> > On 22.03.2017 23:51, Rogelio Flores wrote: 
> > > 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 
> > > things in Java is that GWT will optimize the resulting javascript 
> > > (Java classes/methods from the generated api that don't get used 
> > > aren't included). 
> > > 
> > > 
> > > On Tuesday, March 21, 2017 at 10:39:09 PM UTC-6, Irek Szczesniak 
> > wrote: 
> > > 
> > > 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 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, 2017 at 11:32:41 PM UTC-6, Irek 
> > Szczesniak 
> > > wrote: 
> > > > 
> > > > 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. 
> > > > 
> > > > On 20.03.2017 18:24, Rogelio Flores wrote: 
> > > > > 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 (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 a 
> > > topic 
> > > > in the 
> > > >  

GWT gwt obfuscation (gwt-style=OBF) generates invalid css

2017-03-25 Thread Hannes
I compile my gwt project with gwt-style=OBF. Now I realize that this 
generates media queries where the space between "and" and "(" is missing. 
So out of 

@media screen and ( ... gets 
@media screen and(

As you can see the space between "and"  and "(" is missing.
According to W3C this not ok and 
also does not work (at least in chrome and firefox). 
You can easily test this in chrome by adding a @media query for example in 
chrome by adding a rule to the inspector style sheet as desribed here 
.
 
You will see that adding the space between "and" and "(" changes 
everything! :-)


Do you have any idea how to generate working css and still use gwt 
code obfuscation?

Thanks in advance
Hannes

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.