fix(resources): restore v4 super.post create on collection posts - #1956
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the Resource class to support v4-style instance posting on collection targets when no ID is present, and adds comprehensive unit tests for this behavior and RequestTarget collection semantics. The feedback advises updating the new test assertions to use assert.strictEqual instead of loose assert.equal to align with the repository's style guide.
|
Reviewed; no blockers found. |
|
unit failures are pre existing on main |
89e0899 to
959724c
Compare
…rt prototype fallback (review)
bc1df4d to
0cc84e9
Compare
kriszyp
left a comment
There was a problem hiding this comment.
Ok, I guess GPT thinks this would be a lot safer to restrict this to this.loadAsInstance !== false.
🤖 Reviewed with GPT 5.6
Addressed in 49a9319 with the loadAsInstance false guard and dispatch regression.
kriszyp
left a comment
There was a problem hiding this comment.
Aligned with #1842: instance-loaded legacy bare POSTs normalize before authorization, while loadAsInstance=false custom handlers retain their existing Resource/Collection dispatch boundary. All review threads are addressed and CI is green.
Restores v4-style instance post overrides that delegate to super.post on a bare collection path. The compatibility normalization runs before authorization and dispatch so the bare and slash forms both use collection/insert semantics, while default bare POST retains its 404 and loadAsInstance=false resources retain their distinct base-resource dispatch. Includes regressions for target parsing, default behavior, insert-vs-update authorization, and false-mode Resource/Collection separation.
Generated with GPT-5.6 Codex.