Closed coryodaniel closed 3 years ago
Hi @coryodaniel . This is an issue because your specific struct does not implement the Access behavior. Absinthe is not explicitly disallowing it, but it does require that it behaves as a map.
Thanks for the quick reply!
I get that it’s because the access behavior isn’t implemented, I guess my question is, if I sent a PR to use Map functions instead of using the access behavior so structs would be supported, would that be a welcome feature? Or do you prefer users impl the access behavior should they need it.
@coryodaniel I think a PR that used map functions is fine, BUT we need to make sure that a nil
context is still supported for backwards compatibility reasons.
In theory this could break compatibility for anyone using a novel KV struct that implemented its own access behavior but the use of access wasn't really intended to support that anyway.
My application has a few different authentication contexts. I tried using a struct instead of a map when assigning a context to Abinsthe.Plug, but it results in an error.
Is there any reason why structs shouldn't be a valid value? I wouldn't mind making a PR if it makes sense for the project.