Skip to content

fix: accept empty arrays as null in Jackson deserialization#8

Open
pheizx wants to merge 1 commit into
FacturAPI:mainfrom
pheizx:main
Open

fix: accept empty arrays as null in Jackson deserialization#8
pheizx wants to merge 1 commit into
FacturAPI:mainfrom
pheizx:main

Conversation

@pheizx

@pheizx pheizx commented Jul 7, 2026

Copy link
Copy Markdown

Issue:

Cannot deserialize value of type `java.lang.String` from Array value (token `JsonToken.START_ARRAY`) at [Source: UNKNOWN; byte offset: #UNKNOWN] (through reference chain: io.facturapi.models.SearchResult["data"]->java.util.ArrayList[0]->io.facturapi.models.Invoice["items"]->java.util.ArrayList[0]->io.facturapi.models.InvoiceItem["property_tax_account"])

Fix:

This change handles an API response inconsistency where a field expected as a String can arrive as an empty array ([]).
Without this setting, Jackson throws a deserialization error for paths like InvoiceItem.property_tax_account.
By enabling DeserializationFeature.ACCEPT_EMPTY_ARRAY_AS_NULL_OBJECT, empty arrays are treated as null, preventing runtime parsing failures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant