When querying the App Services as an API call, the return object looks like this:
{ "result": { -The serialized POCO object Swagger is advertising- }, "targetUrl": string, "success": bool, "error": string, "unAuthorizedRequest": bool, "__abp": bool }
While it's easy enough to unwrap the object once you know what to expect, unfortunately the auto-generated client code created by the Swagger/NSwag tool creates code which is broken because it is not expecting the wrapper. This means if I regenerate the client code I need to go through it fixing the deserialisation routines again.
Can we somehow tell Swagger to include the wrapper object in its advertised schema? This would mean the generated code would automatically have the correct objects to deserialise correctly (It would also mean Swagger reports its schema truthfully, which seems desirable).
2 Answer(s)
-
1
If you use Zero Angular, it will automatically handle the situation you mentioned using abp-ng2-module
see https://github.com/aspnetboilerplate/aspnetboilerplate/issues/2637
-
0
Perfect! Thank you.
Angular wasn't what I needed - I'm creating a data transfer client, not a UI. But in the article you linked to, this was precisely what I hoped for:
AbpAspNetCore().DefaultWrapResultAttribute.WrapOnSuccess = false;