Skip to content

Conversation

@swhitty
Copy link
Owner

@swhitty swhitty commented Oct 15, 2025

Adds JSONValue / JSONPath and JSONValuePattern objects to allow matching of JSON Values in HTTP Requests without using NSPredicate

 let route = HTTPRoute(
   "POST /fish",
   jsonBody: { try $0.getValue(for: "$.food") == .string("chips")  }
)

await route ~= .make(path: "fish", bodyJSON: #"{food: "chips"}"#)  // true

@codecov
Copy link

codecov bot commented Oct 15, 2025

Codecov Report

❌ Patch coverage is 78.94737% with 68 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.11%. Comparing base (9523b3b) to head (0b1fff8).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
FlyingFox/Sources/JSON/JSONValue.swift 76.69% 62 Missing ⚠️
FlyingFox/Sources/JSON/JSONPath.swift 85.36% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #176      +/-   ##
==========================================
- Coverage   92.87%   92.11%   -0.76%     
==========================================
  Files          64       68       +4     
  Lines        4435     4758     +323     
==========================================
+ Hits         4119     4383     +264     
- Misses        316      375      +59     

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

@swhitty swhitty force-pushed the JSONValuePattern branch 2 times, most recently from d70f4da to 2904432 Compare October 15, 2025 10:30
@swhitty swhitty merged commit 2fbdd81 into main Oct 15, 2025
22 of 24 checks passed
@swhitty swhitty deleted the JSONValuePattern branch October 15, 2025 10:40
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.

2 participants