OkReplay Annotation is too strict
christopherperry opened this issue · 5 comments
christopherperry commented
It takes an array of MatchRules
. It should be an array of MatchRule
so we can pass in custom rules and not one from the default set.
christopherperry commented
I think it's also a good idea to allow the use of multiple tapes, vs just a single tape.
felipecsl commented
FWIW you can set custom match rules via OkReplayConfig
, but agreed, the annotation is too strict. We can replace it with MatchRule
instead.
felipecsl commented
Ah, forgot why that's the case: Unfortunately annotation fields have to be compile time constants, that is interfaces are not allowed (https://kotlinlang.org/docs/reference/annotations.html):
Allowed parameter types are:
types that correspond to Java primitive types (Int, Long etc.);
strings;
classes (Foo::class);
enums;
other annotations;
arrays of the types listed above.
Bummer 😢
christopherperry commented
classes (Foo::class);
would work given Foo is an implementation of MatchRule
. This should be doable.
felipecsl commented