Skip to content

Diffing two identical files yields non-empty diff #767

@fenuks

Description

@fenuks

Describe the bug
Diffing certain files without any change returns non-empty diff.

To Reproduce
Steps to reproduce the behavior:
1.

cat << 'EOF' >| test.yml
openapi: 3.0.3
paths:
    /test:
        parameters:
            - $ref: '#/components/parameters/QueryParam'

components:
    parameters:
        QueryParam:
            name: query
            in: query
            required: false
            explode: true
            schema:
                $ref: '#/components/schemas/QuerySchema'
    schemas:
        QuerySchema:
            type: object
            properties:
                query:
                    type: string
EOF
  1. oasdiff --format json diff test.yml{,}
  2. Output
{"paths":{"modified":{"/test":{"parameters":{"modified":{"query":{"query":{"schema":{"type":{"added":["string"],"deleted":["object"]},"properties":{"deleted":["query"]}}}}}}}}}}

Expected behavior
Files are identical, so no difference should be returned.

Desktop (please complete the following information):

  • OS: Linux

Additional context
This regression first appeared in v1.11.6. Error is triggered if parameter name
is the same as name of the expanded parameter from parameter schema.

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