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

Issue with objects id endpoint (specifically for SCOs) on Obstracts and Stixify #57

Open
himynamesdave opened this issue Feb 4, 2025 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@himynamesdave
Copy link
Member

This is a similar issue to

#47

However, is the opposite problem

This time, we only need the is_latest version. Currently it returns all versions of the SCO (one for each report it belongs too) -- see example below.

Expected is that it returns one result. If user wants to know reports it belongs too, they can use the object id/reports endpoint

http://localhost:8001/api/v1/objects/bank-account--4c1507ea-fdde-556b-87c9-f8ef702a0d8a/

{
  "page_size": 50,
  "page_number": 1,
  "page_results_count": 2,
  "total_results_count": 2,
  "objects": [
    {
      "country": "DE",
      "extensions": {
        "extension-definition--f19f3291-6a84-5674-b311-d75a925d5bd9": {
          "extension_type": "new-sco"
        }
      },
      "iban_number": "DE29100500001061045672",
      "id": "bank-account--4c1507ea-fdde-556b-87c9-f8ef702a0d8a",
      "spec_version": "2.1",
      "type": "bank-account"
    },
    {
      "country": "DE",
      "extensions": {
        "extension-definition--f19f3291-6a84-5674-b311-d75a925d5bd9": {
          "extension_type": "new-sco"
        }
      },
      "iban_number": "DE29100500001061045672",
      "id": "bank-account--4c1507ea-fdde-556b-87c9-f8ef702a0d8a",
      "spec_version": "2.1",
      "type": "bank-account"
    }
  ]
}
@himynamesdave himynamesdave added the bug Something isn't working label Feb 4, 2025
@github-project-automation github-project-automation bot moved this to Todo in Roadmap Feb 4, 2025
@fqrious
Copy link
Contributor

fqrious commented Feb 4, 2025

I assume this is only a problem in obstracts, right? this is because obstracts uses multiple collections making _is_latest nearly useless.

@fqrious fqrious moved this from Todo to Pushed in Roadmap Feb 4, 2025
himynamesdave pushed a commit that referenced this issue Feb 4, 2025
* add parameter to allow SROs to return non-latest relationships needed in #47

* only return 1 object in `$OBJECTS/<object_id>` #57
@himynamesdave
Copy link
Member Author

@fqrious no it's also an issue in stixify (i think), this is because scos can be shared between reports (but we generate a unique entry with s2a note of the report)? right?

@fqrious
Copy link
Contributor

fqrious commented Feb 4, 2025

not possible, stixify uses one collection...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Pushed
Development

No branches or pull requests

2 participants