ThreeDotsLabs / wild-workouts-go-ddd-example

Go DDD example application. Complete project to show how to apply DDD, Clean Architecture, and CQRS by practical refactoring.
https://threedots.tech
MIT License
5.04k stars 464 forks source link

Why OpenAPI? #26

Open jcorry opened 3 years ago

jcorry commented 3 years ago

I'm curious what motivated openAPI and it's code generator?

It seems like all of the functionality provided there could be delivered by:

I am a fan of grpc-web for consuming gRPC services with a Vue client, but realize a REST analog is often useful too.

It seems like it would be simpler and with less overhead to use tools from within the same gRPC ecosystem.

I am really enjoying the book! Thank you so much for publishing all of this!

m110 commented 3 years ago

Hey @jcorry!

The reason is simply we didn't use gRPC this way yet. The gRPC gateway seems to totally make sense for the kind of communication we've created. On the other hand, REST is very popular for frontend/backend communication, and we wanted to base Wild Workouts on technologies everyone is familiar with.

We might introduce it in the future to simplify the API, but first we'll be focusing on more strategic patterns. Thanks a lot for bringing it up and I'm glad you liked the book! :)

m110 commented 3 years ago

Actually, adding gRPC gateway would be a great example of how Clean Architecture enables such changes. In Wild Workouts, it would be just extending the ports layer. :)