Servant-routes: converting Servant APIs to term-level representations of routes and endpoints

Hi! I’m OSS-ing my first package on GitHub: servant-routes.

The core contribution of the package is to provide a clean, easy interface to convert Servant API types to term-level representations. You can think of it as being somewhere between servant-server’s layout and servant-openapi3’s HasOpenApi.

The HasRoutes class in Servant.API.Routes represents the mapping from type-level to term-level. It has instances for all the standard Servant combinators. The specific types used in the representation can be found in Servant.API.Routes.{Body,Header,Param,Path,Route}.

I’m not on the Hackage uploaders group yet, so for now the package exists only on GitHub. I’d be very grateful if anyone takes the time to check it out and maybe provide some feedback: whether it’s core idea, package + module layout, documentation, readibility, code quality, or anything else :slight_smile:

If, like me, you find it easier to read Haskell documentation on Hackage than GitHub, I think I need 2 members of the uploaders group to endorse me; then I believe I’ll be able to upload a package candidate. Like I said, this is my first time uploading, so I’d also appreciate any tips on the package upload process!

Once I can get some feedback and get to the package to the point where I’m happy uploading to Hackage, I’ll be excited to release v0.1.0.0 :slight_smile:

Thanks in advance to anyone who takes the time to read and give feedback.

fpringle

11 Likes

Nice work, and great motivation in the README!

I think you can still get an upload account directly from Hackage admins via Register a new account | Hackage, right?

Thanks @chreekat!
The email confirmation I got when I created a Hackage account said that I could either get 2 endorsements, or ask the trustees directly. I’ll give the later a go!

1 Like

servant-routes is now uploaded as a package candidate) on hackage: servant-routes: Generate route descriptions from Servant APIs

2 Likes