Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swagger integration #115

Open
finlay opened this issue Apr 18, 2015 · 5 comments
Open

Swagger integration #115

finlay opened this issue Apr 18, 2015 · 5 comments

Comments

@finlay
Copy link

finlay commented Apr 18, 2015

Hi

We are building an API and would like to use the Haskell rest library. One requirement is to produce swagger style documentation and/or discovery service.

I notice there is a rest-discovery branch https://github.com/jcberentsen/rest/tree/rest-discovery, and wonder what the status of that is ? Perhaps I could contribute to that branch ?

Regards
Finlay

@bergmark
Copy link
Member

Hey,

That branch contains a new package that provides an api resource for discoverability. It works but is mostly a proof of concept, there is still work to be done before it would make sense to release it. It may have to be updated to be compatible with the latest versions of the other rest packages (nothing major, i think).

We are not working on this at the moment so if you want to help out that would be great!

I'm not familiar with Swagger but I'll try to answer any questions you have.

Cheers

@finlay
Copy link
Author

finlay commented Apr 24, 2015

Hi

Thanks for responding. I have a go at creating a swagger-consistent view of
a rest api.

Let you know how I get on!

Finlay

On Sun, 19 Apr 2015 at 08:39 Adam Bergmark [email protected] wrote:

Hey,

That branch contains a new package that provides an api resource for
discoverability. It works but is mostly a proof of concept, there is still
work to be done before it would make sense to release it. It may have to be
updated to be compatible with the latest versions of the other rest
packages (nothing major, i think).

We are not working on this at the moment so if you want to help out that
would be great!

I'm not familiar with Swagger but I'll try to answer any questions you
have.

Cheers


Reply to this email directly or view it on GitHub
#115 (comment).

@MaxDaten
Copy link
Contributor

@finlay I'm currently thinking about this, too. What is your current planned approach? Take a swagger specification and generate the rest-api or the other way around, take the rest api in Haskell and just provide the swagger discovery and documentation?

Swagger is for me a very concise rest spec and a good contract between api implementer and api user, even in the yaml format. I must admit, I would prefer writing the api spec in Swagger and let generate the necessary haskell backend skeleton. This would allow some nice opportunities: For example someone without Haskell skills (e.g. front-end dev) can read the spec and can make proposals via push-requests.

But I know, this is not easily done. But maybe this is the space to discuss different approaches.

@finlay
Copy link
Author

finlay commented Jul 22, 2015

Hi @MaxDaten

My intention was to produce swagger from the haskell rest api. However, I didn't get very far. Other things got in the way. Still interested in the general idea though.

I think that having a tool that generates a haskell skeleton from a swagger spec would be ideal. Then have it produce swagger spec from the haskell as well to confirm that it has worked.

I got a bit delayed with the swagger specification. Should be easy enough though to write a swagger parser that produces a haskell data structure. From that generate a haskell module.

What do you think ?

F

@superduper
Copy link

Hi there!
Are you guys familiar of https://github.com/twittner/swagger? I think some TemplateHaskell voodoo could help generate code for silkapp/rest or other rest libraries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants