Summary
Migrate the OpenAPI specification from 3.0.3 to 3.1+ to enable proper use of unevaluatedProperties: false for strict request validation in schemas that use allOf composition.
Background
TMI uses allOf composition in the OpenAPI spec to:
- Separate request-only and response-only fields (e.g.,
DfdDiagramInput vs DfdDiagram)
- Compose schemas from base types (e.g.,
Node extends Cell)
The Problem
In OpenAPI 3.0 / JSON Schema draft-07, additionalProperties: false at the top level of a schema with allOf causes validation to reject properties that ARE defined in the referenced schemas. This is because additionalProperties applies to the local schema level, not the merged result.
Example: The Node schema had:
{
"allOf": [
{ "$ref": "#/components/schemas/Cell" },
{
"properties": {
"angle": { "type": "number" },
...
}
}
],
"additionalProperties": false // This rejects "angle" even though it's defined above!
}
Current Workaround
We removed additionalProperties: false from schemas that use allOf:
Node
Edge
DfdDiagram
DfdDiagramInput
Note
Asset
ExtendedAsset
This allows X6 diagram properties (like angle, zIndex, etc.) to pass validation, but loses strict validation on these schemas.
Solution
OpenAPI 3.1 (based on JSON Schema 2020-12) introduces unevaluatedProperties: false, which is designed to work correctly with schema composition. It considers properties from all composed schemas as "evaluated" and only rejects truly unknown properties.
Blocked By
Tasks
References
Labels
- enhancement
- schema
- blocked
Summary
Migrate the OpenAPI specification from 3.0.3 to 3.1+ to enable proper use of
unevaluatedProperties: falsefor strict request validation in schemas that useallOfcomposition.Background
TMI uses
allOfcomposition in the OpenAPI spec to:DfdDiagramInputvsDfdDiagram)NodeextendsCell)The Problem
In OpenAPI 3.0 / JSON Schema draft-07,
additionalProperties: falseat the top level of a schema withallOfcauses validation to reject properties that ARE defined in the referenced schemas. This is becauseadditionalPropertiesapplies to the local schema level, not the merged result.Example: The
Nodeschema had:{ "allOf": [ { "$ref": "#/components/schemas/Cell" }, { "properties": { "angle": { "type": "number" }, ... } } ], "additionalProperties": false // This rejects "angle" even though it's defined above! }Current Workaround
We removed
additionalProperties: falsefrom schemas that useallOf:NodeEdgeDfdDiagramDfdDiagramInputNoteAssetExtendedAssetThis allows X6 diagram properties (like
angle,zIndex, etc.) to pass validation, but loses strict validation on these schemas.Solution
OpenAPI 3.1 (based on JSON Schema 2020-12) introduces
unevaluatedProperties: false, which is designed to work correctly with schema composition. It considers properties from all composed schemas as "evaluated" and only rejects truly unknown properties.Blocked By
Tasks
openapifield in spec from3.0.3to3.1.0additionalProperties: falsewithunevaluatedProperties: falsein affected schemastype: ["string", "null"]syntax (3.1 change)References
Labels