rivantsov / vita

VITA Application Framework
MIT License
59 stars 15 forks source link

[Vita.Module.Login] Adding get set on the DataObject #115

Closed jasonlaw closed 4 years ago

jasonlaw commented 4 years ago

Hi @rivantsov ,

When using Swagger document to render the API, the DataObject's attribute without get set will not be rendered out in the object schema, please refer to issue #113 where I have encountered the problem.

Can I request to have all the Data Object attributes coded with get set?

Thank you!

Jason Law

rivantsov commented 4 years ago

I will add it, no problem, but I suspect there's something more here. In general, it would be nice if swagger (swashbuckle?) worked with fields as well as properties. I thought there might be some config setting that enables it. Did not find it yet, but there's one setting that I think is related. Here: https://github.com/domaindrivendev/Swashbuckle.AspNetCore/blob/master/README.md#systemtextjson-stj-vs-newtonsoft

about default json serializer. I believe I ran into this before, that ASP.NET-core uses this new shitty system.Text.Json serializer, which does NOT render fields, just does not see them. So I think it might be the cause here. Try switching the serializer type to Newtonsoft, and see if it helps:

services.AddSwaggerGenNewtonsoftSupport()

jasonlaw commented 4 years ago

Hi @rivantsov ,

Thanks for looking into this, and yes it is swashbuckle. It works now by switching to Newtonsoft. :) Thank you very much!

Jason Law

rivantsov commented 4 years ago

I decided to leave objects as is, since the problem was not them