discourse/spec/requests/api/shared
Martin Brennan 123de2c5e5
DEV: Improve API schema validation debugging output (#38997)
Show the actual value at the failing JSON pointer path instead of
dumping the entire response body. Also shows the parent object
for additional context.

Before (entire response dumped regardless of where the error is):

RESPONSE: {"user"=>{"id"=>1, "username"=>"admin", ...hundreds of
keys...}}
    POSSIBLE ISSUE W/: /user/admin_incoming_sign_in_count

After (pinpoints the failing value and its parent):

    VALUE AT "/user/admin_incoming_sign_in_count": nil
    PARENT AT "/user": {"id"=>1, "username"=>"admin", ...}

Falls back to printing the full response only when no pointer is
available. Adds a `value_at_json_pointer` helper implementing
RFC 6901 path resolution.
2026-03-31 18:00:48 +10:00
..
shared_examples.rb DEV: Improve API schema validation debugging output (#38997) 2026-03-31 18:00:48 +10:00