schemaType of LongSerializer is wrong · Issue #3742 · FasterXML/jackson-databind (original) (raw)

Describe the bug
The schemaType of LongSerializer and ShortSerializer should be integer instead of number.
https://github.com/FasterXML/jackson-databind/blob/2.15/src/main/java/com/fasterxml/jackson/databind/ser/std/NumberSerializers.java#L188-L190

Version information
2.x

To Reproduce

ObjectMapper mapper = new ObjectMapper(); JsonSchema jsonSchema = mapper.generateJsonSchema(Long.class); System.out.println(mapper.writeValueAsString(jsonSchema)); // stdout: {"type":"number"}

Expected behavior

  1. Do you think we should fix it up? change the schemaType of LongSerializer and ShortSerializer from number to integer.
  2. I notice the interface SchemaAware is removed in 3.x , but the latest release is still 2.x . New developers may still override methods of SchemaAware. I think interface SchemaAware should be marked with @Deprecated.