Skip to content

False positive diff if array has minItems #779

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
danilofuchs opened this issue May 7, 2025 · 0 comments · May be fixed by #780
Open

False positive diff if array has minItems #779

danilofuchs opened this issue May 7, 2025 · 0 comments · May be fixed by #780

Comments

@danilofuchs
Copy link

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                    
--------------------------------------------------------------------------
@danilofuchs danilofuchs linked a pull request May 7, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant