Implement new JSON Jinja filters#617
Merged
Kami merged 4 commits intoStackStorm:masterfrom Oct 2, 2017
Merged
Conversation
3 tasks
arm4b
suggested changes
Sep 29, 2017
docs/source/reference/jinja.rst
Outdated
| v2.1, the expression to access key ``foo`` from datastore used to be ``{{ system.foo }}`` | ||
| but is now deprecated, and the leading ``st2kv.`` namespace is required. | ||
|
|
||
| Currently, all data in the datastore is represented as strings. Toto represent |
arm4b
reviewed
Sep 29, 2017
docs/source/reference/jinja.rst
Outdated
| # {'first': 'Jacob', 'last': 'e'}, | ||
| # {'first': 'Jayden', 'last': 'f'}]} | ||
| # result = ['James', 'Jacob', 'Jayden'] | ||
| {{ input | jmespath_query('people[*].first') }} |
Member
There was a problem hiding this comment.
I think for such complex filter we need several more examples to show how powerful it is.
Member
Author
There was a problem hiding this comment.
Good idea! Added more examples.
Kami
reviewed
Oct 2, 2017
| # | ||
| # input = {'animals': ['bird', 'rabbit', 'cat', 'dog', 'cow'] } | ||
| # result = ['bird', 'rabbit', 'cat', 'dog', 'cow'] | ||
| {{ input | jsonpath_query('animals[*]') }} |
Member
There was a problem hiding this comment.
Nice work on the docs and examples 👍
Kami
reviewed
Oct 2, 2017
| .. code-block:: bash | ||
|
|
||
| {{version | version_strip_patch}} | ||
| {{ version | version_strip_patch }} |
Member
There was a problem hiding this comment.
Thanks, I'm also not a fan of non-whitespace approach :P
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the corresponding PR to
StackStorm/st2#3766 that adds documentation on the new filters.