Skip to content

Introduce check concept from "Azure/openapi-diff" project #26

Open
@jmini

Description

@jmini

The project Azure/openapi-diff produce following output when two versions of a spec are compared: a list of items (error, warning, info) is computed.

Example:

$ oad compare old/added_path.json new/added_path.json
{
  "id": "1001",
  "code": "NoVersionChange",
  "message": "The versions have not changed.",
  "jsonref": "#",
  "json-path": "#",
  "type": "Info"
}
{
  "id": "1039",
  "code": "AddedOperation",
  "message": "The new version is adding an operation that was not found in the old version.",
  "jsonref": "#/paths/~1api~1Operations/post",
  "json-path": "#/paths/api/Operations/post",
  "type": "Info"
}
{
  "id": "1038",
  "code": "AddedPath",
  "message": "The new version is adding a path that was not found in the old version.",
  "jsonref": "#/paths/~1api~1Paths",
  "json-path": "#/paths/api/Paths",
  "type": "Info"
}

The list of rules that are currently checked can be found in their git repository: docs
I had a look at their test suite in this folder: Swagger

To run their the oad tool against it, I had to perform some changes: Azure/openapi-diff#108
Then I have converted the old Swagger 2.0 format to OpenAPI 3.0.1 format.

Of course, I will share my work.
We can then continue the discussion and see how this could be integrated.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions