Skip to content

Comparing OpenAPI 3.0.1 to 3.1.0 does not work #755

Open
@codesimplicity

Description

@codesimplicity

When running a comparison between OpenAPI 3.0.1 and 3.1.0 via Docker, it looks like everything is reported as different.

Suppressing the details gives this:

$ docker run --rm -t -v .:/specs:ro  openapitools/openapi-diff /specs/api-docs-301.json /specs/api-docs-310.json --state
incompatible

ℹ Please note that those spec files are identical, only the initial OpenAPI version differs:

  • "openapi": "3.0.1"
  • "openapi": "3.1.0"

Comparing two specs with OpenAPI 3.1.0 seems to work as desired. ✅

I used latest which appears to be 6 weeks old - cannot get the version from the tool itself 🤷


Running the same via openapi-diff installed from brew shows a different error:

$ openapi-diff api-docs-301.json api-docs-310.json 
Unexpected exception. Reason: Cannot read new OpenAPI spec
java.lang.RuntimeException: Cannot read new OpenAPI spec
        at org.openapitools.openapidiff.core.OpenApiCompare.notNull(OpenApiCompare.java:107)
        at org.openapitools.openapidiff.core.OpenApiCompare.fromSpecifications(OpenApiCompare.java:102)
        at org.openapitools.openapidiff.core.OpenApiCompare.fromLocations(OpenApiCompare.java:91)
        at org.openapitools.openapidiff.cli.Main.main(Main.java:174)

But this also does not work with two OpenAPI 3.1.0 specs:

$ openapi-diff api-docs-310.json api-docs-310.json 
Unexpected exception. Reason: Cannot read old OpenAPI spec
java.lang.RuntimeException: Cannot read old OpenAPI spec

Brew shows this to be version 2.0.1 - cannot get the version from the tool itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions