-
Notifications
You must be signed in to change notification settings - Fork 3
JSTEP 7
(Back to JSTEP page)
Related change issues: JSTEP-3 contains/-ed aspects of JsonNodeFeature
Tatu Saloranta (@cowtowncoder)
- 2022-01-16: The first draft version
Over time, various XxxFeature on/off options have proven useful and popular with developers: they are easy to set, change and (for the most part), understand.
Original set of "Features" were configurable at Streaming API and Databind level, including:
-
JsonParser.Feature/JsonGenerator.Feature/JsonFactory.Featurefor Streaming API -
MapperFeature/SerializationFeature/DeserializationFeaturefor databind
and for Streaming API, further split of format-specific (often JSON-specific) vs. generic (across all or most formats) features, resulted in:
-
JsonParser.Featuresplit into genericStreamReadFeatureandXxxReadFeature(likeJsonReadFeature) -
JsonGenerator.Featuresplit into genericStreamWriteFeatureandXxxWriteFeature(likeJsonWriteFeature).
But while this split allowed better support for Format-specific features (via Streaming API), there is no similar mechanism for more granular configuration for datatype-specific features. This has lead to inclusion of some "too [datatype] specific" features at databind level; for example:
DeserializationFeature.READ_ENUMS_USING_TO_STRINGDeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDSSerializationFeature.WRITE_DATES_AS_TIMESTAMPS
Such configuration is against the idea that these Features should be cross-cutting across dataformats AND datatypes. But it is worth noting that there is need for such configuration, at some other granularity. This lead to the idea of "datatype-specific" features.