Your REST API Errors Are Wrong. Problem Details Will Fix This

  Рет қаралды 14,081

Milan Jovanović

Milan Jovanović

Күн бұрын

Пікірлер: 42
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
Want to master Clean Architecture? Go here: bit.ly/3PupkOJ Want to unlock Modular Monoliths? Go here: bit.ly/3SXlzSt
@paulmdevenney
@paulmdevenney Ай бұрын
dude - your timing is impeccable. I was just tidying up my version of the same thing. Took some notes, made some refinements. Thanks as always.
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
Nice, happy to help!
@enricoroselino7557
@enricoroselino7557 Ай бұрын
if girlfriend also have problem details, men doesnt need to think hard
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
You're screwed either way 😅
@ghoulking715
@ghoulking715 Ай бұрын
we are waiting for the continuation of the series about authorization via keycloak and setting up user roles and attributes 😊
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
Working on it
@fakhrulhilal
@fakhrulhilal Ай бұрын
I've been using Seq for logging for years, but I never realize we can use it for telemetry. Nice video as always.
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
Tracing is a new feature
@unknown.artist.track3
@unknown.artist.track3 Ай бұрын
you are so cool explainer. I'm ready to listen you all the time long)
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
Thank you!
@JuanOG
@JuanOG Ай бұрын
How about using the hellang problem details package which seems to do this all well enough.
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
Prefer not to use 3rd party packages for simple things
@androidsavior
@androidsavior Ай бұрын
Where request it and trace it are stored in the server ? Where are the logs
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
They're managed during the HTTP request (Activity), and they can be part of structured logs. Typically you will export this to a third-party monitoring tool
@10Totti
@10Totti Ай бұрын
Best tutorial! But Service ProblemDetails is add with .net 9 ?
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
No, it's there from way before
@luisnataren4149
@luisnataren4149 Ай бұрын
Hey Milan, do you know when the REST API course will be ready?
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
January
@ivansusic562
@ivansusic562 Ай бұрын
A kinda offtopic, but - I faced issue with postgres, ef migrations and docker compose - api was trying to do a migration on startup before postgres was ready. Do you have any suggestions here? Btw., great video. I just bought one of your courses - looking forward.
@JollyGiant19
@JollyGiant19 Ай бұрын
Don’t run migrations on start up, run them outside the application. EF Core gives you a few ways to do that: script or binary.
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
Use "depends_on" to tell the API container to wait for the DB
@ivansusic562
@ivansusic562 Ай бұрын
@@MilanJovanovicTech I think I tried it - but it does not meen that postgres is ready if its container is up and running.
@dinulilea4184
@dinulilea4184 Ай бұрын
Had the same issue with sqlx and postgres (rust project) where it tried to run queries at compile time before the posgres db was ready. Turns out there was an SQLX_OFFLINE env var that could be configured for docker compose. Maybe there is something similar with EF Cofe
@Crisicus_01
@Crisicus_01 Ай бұрын
@@ivansusic562You can add health checks to see if the container is actually ready
@sotsch9280
@sotsch9280 Ай бұрын
How do you handle Results using the Result pattern? First naive thoughts would be simply using a middleware and checking for failed results?... I mainly use Results instead of throwing, except for Domain objects like ValueObjects, they throw if validation fails
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
if (Failure) - > return Result converted to Problem Details
@sotsch9280
@sotsch9280 Ай бұрын
@MilanJovanovicTech sorry, I meant not the mapping part, i meant how to handle that globally like with global exception handling. I thought you must have encountered this problem. Or am I missthinking this?
@MahbuburRahman-uc7np
@MahbuburRahman-uc7np Ай бұрын
How are you showing inline values during debug in Visual Studio?
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
ReSharper
@jeancarlosreyesencarnacion
@jeancarlosreyesencarnacion Ай бұрын
I know it's gonna be good. 🙌🙌
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
Was it?
@jeancarlosreyesencarnacion
@jeancarlosreyesencarnacion Ай бұрын
@MilanJovanovicTech Yes, it was. 🤙
@emanuelcordovamontiel1017
@emanuelcordovamontiel1017 Ай бұрын
Thank a lots, Milan!. Where can I found the source code of this solution?
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
Here: www.patreon.com/milanjovanovic
@cuserroro
@cuserroro Ай бұрын
I realy like!!
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
Thanks
@Tldr205
@Tldr205 Ай бұрын
How are you gonna handling the difference between public and internal api? I don't think we won't to expose this much data in our public? Just modify the problem details to include less?
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
Yep, obfuscate the response
@lolyasuo1235
@lolyasuo1235 Ай бұрын
How something that is fully opinionated can be wrong? Both approaches are just fine. I am sorry to say this, but I miss old era where developers were thinking about a solution. Today in many cases we are simply following guidelines (use ProblemDetails, use Result etc).
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
You didn't explain how it can be wrong
Exceptions Are Extremely Expensive… Do This Instead
17:15
Milan Jovanović
Рет қаралды 51 М.
Вопрос Ребром - Джиган
43:52
Gazgolder
Рет қаралды 3,8 МЛН
Jaidarman TOP / Жоғары лига-2023 / Жекпе-жек 1-ТУР / 1-топ
1:30:54
GIANT Gummy Worm #shorts
0:42
Mr DegrEE
Рет қаралды 152 МЛН
The Right Way To Build Async APIs in ASP.NET Core
20:12
Milan Jovanović
Рет қаралды 27 М.
Stop Calling Your API a "REST API"
17:42
Amichai Mantinband
Рет қаралды 18 М.
Event Sourcing for .NET Developers: From Zero to Implementation
19:55
Milan Jovanović
Рет қаралды 11 М.
My FAVORITE Error Handling Technique
16:01
ArjanCodes
Рет қаралды 47 М.
Which API Gateway is better? YARP vs Ocelot
24:01
Milan Jovanović
Рет қаралды 8 М.
The Fix For Your Database Performance Issues in .NET
9:12
Nick Chapsas
Рет қаралды 90 М.
Forget Controllers and Minimal APIs in .NET!
14:07
Nick Chapsas
Рет қаралды 81 М.
The Right Way To Use Feature Flags in .NET (targeting users explained)
17:44
Getting Started with Modular Monoliths in .NET
12:37
Milan Jovanović
Рет қаралды 29 М.
Вопрос Ребром - Джиган
43:52
Gazgolder
Рет қаралды 3,8 МЛН