C#
C#

help

Root Question Message

SylveonDeko
SylveonDeko11/17/2022
❔ parse a single json property differently

So i have an existing json model that i cannot retire because some users already use it. I want to be able to parse a single property inside that json model 2 ways, the old way and the new way. how would i do that? Property and model in question: https://github.com/Pusheon/Mewdeko/blob/main/src/Mewdeko/Common/NewEmbed.cs#L70
Angius
Angius11/17/2022
STJ or Newtonsoft?
SylveonDeko
SylveonDeko11/17/2022
newtonsoft
SylveonDeko
SylveonDeko11/17/2022
i may switch to stj tho, people say its better
Angius
Angius11/17/2022
Faster for sure
Angius
Angius11/17/2022
And it's not a 3rd party dependency
Angius
Angius11/17/2022
That said, for Newtonsoft, you can define a custom serializer for a single property: https://www.newtonsoft.com/json/help/html/T_Newtonsoft_Json_JsonConverterAttribute.htm
SylveonDeko
SylveonDeko11/17/2022
unfortunately i cant dodge that last point sincce the lib im using includes it anyway
SylveonDeko
SylveonDeko11/17/2022
hmm
SylveonDeko
SylveonDeko11/17/2022
i just realized its a lot more complicated lol
SylveonDeko
SylveonDeko11/17/2022
since the Components property will be severely different
SylveonDeko
SylveonDeko11/17/2022
hmm
Message Not Public

Sign In and Join Server To See

11/21/2022
ContactFrequently Asked QuestionsJoin The DiscordBugs & Feature RequestsTerms & Privacy