liveBook · Manning

Parsing

As explained in API Design Patterns

Parsing is the process of analyzing a serialized or textual representation according to syntax rules to produce a structured or executable form.

Parsing analyzes a serialized or textual representation according to syntax rules and produces a structured or executable form. In API filtering, the server parses SQL-style query strings before evaluating them. section 22.3.1

Structured filtering moves parsing responsibility to the client, which sends a schema directly for evaluation. Both approaches can express equivalent filters, so the choice mainly concerns usability and future flexibility. section 22.3.1

Apply parsing and serialization as opposing transformations:

  • Parse a string query into a structured representation. section 22.3.1
  • Serialize a structured query into a string representation. section 22.3.1

Filtering ChatRoom resources

Parse `SELECT * FROM ChatRooms WHERE title = "New Chat!";` into an equivalent structured filter such as `{ title: "New Chat!" }`.

How API Design Patterns covers it

How deep it goes
Contrasts server parsing with client-constructed schemas and shows equivalent transformations, but stops short of parser implementation.
Examples
Demonstrates ChatRoom SQL and MongoDB filters covering equality, comparison, conjunction, membership, and disjunction.
What you can do after
Evaluate equivalent string and structured filter designs against usability and future flexibility.
How it connects
Connects parsing with serialization, structured queries, SQL filtering, MongoDB, and API design trade-offs.

Also explained in

Compare how 13 books explain parsing →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of API Design Patterns. The section links point to the parts of the book it draws on.