Skip to content

Fix array serialization handling in ValidatorUtils.getValueAsString()#381

Open
sahvx655-wq wants to merge 2 commits into
apache:masterfrom
sahvx655-wq:validator-utils-array-serialization
Open

Fix array serialization handling in ValidatorUtils.getValueAsString()#381
sahvx655-wq wants to merge 2 commits into
apache:masterfrom
sahvx655-wq:validator-utils-array-serialization

Conversation

@sahvx655-wq
Copy link
Copy Markdown
Contributor

This PR fixes incorrect serialization behavior in ValidatorUtils.getValueAsString() for String[] values. Previously, arrays were converted using the default Object.toString() implementation, resulting in non-readable JVM identity strings.
When a String[] was passed to getValueAsString(), the output appeared as:
text
[Ljava.lang.String;@1a2b3c

This occurs because Java arrays do not override toString().

Updated array handling to use:
java
java.util.Arrays.toString((String[]) value)

This produces consistent and human-readable output:
text
[element1, element2, element3]

@sahvx655-wq sahvx655-wq changed the title Validator utils array serialization Fix array serialization handling in ValidatorUtils.getValueAsString() Jun 3, 2026
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