Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
RisingSunLight42 wants to merge1 commit intosymfony:7.3
base:7.3
Choose a base branch
Loading
fromRisingSunLight42:fix_20837
Draft
Changes fromall 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 deletionscomponents/jsonpath.rst
View file
Open in desktop
Original file line numberDiff line numberDiff 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.
Comment on lines +9 to +16

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 (seehttps://packagist.org/packages/symfony/json-path).

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Noted, it was a part I wasn't sure about, I'll update it


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

Choose a reason for hiding this comment

The 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.

RisingSunLight42 reacted with thumbs up emoji
~~~~~~~~~~~~~~~~~~~~

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)
Comment on lines +86 to +89

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Here you can talk about the newly merged PR:#20977

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Awesome PR! Will be very useful, thanks




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

[8]ページ先頭

©2009-2025 Movatter.jp