TOPIC 60/6222 MINNOT STARTED

Rest Assured: reusable specs, reading the reply and checking its shape

Reuse request settings, check a reply, then pass its id to the next call. Learn which schema rules catch a bad reply and which facts still need a test.

L1–L4 are part of the Pro pass

L0 Explain simply

Analogy: a restaurant order form. The form already has the table number. Each guest adds a dish. The server checks the meal against the order before taking it to the table.

A is saved request set-up. A response specification is a saved set of reply checks. Tom uses them to test Daily List, a made-up to-do app. The base address lives in one place. Each test still says which task it wants.

A schema sets rules for data. It can require a task id and a true-or-false done flag. It can also limit values. A valid shape alone does not prove that Tom received his own task.

The form is a teaching picture, not a system design. Code runs the checks; the server does not read Tom's test specification.

PICTURE IT

The picture is the one the lesson above opens with. The table below shows how each part of it matches the software.

THE REAL JOB An order form saves shared details while each order keeps its own checks.

  1. Prepare
  2. Call
  3. Check
Order form

HOW THE PICTURE MAPS

How each part of the picture matches the software
In the pictureIn the software
The printed table numberThe shared base address in a request specification
The dish written on this orderThe request data for this test
Checking the plate against the orderThe shared reply checks plus this case’s value checks
The order number kept for laterThe created id extracted for the next call

WHERE THIS PICTURE STOPS

  • A form is paper; a specification is code applied to a call.
  • A schema can require fields and restrict values, but only through the rules it declares.
  • A valid reply shape does not prove that the task belongs to the right user.

HOOK

Print once, tick often.

TELL A FRIEND

An order form: printed once, ticked each time.

OFTEN MIXED UP WITH REST Assured: your first API tests in Java. That topic writes a first test. This one shares set-up and separates schema rules from case-specific checks.

Sources & standards — 4 sources
  1. Implementation-specific

    Usage guide (the Rest Assured project wiki) ↗ — Rest Assured project · Usage, opened 8 November 2026: Specification Re-use, Default Values, Extracting values after validation, JSON paths and Blacklist Headers from Logging. REST Assured 6.3.0 baseline; synthetic examples are editorial.

    Official REST Assured library behaviour, scoped to the named sections and 6.3.0 documentation. Not a universal API contract or a guarantee about future releases. · Checked 2026-11-08

    Primary sections opened in full on 8 November 2026: specification reuse, defaults, extraction after validation, JSON paths, JSON Schema settings/version selection and header logging. Current examples use 6.3.0. Older Draft 4 examples remain on the same page; the newer-version section must also be read. No publisher image is copied by this correction.

  2. Market practice

    JSON Schema Validation — Draft2020-12 ↗ — JSON Schema authors · JSON Schema Validation Draft 2020-12, sections 6.1 (type, enum, const), 6.5.3 (required), and 7.2 (format). Opened 8 November 2026. This is the published JSON Schema dialect document, not an RFC.

    Draft2020-12 validation, draft-bhutton-json-schema-validation-01 published16June2022; complete1–6 includingchildren,7.1–7.2.3 and7.3.1 actually read. Internet-Draft, not RFC; required/value constraints and format annotation versus optional assertion. Unread7.3.2+ and linkedCore not certified. · Checked 2026-11-07

    Complete named units banked under V72 Phase1 gate01d542c62 before implementation; no all-client, whole-document or current tool compatibility certification.

  3. Implementation-specific

    REST Assured 6.1.0 release notes: JSON Schema dialect support ↗ — REST Assured project · Official 6.1.0 release notes, JSON Schema support highlight; Usage Choosing the JSON Schema version. Opened 8 November 2026. New drafts selected by $schema; older versions may ignore newer keywords.

    Official 6.1.0 release highlight for draft-06, draft-07, 2019-09 and 2020-12; the Usage guide explains dialect selection and old-version limitations. · Checked 2026-11-08

    Opened the primary release highlight and linked Usage section. Synthetic test fixtures are editorial. Runtime evidence is recorded separately; release notes are not a test execution claim.

  4. Implementation-specific

    REST Assured GettingStarted (6.3.0 dependency example) ↗ — REST Assured project · GettingStarted, Maven/Gradle and JSON Schema Validation, opened 8 November 2026. Both rest-assured and json-schema-validator use version 6.3.0 in test scope; JsonPath uses Groovy GPath.

    Version-scoped product behaviour; relevant primary sections opened 6 November 2026. · Checked 2026-11-06

    Official product documentation, not a general standard. Relevant sections and exact release/access limitations are recorded in the V27 full-depth audit. Screens and rolling documentation can change; synthetic Daily List examples are editorial fixtures, not publisher product guarantees.

