joshuawright11 / papyrus

A type-safe HTTP client for Swift.
MIT License
289 stars 24 forks source link

Support for Vapor? #57

Open lmcd opened 6 months ago

lmcd commented 6 months ago

I'm working on a Swift project that has a server side, and client side. I'd like to unify the definition of endpoints across both builds.

Something like this would be very useful:

let routesBuilder = ...
let provider = Provider(baseURL: "https://api.example.com/")
let users: Users = UsersAPI(provider: provider)

routesBuilder.addRoutes(from: users)
joshuawright11 commented 6 months ago

Excellent idea - this is actually in progress. Hoping to have an MVP up soon.

Will keep you posted!

lmcd commented 6 months ago

Great to hear! I have a feeling my needs my slightly differ from whatever the base implementation is, so would be very useful to have a means of accessing an array of path components (edit: any HTTP method) for each route, so I can process them manually.

joshuawright11 commented 6 months ago

How do you think your needs might differ? I can try and work something specific in.