Skip to content

Object with all null values returned in PATCH requests #148

@deo002

Description

@deo002

Description

An object with all null values is returned on passing an empty object to any PATCH request.

Request:

curl -X 'PATCH' \
  'http://localhost:5000/api/v1/licenses/MIT' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer xyz' \
  -H 'Content-Type: application/json' \
  -d '{

}'

Response:

{
  "status": 200,
  "data": [
    {
      "shortname": null,
      "fullname": null,
      "text": null,
      "url": null,
      "add_date": "0001-01-01T00:00:00Z",
      "copyleft": null,
      "FSFfree": null,
      "OSIapproved": null,
      "GPLv2compatible": null,
      "GPLv3compatible": null,
      "notes": null,
      "Fedora": null,
      "text_updatable": null,
      "detector_type": null,
      "active": null,
      "source": null,
      "spdx_id": null,
      "risk": null,
      "flag": null,
      "marydone": null,
      "external_ref": {},
      "created_by": {
        "id": 0,
        "user_name": null,
        "display_name": null,
        "user_email": null,
        "user_level": null
      }
    }
  ],
  "paginationmeta": {
    "resource_count": 1
  }
}

Desired Behaviour:

The unmodifed object is returned in response.

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