Skip to content

Add subset operators for validating list-valued fields (is-subset, is-subset-ci) #149

Description

@michalis1

Environment

  • jdiff version: 1.0.1

Proposed Functionality

The current operator check in jdiff supports comparisons for scalar values (e.g., numeric, boolean, string) but does not provide a way to validate list-valued fields.

In some cases, the extracted value from extract_data_from_json() is itself a list, and we want to validate that this list is contained within a predefined reference set.

Example JSON:

[
  {
    "id": "DOMAIN1.COMPANY.COM",
    "include_trusted_domains": [
      "COMPANY.COM",
      "domain1.company.com",
      "domain2.company.COM",
      "domain3.company.com",
      "test.com"
    ]
  }
]

Example check:

We want to verify that include_trusted_domains is a subset of an allowed list:

[
"COMPANY.COM",
"domain1.company.com",
"domain2.company.com",
"domain3.company.com",
"domain4.company.com",
"domain5.company.com",
"test.com",
"test1.com",
"test2.com"
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions