liveBook · Manning

additionalProperties

As explained in Data-Oriented Programming: Reduce software complexity

additionalProperties is a JSON Schema keyword that controls whether object properties not specified by the schema are allowed.

In JSON Schema, additionalProperties controls whether object fields absent from properties are accepted. They are allowed by default; set it to false for strict validation. section 7.3

A database response with an unwanted field

A book response containing dummy_property passes a schema by default, even when title, isbn, and available are the only declared properties. Adding additionalProperties: false rejects it.

Choose the boundary deliberately:

  • Allow extra request fields when client flexibility is more useful than strict rejection. section 7.3
  • Disallow extra response fields when the server must guarantee exactly the documented shape. section 7.3

How Data-Oriented Programming: Reduce software complexity covers it

How deep it goes
Explains default acceptance, strict rejection with false, and request-versus-response trade-offs without covering advanced schemas.
Examples
Uses book database responses, dummy_property, search metadata, and a strict schema declaring additionalProperties false.
What it assumes
Assumes basic object schemas and required properties, while teaching additionalProperties from its default behavior.
What you can do after
Apply it by choosing whether schemas tolerate or reject undeclared object fields at API boundaries.
How it connects
Connects JSON Schema with object properties, data validation, and API requests and responses.

Also explained in

Compare how 2 books explain additionalProperties →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Data-Oriented Programming: Reduce software complexity. The section links point to the parts of the book it draws on.