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
Unfortunately, the entire HTTP mapping layer depends on the DTO having the new() generic constraint and all properties being nullable.
The new() generic constraint issue could be circumvented with Activator.CreateInstance<T>(), though not without hurting efficiency. Otherwise we'd need to overhaul the implementation to have every property value ready when the DTO is initialized.
Another difficult case is when a response supports multiple HTTP status codes. A normal body field can be required, but only if the normal status code is used. I suppose we could just skip required/non-nullable in that somewhat rare case.
One more difficulty is that we use the DTO as the JSON request/response body, even if some of the fields are set via path/query/header. Maybe we'd need to codegen an internal DTO with just the body fields.
This could be a breaking change to older client code for the same API, so it might need to be opt-in.
The text was updated successfully, but these errors were encountered: