Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ubmarco opened this issue Feb 27, 2025 · 0 comments
Open

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

ubmarco opened this issue Feb 27, 2025 · 0 comments
Labels

Comments

@ubmarco
Copy link
Member

ubmarco commented Feb 27, 2025

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.

@ubmarco ubmarco added the bug label Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant