goto / compass

Metadata storage service
https://goto.github.io/compass/
Apache License 2.0
2 stars 0 forks source link

Upserting an Asset returns 500 on duplicate owners #7

Closed sudo-suhas closed 1 year ago

sudo-suhas commented 1 year ago

Describe the bug When upserting an asset with duplicate owners, Compass returns 5xx with no clear error message.

Sample request payload

{
  "urn": "sample-urn",
  "owners": [
    {
      "uuid": "sample-uuid",
      "email": "john@doe.com"
    },
    {
      "uuid": "sample-uuid",
      "email": "john@doe.com"
    }
  ]
}

To Reproduce Steps to reproduce the behavior:

  1. Upsert an Asset with duplicate owners as shown in the example above
  2. Get 5xx error

Expected behavior When handling duplicate owners, Compass should handle it by either:

  1. Distinct the owner list and return no error
  2. Return 4xx error to indicate that the payload is invalid and let client fix it

This issue was originally reported here:

https://github.com/odpf/compass/issues/188