Jackson JSON Processor
  1. Jackson JSON Processor
  2. JACKSON-147

Add global deserialization feature for suppressing error reporting for unknown properties

    Details

    • Type: New Feature New Feature
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.2
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      (note: carved out of bigger issue, JACKSON-77, as something to include in 1.2 release)

      One common use case that has not yet been adequately covered is that of "what you see can't harm you": ability to ignore properties that do not match anything in target object to bind data to. This is sometimes useful as defensive coding measure, and to improve forward compatibility; specifically, older clients (or servers) can ignore newly added properties and only handle ones they are familiar with.

      The simplest possible solution is to add a new feature: DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES (which defaults to true to mimic existing behavior), which determines what to do when encountering unknown properties (that are not handled by registered DeserializationProblemHandlers):

      • Throw an exception, if enabled (default)
      • Ignore property name, skip value, if disabled.

        Activity

          People

          • Assignee:
            Tatu Saloranta
            Reporter:
            Tatu Saloranta
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: