liveBook · Manning

JSON

As explained in Build and Orchestrator in Go (From Scratch)

JSON is a text-based data interchange format that represents structured values using objects, arrays, names, and values.

JSON (JavaScript Object Notation) is a structured data format for exchanging values through APIs. It gives requests and responses a predictable representation built from objects, arrays, names, and values. section 5.2 section 8.3

An API applies JSON at both boundaries: clients encode request bodies as JSON, and servers encode response bodies as JSON. Keeping the manager and worker APIs in the same format avoids unnecessary translation between services. section 5.2 section 8.3

In the task API, JSON appears in these operational roles:

  • A POST /tasks request carries a JSON-encoded task.TaskEvent containing the task to start. section 5.2

A task event

A task event nests task data inside an outer object: the event supplies identifiers and state, while its Task value supplies the task name, image, and state. The API extracts that nested task and adds it to the worker queue. section 5.2

How Build and Orchestrator in Go (From Scratch) covers it

How deep it goes
Defines JSON through nested task payloads and API body examples, without descending into parsing or serialization internals.
Examples
Uses nested task events, arrays of task records, and POST, GET, and DELETE route tables as concrete examples.
What it assumes
Assumes familiarity with APIs and HTTP requests, while grounding the format in concrete task payloads.
What you can do after
Apply it via REST APIs to shape task requests and interpret task responses consistently.
How it connects
Connects JSON with REST APIs, HTTP requests and responses, task queues, and Docker-based task execution.

Also explained in

Compare how 35 books explain JSON →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build and Orchestrator in Go (From Scratch). The section links point to the parts of the book it draws on.