Skip to content

needs.json: warn if key and id field differs #1414

@ubmarco

Description

@ubmarco

Sphinx-Needs allows to import this needs.json:

{
  "current_version": "1.0",
  "project": "test project",
  "versions": {
    "1.0": {
      "creator": { "program": "sphinx_needs", "version": "4.2.0" },
      "needs": {
        "REQ_1_1": {
          "id": "REQ_1_1_other",
          "other": "fields"
        }
      },
      "needs_amount": 1,
      "needs_schema": {
        "$schema": "[http://json-schema.org/draft-07/schema#](http://json-schema.org/draft-07/schema)",
        "properties": {
          "fields": {}
        },
        "type": "object"
      }
    }
  }
}

The dictionary key REQ_1_1 differs from the id field value REQ_1_1_other.
This should lead to a warning and a refusal to import those needs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions