Open mkrizek opened 6 years ago
cc @jamesls
There's not a good way to do this now throuhg a public interface but I'm not opposed to adding something to make this easier. Having less restrictive type checking has come up a few times.
@jamesls would you be able to add this public interface that allows the consumer of jmespath to teach jmespath about additional types that are convertible to string? Or do you need someone in the community to do it?
@jamesls are you still there?
So I'm not opposed to this feature, but offhand I don't have any thoughts on a better public API for this. If anyone has suggestions, I'm open to it. I suppose we'd add something to the Options
class?
Once we have an interface we like, I can take a crack at implementing this.
A little background first, in Ansible there is a
json_query
filter plugin which usesjmespath
to query json. There is an issue open where users of that plugin get the following error:The comment that summarizes the issue is here https://github.com/ansible/ansible/issues/27299#issuecomment-366781707.
The error is caused by the fact that Ansible uses its own types for strings. One of the hacks we've come up with was:
which seems weird since I am pretty sure
REVERSE_TYPES_MAP
is not supposed to be public.is there a proper way to do this? If not, is this something that would be considered to be added?
Thanks!