I have been a project coming up that I really onlyneed a restful API on.
The front end will be first built on a mobile device(iOS )then back on possibly android, with a very stripped down web application.
i would like to use pharo/gemstones as the database.
is there a project out there that allows for such restful API development in pharo land? This would be so fun! thanks |
Am 23.06.2015 um 11:40 schrieb
sergio_101:
I am not so sure what you mean exactly but this is my stack. I use pure Zinc-REST on the Gemstone side and the REST API is described in Swagger-Spec from within Gmestone. Clients are VBA, Amber and Pharo and they utilize the Swagger API spec to access the server. Works pretty well and is much more preformant than the intial Pharo MongoDB backend I initially used. Have a look into http://smalltalkhub.com/#!/~HeSe/Swagger-Spec There you can find most of the needed Swagger implementation some minor details like type constants are missing. Once your Gemstoneserver knows how to host his Swagger-Spec you can host it via https://github.com/swagger-api/swagger-ui This saves a lot of explaning time to client developers. Sebastian |
In the event you need a bit more than the below would buy you (although it sounds like it would be fine) Seaside has a REST add-on -> http://book.seaside.st/book/advanced/restful Andrew From: Pharo-users <[hidden email]> on behalf of Sebastian Heidbrink <[hidden email]> Reply-To: Any question about pharo is welcome <[hidden email]> Date: Tuesday, June 23, 2015 at 3:12 PM To: Any question about pharo is welcome <[hidden email]> Subject: Re: [Pharo-users] RESTful API with Pharo with Gemstones Am 23.06.2015 um 11:40 schrieb
sergio_101:
I am not so sure what you mean exactly but this is my stack. I use pure Zinc-REST on the Gemstone side and the REST API is described in Swagger-Spec from within Gmestone. Clients are VBA, Amber and Pharo and they utilize the Swagger API spec to access the server. Works pretty well and is much more preformant than the intial Pharo MongoDB backend I initially used. Have a look into http://smalltalkhub.com/#!/~HeSe/Swagger-Spec There you can find most of the needed Swagger implementation some minor details like type constants are missing. Once your Gemstoneserver knows how to host his Swagger-Spec you can host it via https://github.com/swagger-api/swagger-ui This saves a lot of explaning time to client developers. Sebastian |
In reply to this post by Sebastian Heidbrink-2
Just curious. How do you implement authorization/authentication? Is
there OAuth(2) support? Or you just use api token? Mariano On 23/06/15 16:12, Sebastian Heidbrink wrote: > Am 23.06.2015 um 11:40 schrieb sergio_101: >> I have been a project coming up that I really onlyneed a restful API on. >> >> The front end will be first built on a mobile device(iOS )then back >> on possibly android, with a very stripped down web application. >> >> i would like to use pharo/gemstones as the database. >> >> is there a project out there that allows for such restful API >> development in pharo land? This would be so fun! >> >> thanks > > I am not so sure what you mean exactly but this is my stack. > > I use pure Zinc-REST on the Gemstone side and the REST API is described > in Swagger-Spec from within Gmestone. > Clients are VBA, Amber and Pharo and they utilize the Swagger API spec > to access the server. > > Works pretty well and is much more preformant than the intial Pharo > MongoDB backend I initially used. > > Have a look into http://smalltalkhub.com/#!/~HeSe/Swagger-Spec > There you can find most of the needed Swagger implementation some minor > details like type constants are missing. > > Once your Gemstoneserver knows how to host his Swagger-Spec you can host > it via https://github.com/swagger-api/swagger-ui > This saves a lot of explaning time to client developers. > > Sebastian |
In reply to this post by Sebastian Heidbrink-2
hey, sebastian.. this looks great! this looks like what i am after.. did you run into any problems or limitations using Amber as a front end? I have not tried Amber yet, so this might be the right time to give it a shot.. where did you find zinc-rest? a quick search turns up references to it.. should i be able to just install it via my image? andrew - i thought about using the seaside rest add on, but seaside seems to be alot of overhead just to run a rest server.. mariano - i am thinking about using api token.. On Tue, Jun 23, 2015 at 3:13 PM Sebastian Heidbrink <[hidden email]> wrote:
|
In reply to this post by sergio_101
---> Save our in-boxes! http://emailcharter.org <---
Johan Fabry - http://pleiad.cl/~jfabry PLEIAD lab - Computer Science Department (DCC) - University of Chile |
In reply to this post by sergio_101
Hi Sergio,
Zinc-REST is part of the Zinc repository and a fork for Gemstone can be found here: https://github.com/GsDevKit/zinc/tree/gs_master/repository/Zinc-REST.package Most part is to implement the code that generates the Swagger specification for your ZnRESTCall subclasses. But it is no vodoo. It becomes more complexe if you would actually like to use the swagger specification on the server site to do request data validation and error handling,.... I currently use Swagger only for documentation purposes. Amber limitations? Not really. It took me some time to figure out how to configure my servers to cope with CORS for the Swagger-UI and my current jsonwebtocken security mechanism is not supported by the SwaggerUI and I had to allow insecure access for the Swagger UI to the Gemstone server. The Amber Swagger-JS integration works quite nicely. I did not publish the code on Github because the integration is so tiny. I can send it to you if you like. Or no,... let me prepare a demo based on the Swagger petshop demo and I will put it online. Might take a day or two until I find some time. Sebastian Am 23.06.2015 um 13:05 schrieb sergio_101:
|
> On 23 Jun 2015, at 22:55, Sebastian Heidbrink <[hidden email]> wrote: > > Hi Sergio, > > Zinc-REST is part of the Zinc repository and a fork for Gemstone can be found here: https://github.com/GsDevKit/zinc/tree/gs_master/repository/Zinc-REST.package > Most part is to implement the code that generates the Swagger specification for your ZnRESTCall subclasses. But it is no vodoo. > It becomes more complexe if you would actually like to use the swagger specification on the server site to do request data validation and error handling,.... I currently use Swagger only for documentation purposes. > > Amber limitations? Not really. > It took me some time to figure out how to configure my servers to cope with CORS for the Swagger-UI and my current jsonwebtocken security mechanism is not supported by the SwaggerUI and I had to allow insecure access for the Swagger UI to the Gemstone server. > > The Amber Swagger-JS integration works quite nicely. > I did not publish the code on Github because the integration is so tiny. I can send it to you if you like. > Or no,... let me prepare a demo based on the Swagger petshop demo and I will put it online. > Might take a day or two until I find some time. Yes please write something about this, this is interesting for many people. > Sebastian > > > > > Am 23.06.2015 um 13:05 schrieb sergio_101: >> hey, sebastian.. this looks great! this looks like what i am after.. >> >> did you run into any problems or limitations using Amber as a front end? I have not tried Amber yet, so this might be the right time to give it a shot.. where did you find zinc-rest? a quick search turns up references to it.. should i be able to just install it via my image? >> >> andrew - i thought about using the seaside rest add on, but seaside seems to be alot of overhead just to run a rest server.. >> >> mariano - i am thinking about using api token.. >> >> >> >> On Tue, Jun 23, 2015 at 3:13 PM Sebastian Heidbrink <[hidden email]> wrote: >> Am 23.06.2015 um 11:40 schrieb sergio_101: >>> I have been a project coming up that I really onlyneed a restful API on. >>> >>> The front end will be first built on a mobile device(iOS )then back on possibly android, with a very stripped down web application. >>> >>> i would like to use pharo/gemstones as the database. >>> >>> is there a project out there that allows for such restful API development in pharo land? This would be so fun! >>> >>> thanks >> >> I am not so sure what you mean exactly but this is my stack. >> >> I use pure Zinc-REST on the Gemstone side and the REST API is described in Swagger-Spec from within Gmestone. >> Clients are VBA, Amber and Pharo and they utilize the Swagger API spec to access the server. >> >> Works pretty well and is much more preformant than the intial Pharo MongoDB backend I initially used. >> >> Have a look into http://smalltalkhub.com/#!/~HeSe/Swagger-Spec >> There you can find most of the needed Swagger implementation some minor details like type constants are missing. >> >> Once your Gemstoneserver knows how to host his Swagger-Spec you can host it via https://github.com/swagger-api/swagger-ui >> This saves a lot of explaning time to client developers. >> >> >> Sebastian > |
In reply to this post by sergio_101
We go a very similiar way as Sebastian - but with our company need NOT
to build a Smalltalk-only system, but also offer support for several other developers/languages. We use * Zinc REST * Gemstone 3.2.6 We generate code to have: * Swagger-UI and Swagger-Core support (currently 1.2) Earlier the swagger stuff was also handled by Gemstone, but now we create Gemstone-Code to write the Swagger-specs into the server filesystem. Practically the swagger-core support has been working with C# (we had to correct/change the template for source code generation). We see now the need to go to Swagger 2.0, to stay near the development master stream. The whole system is working very stable - the only problem I have is a 10 MB limit on the Gemstone socket system - here the Zinc HTTP System subsystem must be changed to get rid of this problem. Marten Am 23.06.2015 um 20:40 schrieb sergio_101: > I have been a project coming up that I really onlyneed a restful API on. > > The front end will be first built on a mobile device(iOS )then back on > possibly android, with a very stripped down web application. > > i would like to use pharo/gemstones as the database. > > is there a project out there that allows for such restful API > development in pharo land? This would be so fun! > > thanks -- Marten Feldtmann |
In reply to this post by Sven Van Caekenberghe-2
Hi Sven,
I put some code on GitHub. There is no working example yet, but all one needs. I have to get back into Amber and their current way to integrate external libs. As soon as I have that working again I will add a Version 1.2 petstore example. https://github.com/HeSe/amber-swaggerJs Most important part is the SwaggerApi class and the methods build and initializeSwaggerInterfaceFor: They import the hosted swagger spec and build the JS-Api Interface object one can use in Amber,.... there is really not much to it. Sebastian Am 23.06.2015 um 14:39 schrieb Sven Van Caekenberghe: >> On 23 Jun 2015, at 22:55, Sebastian Heidbrink <[hidden email]> wrote: >> >> Hi Sergio, >> >> Zinc-REST is part of the Zinc repository and a fork for Gemstone can be found here: https://github.com/GsDevKit/zinc/tree/gs_master/repository/Zinc-REST.package >> Most part is to implement the code that generates the Swagger specification for your ZnRESTCall subclasses. But it is no vodoo. >> It becomes more complexe if you would actually like to use the swagger specification on the server site to do request data validation and error handling,.... I currently use Swagger only for documentation purposes. >> >> Amber limitations? Not really. >> It took me some time to figure out how to configure my servers to cope with CORS for the Swagger-UI and my current jsonwebtocken security mechanism is not supported by the SwaggerUI and I had to allow insecure access for the Swagger UI to the Gemstone server. >> >> The Amber Swagger-JS integration works quite nicely. >> I did not publish the code on Github because the integration is so tiny. I can send it to you if you like. >> Or no,... let me prepare a demo based on the Swagger petshop demo and I will put it online. >> Might take a day or two until I find some time. > Yes please write something about this, this is interesting for many people. > >> Sebastian >> >> >> >> >> Am 23.06.2015 um 13:05 schrieb sergio_101: >>> hey, sebastian.. this looks great! this looks like what i am after.. >>> >>> did you run into any problems or limitations using Amber as a front end? I have not tried Amber yet, so this might be the right time to give it a shot.. where did you find zinc-rest? a quick search turns up references to it.. should i be able to just install it via my image? >>> >>> andrew - i thought about using the seaside rest add on, but seaside seems to be alot of overhead just to run a rest server.. >>> >>> mariano - i am thinking about using api token.. >>> >>> >>> >>> On Tue, Jun 23, 2015 at 3:13 PM Sebastian Heidbrink <[hidden email]> wrote: >>> Am 23.06.2015 um 11:40 schrieb sergio_101: >>>> I have been a project coming up that I really onlyneed a restful API on. >>>> >>>> The front end will be first built on a mobile device(iOS )then back on possibly android, with a very stripped down web application. >>>> >>>> i would like to use pharo/gemstones as the database. >>>> >>>> is there a project out there that allows for such restful API development in pharo land? This would be so fun! >>>> >>>> thanks >>> I am not so sure what you mean exactly but this is my stack. >>> >>> I use pure Zinc-REST on the Gemstone side and the REST API is described in Swagger-Spec from within Gmestone. >>> Clients are VBA, Amber and Pharo and they utilize the Swagger API spec to access the server. >>> >>> Works pretty well and is much more preformant than the intial Pharo MongoDB backend I initially used. >>> >>> Have a look into http://smalltalkhub.com/#!/~HeSe/Swagger-Spec >>> There you can find most of the needed Swagger implementation some minor details like type constants are missing. >>> >>> Once your Gemstoneserver knows how to host his Swagger-Spec you can host it via https://github.com/swagger-api/swagger-ui >>> This saves a lot of explaning time to client developers. >>> >>> >>> Sebastian > > |
In reply to this post by marten
Actually with the new version 2.0 I would also change my workflow.
Version 1.2 had not online spec editor tooling support and this is why I let Gemstone describe my REST API and render the Swagger json specification. In Swagger 2.0 I would rather take the online spec editor define a swagger spec and take the resulting json file to generate ZincRESTCall subclasses. This way a client developer or user is able to define his or her needs. Whish I had more time right now. Sebastian Am 24.06.2015 um 01:14 schrieb [hidden email]: > We go a very similiar way as Sebastian - but with our company need NOT > to build a Smalltalk-only system, but also offer support for several > other developers/languages. > > We use > > * Zinc REST > > * Gemstone 3.2.6 > > We generate code to have: > > * Swagger-UI and Swagger-Core support (currently 1.2) > > Earlier the swagger stuff was also handled by Gemstone, but now we > create Gemstone-Code to write the Swagger-specs into the server filesystem. > > Practically the swagger-core support has been working with C# (we had to > correct/change the template for source code generation). > > We see now the need to go to Swagger 2.0, to stay near the development > master stream. > > The whole system is working very stable - the only problem I have is a > 10 MB limit on the Gemstone socket system - here the Zinc HTTP System > subsystem must be changed to get rid of this problem. > > > Marten > > Am 23.06.2015 um 20:40 schrieb sergio_101: >> I have been a project coming up that I really onlyneed a restful API on. >> >> The front end will be first built on a mobile device(iOS )then back on >> possibly android, with a very stripped down web application. >> >> i would like to use pharo/gemstones as the database. >> >> is there a project out there that allows for such restful API >> development in pharo land? This would be so fun! >> >> thanks > |
Sebastian I wonder if you2015-06-25 14:51 GMT-03:00 Sebastian Heidbrink <[hidden email]>: Actually with the new version 2.0 I would also change my workflow. |
Sorry bad typing. I wonder if you have another version than the published in SmalltalkHub (using Swagger-Support-V12-SebastianHeidbrink.1 currently)(SwaggerAPIReaderV12 on: 'http://petstore.swagger.io/v2/swagger.json') readSwaggerAPIListing inspect Then "apis" Collection I guess are not read, just "info" (a SwaggerAPISpecListingInfo). Is there something missing? Cheers, Hernán 2015-06-28 18:50 GMT-03:00 Hernán Morales Durand <[hidden email]>:
|
Free forum by Nabble | Edit this page |