marcingolenia / mcode

Martin's Golenia software development blog.
https://mcode.it
0 stars 0 forks source link

https://mcode.it/blog/2021-12-24-minimal_apis_fsharp/?utterances=a3d606ec6ffb78a68f3810f5UOuwozIF3lA34TOfTefPKfFtWow%2FER7aWl48iXUHFxbbWR9vIB22EupkNXI1S%2Fj%2FRlFrXR0055u96uhQwvgbijxgHch1Kzwwi9ILaJ%2FAakPWiGc2xqCUINarKOk%3D #34

Open utterances-bot opened 1 year ago

utterances-bot commented 1 year ago

.NET 6 Minimal apis for F# devs, what we get? (including testing) | Blog

So with .NET 6 we have received loudly announced minimal apis. Well... I would name them normal APIs (I am looking 👀 on express.js ...) but let's put the sarcasm aside and lets see how it could improve API development for F# developers.

https://mcode.it/blog/2021-12-24-minimal_apis_fsharp/?utterances=a3d606ec6ffb78a68f3810f5UOuwozIF3lA34TOfTefPKfFtWow%2FER7aWl48iXUHFxbbWR9vIB22EupkNXI1S%2Fj%2FRlFrXR0055u96uhQwvgbijxgHch1Kzwwi9ILaJ%2FAakPWiGc2xqCUINarKOk%3D

jon-peel commented 1 year ago

Thank you for this post, the detail is helpful.
If there was a requirement to use Swagger, how would you go about adding this to the Giraffe API?

jon-peel commented 1 year ago

@Thorocaine - I didn't use swagger for many years. As far as I know this is still problematic; https://github.com/dotnet/fsharp/issues/14392 The question is what is the requirement? Is it really to use Swagger? Maybe documentation in another format is acceptable? If yes then one option is to create http files and play with them using this VSCode extension; https://marketplace.visualstudio.com/items?itemName=humao.rest-client. Consider the alternatives; Insomnia, Postman etc (more UI driven approach). The drawback with that approach is that its not hosted with You app.

If You really have to use Swagger You can always do it yourself (so You write the yaml files yourself). I think this is still a good option for small APIs.