Skip to content

[finding] rest: GET /api/v1/data/:object/:id refuses the $expand alias that the list route folds — residual of #8039 #16621

Description

@os-sam

Observation from objectstack-ai/ats#13 (PR objectstack-ai/ats#48), cli 17.3.0 (@objectstack/rest 17.3.0).

What

The single-record route rejects the $-prefixed spelling:

GET /api/v1/data/ats_application/ID?$expand=candidate
400 {"error":{"code":"VALIDATION_ERROR","message":"The \"$expand\" query parameter is not supported by this endpoint. This endpoint will not silently ignore a parameter it does not understand — an ignored filter is indistinguishable from one that matched everything. Supported parameters: expand, select."}}

GET /api/v1/data/ats_application/ID?expand=candidate
200 — candidate expanded

while the list route's query-alias table maps expand to $expand (and filter to $filter, top, skip, …), so GET /api/v1/data/:object?$expand=… is the spelling the list surface teaches.

Why it is only a finding

The refusal is loud and its message names the accepted spelling, so nothing fails silently — this is the good failure shape. What remains is that the two routes disagree on whether the $ alias family is folded. #8039 (closed) fixed the canonical fields spelling on this route; $expand is the same class one alias over.

Suggested resolution (not a ruling)

Fold the same alias table on GET /:object/:id that the list route uses, or state in the 400 text that the $-prefixed family is list-only. Either removes the disagreement.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions