diff --git a/avro/src/main/java/tools/jackson/dataformat/avro/schema/AvroSchemaGenerator.java b/avro/src/main/java/tools/jackson/dataformat/avro/schema/AvroSchemaGenerator.java index 2844d5a1a..a5032edcf 100644 --- a/avro/src/main/java/tools/jackson/dataformat/avro/schema/AvroSchemaGenerator.java +++ b/avro/src/main/java/tools/jackson/dataformat/avro/schema/AvroSchemaGenerator.java @@ -8,6 +8,9 @@ * An instance is typically given to * {@link tools.jackson.databind.ObjectMapper#acceptJsonFormatVisitor} * which will invoke necessary callbacks. + *

+ * For default configuration of things like "Logical Types support", see Javadocs + * of {@link VisitorFormatWrapperImpl}. */ public class AvroSchemaGenerator extends VisitorFormatWrapperImpl { diff --git a/avro/src/main/java/tools/jackson/dataformat/avro/schema/VisitorFormatWrapperImpl.java b/avro/src/main/java/tools/jackson/dataformat/avro/schema/VisitorFormatWrapperImpl.java index 8b8ef6325..e574bcf0b 100644 --- a/avro/src/main/java/tools/jackson/dataformat/avro/schema/VisitorFormatWrapperImpl.java +++ b/avro/src/main/java/tools/jackson/dataformat/avro/schema/VisitorFormatWrapperImpl.java @@ -15,13 +15,25 @@ public class VisitorFormatWrapperImpl implements JsonFormatVisitorWrapper { + /** + * Default value for {@link #_logicalTypesEnabled}: {@code false} will be changed to + * {@code true} in 3.0. + */ + public static final boolean DEFAULT_LOGICAL_TYPES_ENABLED = false; + + /** + * Default value for {@link #_writeEnumAsString}: {@code false} as of + * Jackson 2.19 and later. + */ + public static final boolean DEFAULT_ENUM_AS_STRING = false; + protected SerializationContext _context; protected final DefinedSchemas _schemas; - protected boolean _logicalTypesEnabled = false; + protected boolean _logicalTypesEnabled = DEFAULT_LOGICAL_TYPES_ENABLED; - protected boolean _writeEnumAsString = false; + protected boolean _writeEnumAsString = DEFAULT_ENUM_AS_STRING; /** * Visitor used for resolving actual Schema, if structured type @@ -45,11 +57,11 @@ public VisitorFormatWrapperImpl(DefinedSchemas schemas, SerializationContext ctx _context = ctxt; } - protected VisitorFormatWrapperImpl(VisitorFormatWrapperImpl src) { this._schemas = src._schemas; this._context = src._context; this._logicalTypesEnabled = src._logicalTypesEnabled; + this._writeEnumAsString = src._writeEnumAsString; } /**