Class SensitivePaths

java.lang.Object
com.babelqueue.schema.SensitivePaths

public final class SensitivePaths extends Object
Extracts the x-gdpr-sensitive marks (ADR-0030) from a decoded JSON Schema. It walks the same raw schema Map the PayloadValidator validates against — the Java schema model is the decoded Map/List/scalar tree, so there is nothing extra to parse — and returns every marked property as a SensitivePath, in sorted path order.

x-gdpr-sensitive is a validation-neutral extension keyword: it never makes a value valid or invalid (the validator ignores unknown keywords), so annotating a schema with it is never a breaking change (GR-1). It is recognised in two shapes, matching the Go reference and the babelqueue-registry parser:

  • the boolean true → sensitive, empty category;
  • a non-empty string → sensitive, that string as the category (e.g. "email").
Any other shape — false, "", a number — leaves the property unmarked.

The walk descends nested objects (dotted paths, e.g. profile.full_name), array item schemas (the "field[]" segment, e.g. addresses[].line), and reports a mark on the root schema itself as the empty path "". The Java mirror of the Go schema.Schema.SensitivePaths.

  • Field Details

    • KEYWORD

      public static final String KEYWORD
      The extension keyword that marks a property as carrying personal/sensitive data.
      See Also:
  • Method Details

    • of

      public static List<SensitivePath> of(Map<String,Object> schema)
      Every property marked x-gdpr-sensitive in schema, in sorted path order.
      Parameters:
      schema - a decoded JSON Schema (Map); null yields an empty list
      Returns:
      the sensitive paths, sorted by path