Skip to content

Support alternate radixes when writing numeric values as strings #221

@christophercurrie

Description

@christophercurrie

As requested in FasterXML/jackson-module-scala#65, and discussed in this thread. This would take the form of:

  • A BaseSettings property that specifies the default radix for Number-to-String conversion. Defaults to 10.
  • A 'radix' parameter added to JsonFormat that overrides the default radix, if the shape is STRING
  • [optionally] A serialization feature to control whether numeric values are output as JSON numbers or JSON strings by default.

Another component of the request is to provide a way that instances of a certain type, for example BigInteger, could be serialized as strings of a certain radix. I would think that a Mix-In annotation on the type would be the simplest end-user interface for this, but I don't know if Jackson will recognize @JsonFormat at the class level, or recognize mix-in annotations for built-in types.

Metadata

Metadata

Labels

good first issueIssue that seems easy to resolve and is likely a good candidate for contributors new to project

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions