Skip to content

Issue with getallaudits API response null value #130

@ChayanDass

Description

@ChayanDass

Issue with getallaudits API response

Description

The getallaudits API is returning an unexpected response structure where the license data contains null values for some fields and includes extra user details within the entity object.

Response Example:

{
  "status": 200,
  "data": [
    {
      "id": 1,
      "user_id": 1,
      "user": {
        "id": 1,
        "username": "chayan",
        "display_name": "<chayan>",
        "user_email": "[email protected]",
        "user_level": "SUPER_ADMIN"
      },
      "timestamp": "2025-03-22T15:39:21.660456+05:30",
      "type": "license",
      "type_id": 1,
      "entity": {
        "shortname": "MIT",
        "fullname": "MIT L",
        "text": "MIT License Text here",
        "url": "https://opensource.org",
        "add_date": "2023-12-01T18:10:25+05:30",
        "copyleft": false,
        "FSFfree": false,
        "OSIapproved": false,
        "GPLv2compatible": false,
        "GPLv3compatible": false,
        "notes": "",
        "Fedora": "",
        "text_updatable": false,
        "detector_type": 1,
        "active": true,
        "source": "",
        "spdx_id": "MIT",
        "risk": 0,
        "flag": 1,
        "marydone": false,
        "external_ref": {},
        "obligations": null,
        "user": {
          "id": 0,
          "username": null,
          "display_name": null,
          "user_email": null,
          "user_level": null
        }
      }
    }
  ],
  "paginationmeta": {
    "resource_count": 1
  }
}

Expected Behavior

The license data should not contain null values for the user fields within the entity object

and obligation null will be fixed after the merge will be fixed after merge of #118

suggestion :

we can also remove the userdetails from the audit struct in json response , because all licenses are already has user details or we can only send the sortname as a response instead of full license details

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