PRACTISE AND KEEP

Sources for this topic — 4 sources
  1. Implementation-specific

    Usage guide (the Rest Assured project wiki) ↗ — Rest Assured project · Usage, opened 8 November 2026: Specification Re-use, Default Values, Extracting values after validation, JSON paths and Blacklist Headers from Logging. REST Assured 6.3.0 baseline; synthetic examples are editorial.

    Official REST Assured library behaviour, scoped to the named sections and 6.3.0 documentation. Not a universal API contract or a guarantee about future releases. · Checked 2026-11-08

    Primary sections opened in full on 8 November 2026: specification reuse, defaults, extraction after validation, JSON paths, JSON Schema settings/version selection and header logging. Current examples use 6.3.0. Older Draft 4 examples remain on the same page; the newer-version section must also be read. No publisher image is copied by this correction.

  2. Market practice

    JSON Schema Validation — Draft2020-12 ↗ — JSON Schema authors · JSON Schema Validation Draft 2020-12, sections 6.1 (type, enum, const), 6.5.3 (required), and 7.2 (format). Opened 8 November 2026. This is the published JSON Schema dialect document, not an RFC.

    Draft2020-12 validation, draft-bhutton-json-schema-validation-01 published16June2022; complete1–6 includingchildren,7.1–7.2.3 and7.3.1 actually read. Internet-Draft, not RFC; required/value constraints and format annotation versus optional assertion. Unread7.3.2+ and linkedCore not certified. · Checked 2026-11-07

    Complete named units banked under V72 Phase1 gate01d542c62 before implementation; no all-client, whole-document or current tool compatibility certification.

  3. Implementation-specific

    REST Assured 6.1.0 release notes: JSON Schema dialect support ↗ — REST Assured project · Official 6.1.0 release notes, JSON Schema support highlight; Usage Choosing the JSON Schema version. Opened 8 November 2026. New drafts selected by $schema; older versions may ignore newer keywords.

    Official 6.1.0 release highlight for draft-06, draft-07, 2019-09 and 2020-12; the Usage guide explains dialect selection and old-version limitations. · Checked 2026-11-08

    Opened the primary release highlight and linked Usage section. Synthetic test fixtures are editorial. Runtime evidence is recorded separately; release notes are not a test execution claim.

  4. Implementation-specific

    REST Assured GettingStarted (6.3.0 dependency example) ↗ — REST Assured project · GettingStarted, Maven/Gradle and JSON Schema Validation, opened 8 November 2026. Both rest-assured and json-schema-validator use version 6.3.0 in test scope; JsonPath uses Groovy GPath.

    Version-scoped product behaviour; relevant primary sections opened 6 November 2026. · Checked 2026-11-06

    Official product documentation, not a general standard. Relevant sections and exact release/access limitations are recorded in the V27 full-depth audit. Screens and rolling documentation can change; synthetic Daily List examples are editorial fixtures, not publisher product guarantees.

Deepest material on this page: L4 — Standards & sources. Where a topic stops short of implementation depth, that is a deliberate coverage decision, not an oversight — see coverage.