acrites commented on code in PR #35597: URL: https://github.com/apache/beam/pull/35597#discussion_r2208216488
########## sdks/java/core/src/test/java/org/apache/beam/sdk/schemas/JsonSchemaConversionTest.java: ########## @@ -285,24 +288,36 @@ public void testArrayWithNestedRefsBeamSchema() throws IOException { String stringJsonSchema = new String(ByteStreams.toByteArray(inputStream), "UTF-8"); Schema parsedSchema = JsonUtils.beamSchemaFromJsonSchema(stringJsonSchema); - assertThat(parsedSchema.getFieldNames(), containsInAnyOrder("vegetables")); - assertThat( - parsedSchema.getFields().stream().map(Schema.Field::getType).collect(Collectors.toList()), - containsInAnyOrder( - Schema.FieldType.array( - Schema.FieldType.row( - Schema.of( - Schema.Field.of("veggieName", Schema.FieldType.STRING), - Schema.Field.of("veggieLike", Schema.FieldType.BOOLEAN), - Schema.Field.nullable( - "origin", - Schema.FieldType.row( - Schema.of( - Schema.Field.nullable("country", Schema.FieldType.STRING), - Schema.Field.nullable("town", Schema.FieldType.STRING), - Schema.Field.nullable( - "region", Schema.FieldType.STRING))))))) - .withNullable(true))); + assertEquals("vegetables", Iterables.getOnlyElement(parsedSchema.getFieldNames())); + Schema.Field field = parsedSchema.getField("vegetables"); + + // 2 out of 3 top-level fields are required, so ordering should be preserved on that level Review Comment: nit: comments should generally follow proper grammar, e.g. start with capital letters and end in punctuation. (Here and in the one below). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@beam.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org