Summary
daptin-cli related assumes JSON:API data is an array and rejects a valid
to-one relationship response object.
Reproduced with daptin-cli v0.9.0 / 56c4ba0 and Daptin v0.12.36.
Reproduction
Schema: ticket belongs_to project.
daptin-cli related ticket <ticket-reference-id> project_id
The server correctly returned JSON:API data: { ... } for the to-one relation.
CLI failed:
malformed related response: expected JSON:API data array
Expected behavior
- Accept
data object for to-one, array for to-many, and null for an empty
nullable to-one relation.
- Preserve table/JSON output and relation metadata.
--quiet prints the one target reference id or nothing for null.
- Pagination flags should either be ignored/documented for to-one or rejected
clearly.
Acceptance test
Cover belongs-to present/null and has-many empty/nonempty response shapes,
including --output json and --quiet.
Summary
daptin-cli relatedassumes JSON:APIdatais an array and rejects a validto-one relationship response object.
Reproduced with daptin-cli
v0.9.0/56c4ba0and Daptinv0.12.36.Reproduction
Schema:
ticket belongs_to project.The server correctly returned JSON:API
data: { ... }for the to-one relation.CLI failed:
Expected behavior
dataobject for to-one, array for to-many, andnullfor an emptynullable to-one relation.
--quietprints the one target reference id or nothing for null.clearly.
Acceptance test
Cover belongs-to present/null and has-many empty/nonempty response shapes,
including
--output jsonand--quiet.