Have ServiceStack treatEmpty String rather than null  Topic is solved

Discussions relating to the REST API of Jiwa 7.

Have ServiceStack treatEmpty String rather than null

Postby SBarnes » Tue Sep 04, 2018 2:53 pm

Hi Mike

I am getting a situation with ServiceStack using JsonServiceClient where it is passing a custom DTO where a string property is being set to an empty string ("") but when it deserializes it in the API its being set to null I have tried JsConfig.IncludeNullValues but this makes no difference, any ideas?
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1617
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: Have ServiceStack treatEmpty String rather than null

Postby Scott.Pearce » Wed Nov 21, 2018 8:52 am

Sorry, can't figure this one out. Try asking over at https://forums.servicestack.net/
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 742
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 221

Re: Have ServiceStack treatEmpty String rather than null  Topic is solved

Postby SBarnes » Wed Nov 21, 2018 5:03 pm

Hi Scott

Solved in by having the constructor set the property to an empty string

Thanks for the help.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1617
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175


Return to REST API

Who is online

Users browsing this forum: No registered users and 1 guest

cron