Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: reva2/jsonapi
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: reva2/jsonapi
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1.5.x-dev
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 2 commits
  • 3 files changed
  • 3 contributors

Commits on Jun 17, 2026

  1. Fix uncaught \TypeError when two relationships collide by (type, id)

    The relationship fast path looks up an already parsed resource in the
    context by the (type, id) pair taken from the request and assigns it
    without verifying its class. When two relationships of different types
    reference the same (type, id) -- e.g. a request mislabels one
    relationship with another's type and reuses its id -- the resource
    registered by the first relationship is reused for the second one and
    passed to a type hinted setter expecting a different class. This raises
    an uncaught \TypeError (HTTP 500) instead of a proper "wrong type"
    error, since parseDocument() only catches \Exception.
    
    Skip the context fast path when the request type does not match the type
    expected by the relationship, so parsing falls back to parseResource(),
    which reports the mismatch as a 409 -- exactly as for a standalone
    resource. Covers both to-one and to-many relationships.
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
    Vladimir Udin and claude committed Jun 17, 2026
    Configuration menu
    Copy the full SHA
    4234c4b View commit details
    Browse the repository at this point in the history
  2. Merge pull request #24 from Lion17/bugfix/relationship-type-collision

    Fix uncaught \TypeError when two relationships collide by (type, id)
    reva2 authored Jun 17, 2026
    Configuration menu
    Copy the full SHA
    0c56b78 View commit details
    Browse the repository at this point in the history
Loading