You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My team have recently discovered NSwag. It's a great tool and thank you to @RicoSuter.
We are having a debate within the team on where to use this interface. We're losely following Onion/Clean Architecture and I'm proposing that we do not use this interface in the domain/core layer as that layer shouldn't really care about ApiException or HTTP return codes.
I'm proposing we use the interface in specific abstractions. Abstractions that turn ApiException into CustomDomainException, or other HTTP specific exceptions into exceptions that are meaningful in our layers.
What are your thoughts? Do you use these generated interfaces everywhere? Do you generate the interfaces based on all endpoints of an API, or just for specific endpoints?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
My team have recently discovered NSwag. It's a great tool and thank you to @RicoSuter.
We are having a debate within the team on where to use this interface. We're losely following Onion/Clean Architecture and I'm proposing that we do not use this interface in the domain/core layer as that layer shouldn't really care about
ApiException
or HTTP return codes.I'm proposing we use the interface in specific abstractions. Abstractions that turn
ApiException
intoCustomDomainException
, or other HTTP specific exceptions into exceptions that are meaningful in our layers.What are your thoughts? Do you use these generated interfaces everywhere? Do you generate the interfaces based on all endpoints of an API, or just for specific endpoints?
Beta Was this translation helpful? Give feedback.
All reactions