Skip to content

fix: allow non-object JSON/YAML payloads in contextualizer and authorizer responses#3202

Open
Kakadus wants to merge 1 commit intodadrus:releasefrom
Kakadus:fix/json-list-decoder
Open

fix: allow non-object JSON/YAML payloads in contextualizer and authorizer responses#3202
Kakadus wants to merge 1 commit intodadrus:releasefrom
Kakadus:fix/json-list-decoder

Conversation

@Kakadus
Copy link
Copy Markdown
Contributor

@Kakadus Kakadus commented Apr 17, 2026

Related issue(s)

Fixes #3201

Checklist

  • I agree to follow this project's Code of Conduct.
  • I have read, and I am following this repository's Contributing Guidelines.
  • I have read the Security Policy.
  • I have referenced an issue describing the bug/feature request.
  • I have added tests that prove the correctness of my implementation.
  • I have updated the documentation.

Description

The contenttype decoder forced responses into map[string]any, so a top-level JSON array (e.g. []) or scalar returned by an upstream caused "failed to unmarshal response: expected { character for map value" and an HTTP 500. Widen Decoder.Decode to return any; callers already consume it as any.

…izer responses

The contenttype decoder forced responses into map[string]any, so a
top-level JSON array (e.g. []) or scalar returned by an upstream caused
"failed to unmarshal response: expected { character for map value" and
an HTTP 500. Widen Decoder.Decode to return any; callers already consume
it as any.
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 17, 2026

Codecov Report

❌ Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 91.30%. Comparing base (3a22211) to head (7938d5d).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...ernal/rules/mechanisms/contenttype/yaml_decoder.go 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           release    #3202      +/-   ##
===========================================
+ Coverage    91.27%   91.30%   +0.02%     
===========================================
  Files          281      281              
  Lines        10800    10800              
===========================================
+ Hits          9858     9861       +3     
+ Misses         680      678       -2     
+ Partials       262      261       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant