Skip to content

[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

Draft
wants to merge 1 commit into
base: 7.3
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions components/jsonpath.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
The JsonPath Component

Check failure on line 1 in components/jsonpath.rst

View workflow job for this annotation

GitHub Actions / Lint (DOCtor-RST)

Please ensure title "The JsonPath Component" and underline length are matching
==================

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.

Check failure on line 11 in components/jsonpath.rst

View workflow job for this annotation

GitHub Actions / Lint (DOCtor-RST)

Please remove trailing whitespace
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.

Check failure on line 33 in components/jsonpath.rst

View workflow job for this annotation

GitHub Actions / Lint (DOCtor-RST)

Please remove trailing whitespace
Vestibulum id velit turpis. Sed vitae nisl placerat, rutrum ex nec, porta ante.
Maecenas condimentum cursus risus at fringilla.

Easy to read

Check failure on line 37 in components/jsonpath.rst

View workflow job for this annotation

GitHub Actions / Lint (DOCtor-RST)

Please ensure title "Easy to read" and underline length are matching
~~~~~~~~~~~

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Check failure on line 40 in components/jsonpath.rst

View workflow job for this annotation

GitHub Actions / Lint (DOCtor-RST)

Please remove trailing whitespace
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.

Check failure on line 47 in components/jsonpath.rst

View workflow job for this annotation

GitHub Actions / Lint (DOCtor-RST)

Please remove trailing whitespace
Vestibulum id velit turpis. Sed vitae nisl placerat, rutrum ex nec, porta ante.
Maecenas condimentum cursus risus at fringilla.

Ready-to-use functions

Check failure on line 51 in components/jsonpath.rst

View workflow job for this annotation

GitHub Actions / Lint (DOCtor-RST)

Please ensure title "Ready-to-use functions" and underline length are matching
~~~~~~~~~~~~~~~~~~~~

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Check failure on line 54 in components/jsonpath.rst

View workflow job for this annotation

GitHub Actions / Lint (DOCtor-RST)

Please remove trailing whitespace
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

Check failure on line 60 in components/jsonpath.rst

View workflow job for this annotation

GitHub Actions / Lint (DOCtor-RST)

Please ensure title "Using the Symfony JsonPath Component" and underline length are matching
--------------------------------

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Check failure on line 63 in components/jsonpath.rst

View workflow job for this annotation

GitHub Actions / Lint (DOCtor-RST)

Please remove trailing whitespace
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)



.. _`JSONPath`: https://datatracker.ietf.org/doc/html/rfc9535
.. _`JSON`: https://www.iso.org/iso-8601-date-and-time-format.html