Skip to content

Commit

Permalink
Merge branch '2.19'
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Jan 5, 2025
2 parents 4991002 + 525dc30 commit 8315c59
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
* An instance is typically given to
* {@link tools.jackson.databind.ObjectMapper#acceptJsonFormatVisitor}
* which will invoke necessary callbacks.
*<p>
* For default configuration of things like "Logical Types support", see Javadocs
* of {@link VisitorFormatWrapperImpl}.
*/
public class AvroSchemaGenerator extends VisitorFormatWrapperImpl
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}

/**
Expand Down

0 comments on commit 8315c59

Please sign in to comment.