FAQ

  • GitHub GitHub Repo stars
  • Discord Discord Server
  • xor


    xor will check that a only one of two properties is set/defined within a given JSON Path.

    How do I use this function?

    This function is configured by the following functionOptions. Essentially the properties is a two element string array of the two properties you want to check against.

    NAME TYPE REQUIRED? DESCRIPTION
    properties []string yes Array of two properties to check against

    Example ruleset configuration

    xor-the-things:
      message: "Only one thing can exist"
      given: $.tags[*]
      then:
        field: name
        function: xor
        functionOptions:
          properties:
            - "Tag1"
            - "Tag_1"
    

    View Spectral Equivalent


    View Function Source