Skip to content

Allow "optional-padding" for Base64Variant #500

@cowtowncoder

Description

@cowtowncoder

(note: follow-up from FasterXML/jackson-databind#2183)

Currently Base64Variant instances either require use of specific padding character (and use it for output) or disable use of padding completely (neither written nor accepted).
But it seems that sometimes a more lenient variant would make sense: one that

  1. Does write padding (with specific character) and
  2. Accepts specific padding but does not require it (i.e. ok to omit)

It seems best to add a "mutant factory" method in Base64Variant instance (something like withLenientPadding(boolean) maybe?). Whether additional entries should be added Base64Variants is an open question.
We'll have to figure out what to do wrt existing "usePadding()" compared to new option; API may be cumbersome if we have 2 booleans but just 3 legal combinations.

Note that we may also change API for configuration for Jackson 3.x, later on.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueIssue that seems easy to resolve and is likely a good candidate for contributors new to projecthacktoberfestIssue related to Hactoberfest2020 activities, eligible for additional rewards

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions