Skip to content

Conversation

@swhitty
Copy link
Owner

@swhitty swhitty commented Oct 15, 2025

Simplifies public interface of JSONValue removing redundant methods.

renames JSONValuePattern to JSONBodyPattern as it is a HTTPBodyPattern implementation.

adds == operator for common comparisons to JSONValue

JSONValue.string("fish") == "fish"
JSONValue.number(10) == 10
JSONValue.bool(true) == true

allows for routes to use:

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

@swhitty swhitty merged commit bdea31a into main Oct 15, 2025
23 of 24 checks passed
@swhitty swhitty deleted the JSONValue branch October 15, 2025 22:20
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