spdx / spdx/spdx-python-model

Looks like `spdxId` does not have cardinality information

Open
#54 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Jupyter Notebook
Stars
5
Forks
6
PR merge metrics
No merged PRs in 30d

Description

When use Element.spdxId in Python code, the IDE/linter expects spdxId to be either str or None.

But as cardinality of spdxId (in Element) is 1..1, it should not be the case. It should expect only str.

Not sure if it is anything to do with the fact that we treat spdxId as an alias of _id/@id (so the generation code may differ from other properties).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the generated Element model and the generation path for spdxId, especially the handling of its _id/@id alias. Check how the 1..1 cardinality becomes the Python type annotation, then verify that IDE or linter inference treats Element.spdxId as str rather than str or None.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
developer-experience
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.