TASVideos / tasvideos

The code for the live TASVideos website
https://tasvideos.org/
GNU General Public License v3.0
63 stars 29 forks source link

Convert API from Controllers to Minimal APIs approach, resolves #992 #1812

Closed adelikat closed 2 months ago

adelikat commented 2 months ago

This is a more modern approach to APIs for .NET apps. There are cons to this, but there are also pros, I think overall this is better for TASVideos.

Pros: More control over error handling, this resolves #992 It's "faster" according to Microsoft, though I don't think we have high enough volume for it to matter Controllers are a shoe-horned approach to APIs, and may be harder to understand how to put together endpoints, if you are new to .NET

Cons: Less freebies, we have to have a solution for documentation, model validation, error handling. But this is also a pro, because it gives us more control and we do not need to worry about being pained into a corner depending on what we need

Worst case this is just another way to do the same thing and all this work was questionable.