top of page

JSON Schema allOf Does Not Merge Closed Objects: Test the Added Field

3 days ago
3 min read

A base telemetry object validates until a project adds one approved field. The combined schema still rejects the record, even though the new field has its own definition. Before weakening validation, check whether a closed subschema is treating that field as additional.


Original conceptual illustration: JSON Schema allOf Does Not Merge Closed Objects: Test the Added Field. Not a live installation or software screen.
Original conceptual illustration; not a specific product, live software screen or customer installation.

allOf requires the instance to satisfy each subschema. It does not turn separately closed object definitions into a merged list of allowed fields.

1. Preserve the contract and validation result


Capture the schema document, declared dialect, validator version and a sanitised failing instance. Record the failing keyword and instance location supplied by the validator. A generic “invalid payload” message loses the distinction between a wrong value and a field rejected by the object boundary.


Use the ProSight Software overview to frame the intended monitoring outcome before choosing an integration design. The examples here describe a validation task; they do not claim that a particular ProSight Software deployment exposes a JSON Schema engine, keyword set or editing interface. Confirm actual facilities in the project scope.


JSON Schema's object reference explains that additionalProperties operates with properties and patternProperties in its own subschema. A property recognised elsewhere through allOf may therefore remain additional from the closed base schema's perspective. Read the exact keyword placement rather than only the list of field names visible across the document.


2. Build a minimal synthetic failure


Suppose a base object defines assetId and measurement and sets additionalProperties to false. A second allOf branch defines quality. An object containing all three names can still fail the base branch because that branch has not allowed quality. Requiring every branch to pass does not remove the base restriction.


Keep the example separate from production payloads and use unmistakably synthetic identifiers. Test the base object alone, the extension alone and the intended combination. Save the complete error outputs. This identifies whether the restriction arises at the intended object level or inside a nested structure.


Do not resolve the immediate error by accepting arbitrary fields everywhere. An unplanned field could be an innocent producer update, a spelling mistake or an unrelated mapping. The acceptance contract needs to distinguish those cases rather than allowing the first failed example to determine the policy.


Original explanatory diagram for JSON Schema allOf Does Not Merge Closed Objects: Test the Added Field. Synthetic examples and limitations are explained in the article.
Original explanatory diagram. Examples are illustrative; verify the actual device, interface and application requirements.

3. Choose a design supported by the declared dialect


One design is to define the complete allowed-property set at the object boundary that enforces closure. Another is to use a supported dialect's unevaluatedProperties behaviour, with closure placed to account for successfully evaluated fields across the composition. The correct structure depends on the schema, references and validator support.


The newer keyword is not a universal drop-in fix for an older validator. Confirm the declared dialect and implementation's supported vocabularies, then run both positive and negative fixtures. Keep required-field rules separate: allowing a name does not automatically make that field mandatory.


4. Test the change as an interface revision


Fixture

Acceptance question

Base fields only

Are required fields satisfied?

Approved added field

Does the intended extension validate?

Misspelt field name

Is an unintended property rejected?

Approved name, wrong value type

Does its value rule still apply?


The finite telemetry validation guide addresses a different boundary: whether a parsed numeric result is suitable for measurement processing. A schema-composition repair must not silently remove those independent quality checks.


Does allOf behave like object inheritance?


Not as a merge operation that overrides earlier constraints. Each subschema's requirements remain applicable to the same instance.


Should the producer simply remove the added field?


Only if that matches the approved contract. Dropping meaningful quality information solely to satisfy a misdesigned schema can hide an operational distinction.


5. Recommended related solutions and handover


Use ProSight Software engineered integration scoping when a producer, validator, mapping and reporting path need a shared acceptance contract. Provide the actual schema dialect, redacted sample, error output and required field meanings. Request confirmation of supported implementation facilities before committing to a design.


The handover should retain versioned schemas, positive and negative fixtures and the expected quality outcomes. Those records make a future producer update reviewable without claiming that a successful parse proves the measurement itself is correct.


Primary reference: JSON Schema object constraints and composition. Examples are synthetic and are not live software screens.


Need help with your application?


Send the exact equipment and interface versions, the required outcome and a sanitised example. Ask for a confirmed scope and an acceptance check suited to your application.







Comments


prosight-software-logo (1).png
bottom of page