Vogen icon indicating copy to clipboard operation
Vogen copied to clipboard

ServiceStack.Text framework not supported

Open arteny opened this issue 2 years ago • 4 comments

Describe the feature

Pls add it's support for serialization. Strings deserialized as null now.

arteny avatar Dec 13 '23 09:12 arteny

Hi - thanks for the feedback - I'll take a look at this when time permits.

SteveDunn avatar Dec 17 '23 09:12 SteveDunn

Hi - thanks for the feedback - I'll take a look at this when time permits.

Waiting too much for this. Now it is deserializing as "[UNINITIALIZED]" when it is a property of object

arteny avatar Feb 01 '24 22:02 arteny

btw I found workaround adding this method to all of my ValueObject's: public static MyValueObject Parse(string value) => From(value);

arteny avatar Feb 01 '24 23:02 arteny

I'm glad you've found a workaround. Apologies for the delay in fixing this.

SteveDunn avatar Feb 04 '24 09:02 SteveDunn

Hi @arteny - could you check the latest version of Vogen? It should fix this issue as it now generates Parse itself

SteveDunn avatar Apr 20 '24 07:04 SteveDunn

@arteny - I just checked myself. It seems that primitive numers such as int etc. are support, however, string is not. I think I need to generate a static constructor whose body is JsConfig<Name>.DeSerializeFn = Name.From;

SteveDunn avatar Apr 20 '24 07:04 SteveDunn

It looks like it calls any method that is public static X Parse(string s). This works, by default, with types like int because they already have that method and it is hoisted up to the wrapper.

I'll add another entry to the Conversions attribute to allow for ServiceStack.Text. When it is set, Vogen will generate the method above. Will hopefully have something shortly.

SteveDunn avatar Apr 21 '24 07:04 SteveDunn

This has now been implemented and will be in the next release.

SteveDunn avatar Apr 24 '24 21:04 SteveDunn