Hello, I'm migrating a big spring5 project from jackson to fastjson2, and I'd like to ask how can I do the following:
- Specify, that
Map<String, MyClass> field's MyClass'es values must be serialized as a MyClass, not as any of it's inheritors. In jackson I can do @JsonSerialize(contentAs = MyClass.class)
- Pass a flag custom flag to JSONWriter when writing to it, that I can further check and if it's present I use custom serialization (for example, sometime I'd like to serialize
String password not as it's value, but as a *** when some flag was set to JSONWriter
Are there built-in ways to do it? If no, are there any workarounds?