REST request macro

Hey there,

I recently had an idea to create a REST request macro that would be as simple to use as SwiftData. However, since I’ve never worked with Swift Macros before, I’m looking for some tips on how to get started and approach this project. I already have some ideas, but I’m concerned that they may not work. Additionally, I’d like to make the macro mockable for testing purposes.

Does anyone have any suggestions for me?

1 Like

Have you seen GitHub - dankinsoid/swift-api-client: Comprehensive and modular Swift library for API design. ?

And: GitHub - ailtonvivaz/swift-request
?

1 Like

Thanks, @Sajjon. I’ve already seen the second one.

They look appealing, but not in the direction I envision. I’d like to implement requests with the simplicity of using SwiftData in SwiftUI. I would like to directly call “@HTTPQuery var posts: [Post]” within a SwiftUI view. However, I’m still missing the overall picture, especially for mocking purposes.