API Specification: Make the Schema and Example Agree

The example accepts a limit of zero, but the schema says the minimum is one. Before a developer builds against the contract, resolve that mismatch in the specification itself.

Start with the rule a client will follow

The fictional Shelf Catalog specification below describes one operation: GET /books. The optional limit query parameter is an integer from 1 to 50, with an illustrative default of 10. Its success body contains items, each with required id and title strings. This is an original example contract, not a deployed API.

A complete small OpenAPI JSON contract beside valid and invalid limit examples
A complete small OpenAPI JSON contract beside valid and invalid limit examples
Open the full example ↗

Make the example satisfy the same constraints as the schema. A limit of 2 is within the allowed range. A limit of 0 fails the minimum. The reference explains that difference without pretending to send either request.

The OpenAPI 3.1 Schema Object describes input and output data types using JSON Schema concepts. This sample uses those concepts for integer bounds and required response fields. It targets the stated 3.1.0 contract version; it does not claim to use the latest specification version.

Keep the contract in the repository

The complete JSON includes the OpenAPI version, info, placeholder server, path, query parameter, success/error response definitions and reusable schemas. The 200 example has two book objects whose fields match the schema. The illustrative 400 example describes the invalid limit; that error shape is this sample's chosen rule, not a universal convention.

An API specification is more than an attractive reference page. Put the authoritative JSON or YAML in the repository and use the team's actual validator and contract tests before release. This review document does not claim external validator approval or live server conformance. Authentication is explicitly empty for this fictional public-read operation; real access policy, rate limits and version migration remain [TO CONFIRM].

Ask AI to arrange the supplied contract

Create a self-contained HTML API specification review copy.
Authoritative contract location and exact OpenAPI version: [PASTE]
Complete supplied JSON/YAML contract, schema refs and examples: [PASTE]
Confirmed server/access policy, constraints, defaults and known responses: [PASTE]
Conflicts, unspecified operational rules and intended reviewer: [PASTE]

Use only supplied contract facts. Preserve exact versions and property names. Mark missing rules [TO CONFIRM]. Check local references, required properties, types, integer bounds and examples; flag a conflict rather than silently changing it. Include the complete supplied contract as selectable prewrapped code and show concrete valid/invalid examples with reasons. Do not claim an external validator ran or a deployed service conforms. Never include real secrets or send requests.
Use semantic headings, labeled sections, at least16px body text and no horizontal overflow at360px. Inline CSS only; no scripts, external assets, network, request runners or fake copy controls. Keep the repository JSON/YAML authoritative. Return complete HTML, inconsistencies and checks still required.

Resolve the mismatch before someone implements it

Ask the API owner whether the bound or example represents the intended behavior. If the constraints and examples are hard to compare, read them together in the prepared HTML review copy in NOS, then correct the repository specification.

Send the corrected contract and the decision behind it. Tell the receiving developer what changed and run the normal contract checks before release; changing a review page does not notify them or prove server behavior.

Keep reading