An OpenAPI schema formally describes the data type and structure of an API parameter, request, or response in human- and machine-readable form. It can define primitives, arrays, and objects, then constrain required fields, properties, formats, lengths, and additional fields. section 7.1
Constrained Product response
A Product response can require an id string in UUID format, allow an optional name string between 1 and 50 characters, and reject undeclared properties with additionalProperties: false. A schema test compares the actual response with these rules and can also check its content type and headers. section 7.1
responses:
"200":
description: OK #1
content:
application/json: #2
schema: #3
title: Product
required:
- id
type: object
additionalProperties: false #4
properties:
id:
type: string
format: uuid
description: Identifier for the product.
example: dcd53ddb-8104-4e48-8cc0-5df1088c6113
name:
maxLength: 50
minLength: 1
type: string
description: Name of the product.
example: “Acme Uber Dog Rope Toy”
Inspect the OpenAPI response definition showing required fields, property types, UUID formatting, length constraints, examples, and additionalProperties: false. section 7.1
Schemas support automated response testing and validation of client-submitted data. Tightening additionalProperties can help ensure every returned field is documented and limit unexpected data exposure, but may make API evolution rigid; OpenAPI 3.0 defaults it to true. section 7.1 section 10.2.4











































