Given this simple schema, with a body containing a property with type array and minItems: 2
{
"openapi": "3.1.0",
"info": {
"version": "1.0.0",
"title": "Example"
},
"paths": {
"/assets/merge": {
"post": {
"operationId": "mergeAssets",
"tags": ["Management Assets"],
"description": "Merges multiple assets into one",
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": ["object"],
"properties": {
"assetIds": {
"type": ["array"],
"items": {
"type": ["string"]
},
"minItems": 2
}
},
"required": ["assetIds"]
}
}
},
"required": true
},
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": ["object"],
"properties": {
"mergedAssetId": {
"type": ["string"]
}
},
"required": ["mergedAssetId"]
}
}
}
}
},
"deprecated": false,
"parameters": []
}
}
}
}
docker run --rm -t \
-v $(pwd)/specs:/specs \
openapitools/openapi-diff:latest \
/specs/o.json \
/specs/o.json
==========================================================================
== API CHANGE LOG ==
==========================================================================
Example
--------------------------------------------------------------------------
-- What's Changed --
--------------------------------------------------------------------------
- POST /assets/merge
Request:
- Changed application/json
Schema: Backward compatible
--------------------------------------------------------------------------
-- Result --
--------------------------------------------------------------------------
API changes are backward compatible
--------------------------------------------------------------------------
Given this simple schema, with a body containing a property with type
arrayandminItems: 2{ "openapi": "3.1.0", "info": { "version": "1.0.0", "title": "Example" }, "paths": { "/assets/merge": { "post": { "operationId": "mergeAssets", "tags": ["Management Assets"], "description": "Merges multiple assets into one", "requestBody": { "content": { "application/json": { "schema": { "type": ["object"], "properties": { "assetIds": { "type": ["array"], "items": { "type": ["string"] }, "minItems": 2 } }, "required": ["assetIds"] } } }, "required": true }, "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "type": ["object"], "properties": { "mergedAssetId": { "type": ["string"] } }, "required": ["mergedAssetId"] } } } } }, "deprecated": false, "parameters": [] } } } }docker run --rm -t \ -v $(pwd)/specs:/specs \ openapitools/openapi-diff:latest \ /specs/o.json \ /specs/o.json ========================================================================== == API CHANGE LOG == ========================================================================== Example -------------------------------------------------------------------------- -- What's Changed -- -------------------------------------------------------------------------- - POST /assets/merge Request: - Changed application/json Schema: Backward compatible -------------------------------------------------------------------------- -- Result -- -------------------------------------------------------------------------- API changes are backward compatible --------------------------------------------------------------------------