Skip to content

REST API: report_date field returns empty object {} for all findings #153

@brunofuentes

Description

@brunofuentes

The REST API endpoint POST /api/v1/solodit/findings always returns report_date: {} (empty object) regardless of filters applied. This appears to be a serialization bug — the field is a JavaScript Date object on the server, and JSON.stringify() serializes Date instances as {} instead of an ISO string.

Steps to Reproduce:

curl -X POST https://solodit.cyfrin.io/api/v1/solodit/findings \
  -H "Content-Type: application/json" \
  -H "X-Cyfrin-API-Key: <YOUR_API_KEY>" \
  -d '{
    "page": 1,
    "pageSize": 2,
    "filters": { "languages": [{ "value": "Solidity" }] },
    "sortField": "Recency",
    "sortDirection": "Desc"
  }'

Expected:

{
  "report_date": "2026-03-25T00:00:00.000Z"
}

Actual:

{
  "report_date": {}
}

After investigating I found out that the internal tRPC endpoint (/api/trpc/findings.get) returns the date correctly via SuperJSON:
report_date: new Date(1774396800000). This confirms the data exists in the database. The issue might be related to the REST API's JSON serialization layer (?!).

I would really appreciate if you could look into this. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions