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
I was investigating various JSON parsers in use in our app code, and I realised lacinia-pedestal hard-codes Cheshire in two places: parsing incoming requests (query, vars) and encoding outgoing responses. Obviously I can replace those interceptors with my own version, but since the Cheshire namespaces are still required, they still need to be present in the class path.
(Lacinia core does the same with data.json for the introspection part).
Would it make sense to have a protocol that applications can implement? Or perhaps use some other load-time machinery to load a particular json library? It would be nice to have a single dependency in a codebase.
The text was updated successfully, but these errors were encountered:
I'm open to this and, yes, we don't actually use cheshire in production at Walmart so coming up with a pluggable way to replace it would be fine. I suspect a simple protocol for a JSON Driver, and a default implementation that uses Cheshire, but does it in a way (using explicit calls to requiring-resolve) that allows Cheshire to be an optional dependency.
I was investigating various JSON parsers in use in our app code, and I realised lacinia-pedestal hard-codes Cheshire in two places: parsing incoming requests (query, vars) and encoding outgoing responses. Obviously I can replace those interceptors with my own version, but since the Cheshire namespaces are still required, they still need to be present in the class path.
(Lacinia core does the same with data.json for the introspection part).
Would it make sense to have a protocol that applications can implement? Or perhaps use some other load-time machinery to load a particular json library? It would be nice to have a single dependency in a codebase.
The text was updated successfully, but these errors were encountered: