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
Hi, I'm trying out the new source-generated validation for Minimal APIs. It's encouraging to see development in this area! 🚀
The solution I'm working on have a lot of Minimal API endpoints across multiple modules. Each module is a dedicated C# project. This helps keep the API endpoints close to the related code and organised. The modules are referenced by a "host" project configuring shared concerns such as logging and authentication... and now the AddValidation() method call too.
graph TD
Host-->A[Module A]
Host-->B[Module A]
Loading
All API endpoints in the Host project is discovered by without any problems. But the endpoints in either Module A or Module B isn't 😢
Is this a known limitation, or possibly a bug?
A possible workaround:
Repeating the AddValidation() method call in each module and adding the <InterceptorsNamespaces>$(InterceptorsNamespaces);Microsoft.AspNetCore.Http.Validation.Generated</InterceptorsNamespaces> property to the .csproj works.
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
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm trying out the new source-generated validation for Minimal APIs. It's encouraging to see development in this area! 🚀
The solution I'm working on have a lot of Minimal API endpoints across multiple modules. Each module is a dedicated C# project. This helps keep the API endpoints close to the related code and organised. The modules are referenced by a "host" project configuring shared concerns such as logging and authentication... and now the
AddValidation()
method call too.All API endpoints in the
Host
project is discovered by without any problems. But the endpoints in eitherModule A
orModule B
isn't 😢Is this a known limitation, or possibly a bug?
A possible workaround:
Repeating the
AddValidation()
method call in each module and adding the<InterceptorsNamespaces>$(InterceptorsNamespaces);Microsoft.AspNetCore.Http.Validation.Generated</InterceptorsNamespaces>
property to the.csproj
works.Beta Was this translation helpful? Give feedback.
All reactions