Skip to content

Decreasing maxItems not a breaking change? #760

@VladCananau

Description

@VladCananau

Describe the bug
When you decrease the maxItems property of a an array schema used as a query parameter, oasdiff does not consider it a breaking change.

To Reproduce

openapi: 3.0.3
info:
  title: Repro
  version: "1.0"
paths:
  /api/resources:
    get:
      operationId: get-repro
      parameters:
        - $ref: '#/components/parameters/ids'
      responses:
        '200':
          description: OK
components:
  parameters:
    ids:
      name: ids
      in: query
      required: true
      schema:
        type: array
        uniqueItems: true
        minItems: 1
        maxItems: 50
        items:
          type: string

Change maxItems to 10 and compare

oasdiff diff will give you:

paths:
    modified:
        /api/resources:
            operations:
                modified:
                    GET:
                        parameters:
                            modified:
                                query:
                                    ids:
                                        schema:
                                            maxItems:
                                                from: 50
                                                to: 10

But oasdiff breaking will give no output

Expected behavior
A breaking change should be reported as a client who used to send 50 items in the array will now be broken.

Additional context
oasdiff version 1.11.5

oasdiff checks shows me:

request-parameter-max-items-decreased       error

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions