Skip to content

/tones/search endpoint returns tags and makes objects without the id field, while other endpoints may include it #2

@krazyuniks

Description

@krazyuniks

Hi, it seems id is not included in all api results. Is this intentional? Seems like it would be required to guarantee uniqueness.

Here is what claude said:

when does tone3000 use the id field and when doesn't it? is this a bug on their end i should report?

⏺ Let me check the actual API responses to see the pattern:

⏺ Bash(curl -s http://localhost:8000/api/v1/tones/mine 2>/dev/null | python3 -m json.tool | head -50)
⎿  {
"detail": "Not authenticated"
}

⏺ Bash(docker compose logs backend --tail 100 2>/dev/null | grep -A 20 "tags|makes" | head -40)
⎿  (No content)

⏺ Read(backend/app/services/tone3000.py)
⎿  Read 344 lines

⏺ Good question. Based on the error, here's what I observed:

The /tones/search endpoint returns tags/makes WITHOUT id:
{
"tags": [{"name": "nam"}],
"makes": [{"name": "Brown eye"}, {"name": "Friedman"}]
}

Expected format (with id):
{
"tags": [{"id": 1, "name": "nam"}],
"makes": [{"id": 42, "name": "Brown eye"}]
}

Let me check if the other endpoints (/tones/created, /tones/favorited) have the same behavior or if it's search-specific:

⏺ Bash(docker compose logs backend 2>/dev/null | grep -i "validation|field required" | tail -20)
⎿  backend-1 | Field required [type=missing, input_value={'name': 'nam'}, input_type=dict]
backend-1 | Field required [type=missing, input_value={'name': 'Brown eye'}, input_type=dict]
backend-1 | Field required [type=missing, input_value={'name': 'Friedman'}, input_type=dict]
… +17 lines (ctrl+o to expand)

⏺ Based on the evidence:

Summary

Endpoint Has id field? Status before fix
/tones/created Unknown (worked) 200 OK
/tones/favorited Unknown (worked) 200 OK
/tones/search Missing 500 Error

The /tones/search endpoint returns tags/makes as:
{"name": "Friedman"} // No "id" field

Recommendation

Yes, report this to Tone 3000. This is likely an inconsistency bug:

  1. If intentional (search returns minimal data) - they should document it in their API docs
  2. If a bug - the serializer for search results is missing the id field

You could report:
"The /tones/search endpoint returns tags and makes objects without the id field, while other endpoints may include it. This causes issues for clients expecting consistent schema. Either document this as intentional or add the id field for consistency."

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