capistrant commented on code in PR #18565:
URL: https://github.com/apache/druid/pull/18565#discussion_r2408348796
##########
processing/src/test/java/org/apache/druid/data/input/impl/DimensionSchemaTest.java:
##########
@@ -46,4 +47,26 @@ public void testStringDimensionSchemaSerde() throws Exception
OBJECT_MAPPER.readValue(OBJECT_MAPPER.writeValueAsString(schema2),
DimensionSchema.class)
);
}
+
+ @Test
+ public void testDeserializeStrictTypeId() throws Exception
+ {
+ final String invalidType =
"{\"type\":\"invalid\",\"name\":\"foo\",\"multiValueHandling\":\"ARRAY\",\"createBitmapIndex\":false}";
+ InvalidTypeIdException e = Assert.assertThrows(
+ InvalidTypeIdException.class,
+ () -> OBJECT_MAPPER.readValue(invalidType, DimensionSchema.class)
+ );
+ Assert.assertTrue(e.getMessage().contains(
+ "Could not resolve type id 'invalid' as a subtype of
`org.apache.druid.data.input.impl.DimensionSchema`: known type ids = [auto,
double, float, json, long, spatial, string]"));
Review Comment:
this seems like a decent suggestion. I'm not sure what precedent is in the
project for something like this. Do we just expect anyone who may change the
list to correct the text at that time?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]