Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

Nuget Package is causing API Validation Errors

$
0
0

I have a project that is separated into three layers:

  • An API, which sends MediatR queries and commands to the application layer.
  • A class library of application logic that uses fluent validation.
  • A class library of domain objects.

Originally the domain objects class library was locally referenced by the application layer, which was then referenced by the API layer.

Domain > Application > API

Recently, I moved the domain layer to a Nuget Package, so that it can be used by other projects as well as this one. However, since moving it I'm getting 400 Bad request validation errors when sending requests to my API.

{"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1","title" : "One or more validation errors occurred.","status" : 400,"traceId" : <Guid>,"errors" : {"Id" :["'Id' must not be empty.",        ],"Events": ["The events field is required."         ]  }}

Does anybody have any idea how to fix this?

I have tried taking out fluent validation and I've tried switching back to the local project where the problem goes away. As far as I can tell, the NugetPackage version and the local version are identical. All projects are using dotnet 6.0.

Regards, Adam


Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>