Skip to content

Files

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Latest commit

b126379 · May 15, 2025

History

History
94 lines (60 loc) · 2.3 KB

jsonpath.rst

File metadata and controls

94 lines (60 loc) · 2.3 KB

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

$ composer require symfony/json-path

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 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)