You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(defrecord A [])
((schema.coerce/coercer bidi.schema/RoutePair {})
[(->A) :match])
Should result in an unchanged result, but actually results in [{} :match], which silently breaks the route structure. This seems to be schema behavior, see:
Most of my reasoning for making the Schema more strict is explained here #130 but in essence bidi/Pattern is implemented for all maps, sets and vectors and therefore when the schema contains (s/protocol bidi/Pattern) it will accept ANY map, set or vector regardless of whether they are valid bidi patterns or not making the schema pretty useless as a validator.
My original PR was meant to start a discussion about what a valid bidi pattern is and how to validate that. For instance custom pattern matchers are not part of the BNF for bidi patterns as they are described in the README but they clearly should be. One way to support custom pattern matchers while still leaving the schema strict is to have separate protocols for internal and custom pattern matchers so either saying bidi/Pattern is an internal protocol and custom pattern matchers should instead implement a new bidi/PatternExtension protocol or renaming the current bidi/Pattern to bidi/InternalPattern everywhere and having a bidi/Pattern protocol for custom pattern matchers.
This breaks custom matchers, as mentioned in juxt#187. This does not fixjuxt#187 because RoutePair generally needs fixing, but this makes it
sufficiently optional for users.
This breaks custom matchers, as mentioned in juxt#187. juxt#187 is not fixed
because RoutePair generally needs fixing, but this makes it sufficiently
optional for users.
Should result in an unchanged result, but actually results in
[{} :match]
, which silently breaks the route structure. This seems to be schema behavior, see:I think the correct change here is to undo part of ca14e6e and re-add
(s/protocol bidi/Pattern)
to the schema. However I don't know that I understand why it was commented out. Maybe @griff can weigh in on that?This bug prevents vhosts from working with custom pattern matchers, as it relies on coercion in order to function.
The text was updated successfully, but these errors were encountered: