From b126379c2b5f22fc508a45b671c5394fa71fa58f Mon Sep 17 00:00:00 2001 From: RisingSunLight Date: Thu, 15 May 2025 19:31:25 +0200 Subject: [PATCH] Add very rough starting point with structure --- components/jsonpath.rst | 94 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 components/jsonpath.rst diff --git a/components/jsonpath.rst b/components/jsonpath.rst new file mode 100644 index 00000000000..76f817519b8 --- /dev/null +++ b/components/jsonpath.rst @@ -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 +~~~~~~~~~~~~~~~~~~~~ + +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) + + + +.. _`JSONPath`: https://datatracker.ietf.org/doc/html/rfc9535 +.. _`JSON`: https://www.iso.org/iso-8601-date-and-time-format.html