Is your feature request related to a problem? Please describe.
If the return type of an api route is an interface the serializer/JSON string doesn't account for exposed properties and it sends the whole object.
Describe the solution you'd like
It would be nice to serialize only the the exposed properties of the interface.
Describe alternatives you've considered
If you serialize as IVerboseUserData with the new System.Text.Json Serializer you get only the exposed props of the interface but this adds boilerplate.
Additional context
For example given the following structure:
public class StoredUserData : IVerboseUserData {
public string Username { get; set; } = "examplename";
public string Password { get; set; }
}
public interface IVerboseUserData {
public string Username { get; set; }
}
And the route
[Route(HttpVerbs.Post, "/self")]
public async Task<IVerboseUserData> GetSelfUser ()
Unfortunately this is not the right place to open an issue about the JSON serializer used by EmbedIO. Please follow this link to file a bug report to the SWAN library.
Is your feature request related to a problem? Please describe. If the return type of an api route is an interface the serializer/JSON string doesn't account for exposed properties and it sends the whole object.
Describe the solution you'd like It would be nice to serialize only the the exposed properties of the interface.
Describe alternatives you've considered If you serialize as
IVerboseUserData
with the new System.Text.Json Serializer you get only the exposed props of the interface but this adds boilerplate.Additional context
For example given the following structure:
And the route
Should only return