+1 to use swagger-js library instead of generating. As per offline discussion had with ThiliniS, the generated client had more than 10,000 lines. Even we minify it, in terms of complexity its still huge. Generated client loads necessary function, object for all the APIs in the swagger file regardless of the usage. So even we do only one API call in the web page, the generated client will load all the things, which will affect the performance of that web page.
Thanks. On Mon, Jan 16, 2017 at 3:07 PM, Joseph Fonseka <[email protected]> wrote: > +1 to use swagger-js library instead of generating one see [1]. > > Existing js generation are there for node and anguler both I guess not > suitable for us. Writing our own js generation will be bit of work and I do > not see any advantage in doing that. > > Regards > Jo > > > [1] https://github.com/swagger-api/swagger-codegen#where-is-javascript > > > On Mon, Jan 16, 2017 at 2:55 PM, Susinda Perera <[email protected]> wrote: > >> We tried [2] to generate java client, which is easy and less java coding, >> for js I believe [1] would work. >> >> Thanks >> Susinda >> >> >> On Mon, Jan 16, 2017 at 2:19 PM, Thilini Shanika <[email protected]> >> wrote: >> >>> Hi All, >>> >>> According to the proposed C5 architecture, we are using frontend java >>> script based implementation to invoke relevant swagger APIs and render APIM >>> webapps (Publisher, Store etc). In that case, we have to use a java script >>> based swagger client in APIM Store, Publisher UUF apps. >>> >>> Following are the options we have. >>> >>> *1. Using Swagger Javascript library [1]* >>> >>> Using this, we can dynamically generate swagger client based on the >>> given swagger definition (This does not require any static code >>> generation). In current C5 implementations, we are using Swagger-js library >>> based client to invoke backend APIs to render store/publisher UI. It is >>> given that, this has been thoroughly tested with mocha and this is the >>> fastest way to enable communication with backend swagger server. >>> >>> *2. Using Swagger Code Generator to generate Javascript Swagger client >>> [2]* >>> >>> In this approach, we have to generate a static swagger client for each >>> swagger definitions in Publisher, Store, Admin apps and maintain that >>> particular client in the code base. The existing java script code >>> generator[3] supports for nodejs and angularjs, so that its difficult to >>> embed that particular client with UUF based webapps. In that case, we might >>> need to come up with a plain java script supported swagger client generator >>> and maintain it. >>> >>> What would be the best way to achieve this? >>> Is it recommended to use 3rd part swagger-js client within APIM code >>> base? >>> If not, is it beneficial to invest some effort in implementing swagger >>> code generator? >>> Are there any other better ways of achieving this? >>> >>> Your recommendations and suggestions are highly appreciated. >>> >>> [1] - https://github.com/swagger-api/swagger-js >>> [2] - https://github.com/swagger-api/swagger-codegen >>> [3] - https://github.com/wcandillon/swagger-js-codegen >>> >>> >>> >>> >>> >>> _______________________________________________ >>> Architecture mailing list >>> [email protected] >>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture >>> >>> >> >> >> -- >> *Susinda Perera* >> Software Engineer >> B.Sc.(Eng), M.Sc(Computer Science), AMIE(SL) >> Mobile:(+94)716049075 >> Blog: susinda.blogspot.com >> WSO2 Inc. http://wso2.com/ >> Tel : 94 11 214 5345 Fax :94 11 2145300 >> >> >> _______________________________________________ >> Architecture mailing list >> [email protected] >> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture >> >> > > > -- > > -- > *Joseph Fonseka* > WSO2 Inc.; http://wso2.com > lean.enterprise.middleware > > mobile: +94 772 512 430 > skype: jpfonseka > > * <http://lk.linkedin.com/in/rumeshbandara>* > > > _______________________________________________ > Architecture mailing list > [email protected] > https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture > > -- Sajith Janaprasad Ariyarathna Software Engineer; WSO2, Inc.; http://wso2.com/ <https://wso2.com/signature>
_______________________________________________ Architecture mailing list [email protected] https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
