Describing a RESTful API using Swagger

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Describing a RESTful API using Swagger

Alexander Henket-2
Hi,

Last week I came across Swagger. It seems like a useful way to describe and advertise an API that you build on eXist-db. We have many RESTful services and Swagger seems to fill a gap we have in this respect.

Anybody ever tried working with Swagger to describe stuff you built with eXist-db? Anybody have any alternative way of offering a RESTful API for consumption? The neat thing about Swagger is that it could help people generating client code so I can concentrate on building just the server part for example. On the other hand: Swagger also supports generating server code, but I would not know where to leverage that part.

Looking forward to insights.

Regards

Alexander Henket

------------------------------------------------------------------------------

_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: Describing a RESTful API using Swagger

Peter Stadler
Hi Alexander,

interestingly, I’ve just recently started working with swagger and eXist. Some very basic code can be found at https://github.com/Edirom/ViFE-API. The idea is to have a generic controller.xql that imports project specific API modules.
But if anyone has already done some XQuery code templating from swagger config files that’d be even better!

Cheers
Peter


> Am 20.11.2016 um 13:32 schrieb Alexander Henket <[hidden email]>:
>
> Hi,
>
> Last week I came across Swagger. It seems like a useful way to describe and advertise an API that you build on eXist-db. We have many RESTful services and Swagger seems to fill a gap we have in this respect.
>
> Anybody ever tried working with Swagger to describe stuff you built with eXist-db? Anybody have any alternative way of offering a RESTful API for consumption? The neat thing about Swagger is that it could help people generating client code so I can concentrate on building just the server part for example. On the other hand: Swagger also supports generating server code, but I would not know where to leverage that part.
>
> Looking forward to insights.
>
> Regards
>
> Alexander Henket
> ------------------------------------------------------------------------------
> _______________________________________________
> Exist-open mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/exist-open
--
Peter Stadler
Carl-Maria-von-Weber-Gesamtausgabe
Arbeitsstelle Detmold
Hornsche Str. 39
D-32756 Detmold
Tel. +49 5231 975-676
Fax: +49 5231 975-668
stadler at weber-gesamtausgabe.de
www.weber-gesamtausgabe.de


------------------------------------------------------------------------------

_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open

signature.asc (465 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Describing a RESTful API using Swagger

Joe Wicentowski
Hi Alexander and Peter,

> Last week I came across Swagger. It seems like a useful way to describe and advertise an API that you build on eXist-db. We have many RESTful services and Swagger seems to fill a gap we have in this respect.
>
> Anybody ever tried working with Swagger to describe stuff you built with eXist-db? Anybody have any alternative way of offering a RESTful API for consumption? The neat thing about Swagger is that it could help people generating client code so I can concentrate on building just the server part for example. On the other hand: Swagger also supports generating server code, but I would not know where to leverage that part.

I haven't worked with Swagger, but I just wanted to add that I bet you
could rig up a generic RESTXQ-to-Swagger transformation.  RESTXQ's
annotations would probably give you everything you'd need to describe
the API, and the annotations can be pulled out with
rest:resource-functions() and inspect:inspect-function().  I don't
think this would be as feasible with a pure controller.xql approach.

Joe

------------------------------------------------------------------------------
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open