Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

null type id handling does not work with writeTypePrefix() #4407

Open
cowtowncoder opened this issue Mar 2, 2024 · 0 comments
Open

null type id handling does not work with writeTypePrefix() #4407

cowtowncoder opened this issue Mar 2, 2024 · 0 comments
Labels

Comments

@cowtowncoder
Copy link
Member

Describe your Issue

(note: regression partly due to #3373, reported f.ex as #4354 (but not just that))

So: if custom TypeIdResolver returns null from idFromValue() or idFromValueAndType(), result is that underlying JsonGenerator.writeTypePrefix() call is omitted. This may work for some cases, but won't for others, because necessary parts of structure are missing.

Conceptually the idea would be that null for Type Id means "do not add Type Id", but doing so cannot be done by simply skipping calls to JsonGenerators writeTypePrefix() and writeTypeSuffix(): rather, calls need to be made but these methods need to be aware of possibly missing type id and output whatever else is necessary.

@cowtowncoder cowtowncoder added to-evaluate Issue that has been received but not yet evaluated 2.18 and removed to-evaluate Issue that has been received but not yet evaluated labels Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant