From 473f8446d97e039829099e4443ca03b7671d057a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Pupier?= Date: Fri, 5 Jan 2024 10:51:43 +0100 Subject: [PATCH] Use valid schema related to null default based on specification in RecordEvolutionTest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit during investigation upgrading Avro to 1.9+, the test was failing. the code has enforced the rule from the specification that `when a default value is specified for a record field whose type is a union, the type of the default value must match the first element of the union. Thus, for unions containing "null", the "null" is usually listed first, since the default value of such unions is typically null.` it was part of specification in 1.8 already https://avro.apache.org/docs/1.8.0/spec.html#Unions , just not enforced in the codebase. relates to #167 Signed-off-by: Aurélien Pupier --- .../jackson/dataformat/avro/schemaev/RecordEvolutionTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/avro/src/test/java/com/fasterxml/jackson/dataformat/avro/schemaev/RecordEvolutionTest.java b/avro/src/test/java/com/fasterxml/jackson/dataformat/avro/schemaev/RecordEvolutionTest.java index 75a69d768..3e683372f 100644 --- a/avro/src/test/java/com/fasterxml/jackson/dataformat/avro/schemaev/RecordEvolutionTest.java +++ b/avro/src/test/java/com/fasterxml/jackson/dataformat/avro/schemaev/RecordEvolutionTest.java @@ -17,7 +17,7 @@ public class RecordEvolutionTest extends AvroTestBase + " \"fields\": [\n" + " {\n" + " \"name\": \"name\",\n" - + " \"type\": [\"string\", \"null\"],\n" + + " \"type\": [\"null\", \"string\"],\n" + " \"default\": null\n" + " },\n" + " {\n" @@ -39,7 +39,7 @@ public class RecordEvolutionTest extends AvroTestBase + " \"fields\": [\n" + " {\n" + " \"name\": \"fullName\",\n" - + " \"type\": [\"string\", \"null\"],\n" + + " \"type\": [\"null\", \"string\"],\n" + " \"default\": null,\n" + " \"aliases\": [\"name\"]\n" + " },\n"