Hi,
Currently io.fintrospect.formats.Auto uses implicit functions in various methods. E.g.:
def Out[OUT](svc: Service[Request, OUT], successStatus: Status = Status.Ok)
(implicit transform: OUT => R): Service[Request, Response]
This can be problematic, for example in cases where one is trying to serialize raw JSON (e.g., Play's JsValue). Since in this case OUT =:= R , and Fintrospect's built-in implicit conversion competes with the standard library's <:< (which extends Function1).
The workaround for this particular problem is to pass the implicit argument explicitly. But a more general solution would be to introduce a dedicated type for the conversions that take place in Auto. This will avoid polluting the implicit scope with a common type and thus won't compete with the standard library (or anything else for that matter).
Hi,
Currently
io.fintrospect.formats.Autouses implicit functions in various methods. E.g.:This can be problematic, for example in cases where one is trying to serialize raw JSON (e.g., Play's
JsValue). Since in this caseOUT =:= R, and Fintrospect's built-in implicit conversion competes with the standard library's<:<(which extendsFunction1).The workaround for this particular problem is to pass the implicit argument explicitly. But a more general solution would be to introduce a dedicated type for the conversions that take place in
Auto. This will avoid polluting the implicit scope with a common type and thus won't compete with the standard library (or anything else for that matter).