-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[JsonPath] Add documentation #20974
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 7.3
Are you sure you want to change the base?
[JsonPath] Add documentation #20974
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
The JsonPath Component | ||
================== | ||
|
||
The JsonPath component queries JSON strings using JSONPath syntax. | ||
|
||
What is It? | ||
----------- | ||
|
||
The Symfony JsonPath component parses JSON strings to retrieve specifics values. | ||
|
||
`JSON`_, *JavaScript Object Notation*, is a lightweight data-interchange format. | ||
It is easy for humans to read and write. JSON is a widely used format in REST API and data manipulation. | ||
|
||
.. tip:: | ||
|
||
Learn more about `JSONPath`_ specifications. | ||
|
||
Installation | ||
------------ | ||
|
||
.. code-block:: terminal | ||
$ composer require symfony/json-path | ||
.. include:: /components/require_autoload.rst.inc | ||
|
||
Why? | ||
---- | ||
|
||
Fast | ||
~~~~ | ||
|
||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. | ||
Vestibulum id velit turpis. Sed vitae nisl placerat, rutrum ex nec, porta ante. | ||
Maecenas condimentum cursus risus at fringilla. | ||
|
||
Easy to read | ||
~~~~~~~~~~~ | ||
|
||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. | ||
Vestibulum id velit turpis. Sed vitae nisl placerat, rutrum ex nec, porta ante. | ||
Maecenas condimentum cursus risus at fringilla. | ||
|
||
Write powerful tests | ||
~~~~~~~~~~~~~~~~~~~~ | ||
|
||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. | ||
Vestibulum id velit turpis. Sed vitae nisl placerat, rutrum ex nec, porta ante. | ||
Maecenas condimentum cursus risus at fringilla. | ||
|
||
Ready-to-use functions | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You may first introduce basic queries, then talk about built-in functions in the advanced usages part. |
||
~~~~~~~~~~~~~~~~~~~~ | ||
|
||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. | ||
Vestibulum id velit turpis. Sed vitae nisl placerat, rutrum ex nec, porta ante. | ||
Maecenas condimentum cursus risus at fringilla. | ||
|
||
.. _using-the-symfony-json-path-component: | ||
|
||
Using the Symfony JsonPath Component | ||
-------------------------------- | ||
|
||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. | ||
Vestibulum id velit turpis. Sed vitae nisl placerat, rutrum ex nec, porta ante. | ||
Maecenas condimentum cursus risus at fringilla. | ||
|
||
The JsonCrawler | ||
~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
(introduce the JsonCrawler and basic property access) | ||
|
||
Build JsonPath | ||
~~~~~~~~~~~~~~~~~~ | ||
|
||
(introduce the JsonPath builder) | ||
-> list available method in the component (length, count, value, search, match, first, last) | ||
|
||
Advanced Usage | ||
--------------------- | ||
|
||
Complex queries | ||
~~~~~~~~~~~~~~~~~~ | ||
|
||
(show examples or more complex queries) | ||
|
||
Tests | ||
~~~~~~~~~~~~~~~~~~ | ||
|
||
(show tests examples) | ||
Comment on lines
+86
to
+89
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here you can talk about the newly merged PR: #20977 |
||
|
||
|
||
|
||
.. _`JSONPath`: https://datatracker.ietf.org/doc/html/rfc9535 | ||
.. _`JSON`: https://www.iso.org/iso-8601-date-and-time-format.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure you need to explain what JSON is, but rather explain what Json Path is, that it is defined in RFC9535, etc. It can be short and use the same description as the package itself (see https://packagist.org/packages/symfony/json-path).