You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Although JSON format does not have a native way of outputting type ids, some other Jackson-supported formats do: for example, YAML does have format-level support for type ids.
Since ability to use native mechanisms is important, and since it is much harder for generators to try to reverse-engineer intent from calls, it would make more sense to add new methods to support this. Initial idea is to add:
boolean canWriteTypeId(): called at point where following value would have type id. Should return 'true' iff generator thinks this should be ok (it may or may not be possible to definitely say for some cases)
void writeTypeId(String id): may be called iff canWriteTypeId() returned true, and no other output methods have been called yet -- this may throw usual exceptions; but if no exception is thrown, assumption is that write succeeded and Jackson databind should NOT try other write methods
This mechanism is specifically added initially to support YAML type ids; other methods may be added later (if necessary) should other kinds of ids (numbers) are desired.
The text was updated successfully, but these errors were encountered:
Although JSON format does not have a native way of outputting type ids, some other Jackson-supported formats do: for example, YAML does have format-level support for type ids.
Since ability to use native mechanisms is important, and since it is much harder for generators to try to reverse-engineer intent from calls, it would make more sense to add new methods to support this. Initial idea is to add:
canWriteTypeId()
returned true, and no other output methods have been called yet -- this may throw usual exceptions; but if no exception is thrown, assumption is that write succeeded and Jackson databind should NOT try other write methodsThis mechanism is specifically added initially to support YAML type ids; other methods may be added later (if necessary) should other kinds of ids (numbers) are desired.
The text was updated successfully, but these errors were encountered: