Skip to content

Commit 8315c59

Browse files
committed
Merge branch '2.19'
2 parents 4991002 + 525dc30 commit 8315c59

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

avro/src/main/java/tools/jackson/dataformat/avro/schema/AvroSchemaGenerator.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
* An instance is typically given to
99
* {@link tools.jackson.databind.ObjectMapper#acceptJsonFormatVisitor}
1010
* which will invoke necessary callbacks.
11+
*<p>
12+
* For default configuration of things like "Logical Types support", see Javadocs
13+
* of {@link VisitorFormatWrapperImpl}.
1114
*/
1215
public class AvroSchemaGenerator extends VisitorFormatWrapperImpl
1316
{

avro/src/main/java/tools/jackson/dataformat/avro/schema/VisitorFormatWrapperImpl.java

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,25 @@
1515
public class VisitorFormatWrapperImpl
1616
implements JsonFormatVisitorWrapper
1717
{
18+
/**
19+
* Default value for {@link #_logicalTypesEnabled}: {@code false} will be changed to
20+
* {@code true} in 3.0.
21+
*/
22+
public static final boolean DEFAULT_LOGICAL_TYPES_ENABLED = false;
23+
24+
/**
25+
* Default value for {@link #_writeEnumAsString}: {@code false} as of
26+
* Jackson 2.19 and later.
27+
*/
28+
public static final boolean DEFAULT_ENUM_AS_STRING = false;
29+
1830
protected SerializationContext _context;
1931

2032
protected final DefinedSchemas _schemas;
2133

22-
protected boolean _logicalTypesEnabled = false;
34+
protected boolean _logicalTypesEnabled = DEFAULT_LOGICAL_TYPES_ENABLED;
2335

24-
protected boolean _writeEnumAsString = false;
36+
protected boolean _writeEnumAsString = DEFAULT_ENUM_AS_STRING;
2537

2638
/**
2739
* Visitor used for resolving actual Schema, if structured type
@@ -45,11 +57,11 @@ public VisitorFormatWrapperImpl(DefinedSchemas schemas, SerializationContext ctx
4557
_context = ctxt;
4658
}
4759

48-
4960
protected VisitorFormatWrapperImpl(VisitorFormatWrapperImpl src) {
5061
this._schemas = src._schemas;
5162
this._context = src._context;
5263
this._logicalTypesEnabled = src._logicalTypesEnabled;
64+
this._writeEnumAsString = src._writeEnumAsString;
5365
}
5466

5567
/**

0 commit comments

Comments
 (0)