Skip to content

Support for anyOf, even network analysis shall support selector #1629

@PhilipPartsch

Description

@PhilipPartsch

In Sphinx-Needs, we can define selector to define which needs are been covered by the schema.
For maintenance reasons it would be cool, if in a network analysis, these selector scripts can be used.
E.g. like in the example

Selector:

        "select_asreq": {
            "properties": {
                "type": {
                    "const": "asreq"
                }
            }
        },
"select_GROUP__requirements": {
      "anyOf": [
          {
              "$ref": "#/$defs/select_sysreq"
          },
          {
              "$ref": "#/$defs/select_swreq"
          },
          {
              "$ref": "#/$defs/select_asreq"
          }
      ]
  },

In the schema:

        {
            "id": "schema_TYPE__test_specification",
            "select": {
                "$ref": "#/$defs/select_test_specification"
            },
            "validate": {
                "local": {
                    "allOf": [
                        {
                            "$ref": "#/$defs/TYPE__test_specification"
                        }
                    ],
                    "unevaluatedProperties": false
                },
                "network": {
                    "verifies": {
                        "contains": {
                            "local": {
                                "$ref": "#/$defs/select_GROUP__requirements"
                            }
                        },
                        "minContains": 0
                    }
                }
            }
        },

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