OpenAPITools / openapi-diff

Utility for comparing two OpenAPI specifications.
Apache License 2.0
839 stars 155 forks source link

Does not detect changes when making a field required in API #346

Open mahnazEbrahimi opened 2 years ago

mahnazEbrahimi commented 2 years ago

If change "orientation" field to "required", no changes detected by the tool. Here is new and old api:

Old API

"Chart": {
        "allOf": [
          {
            "$ref": "#/schemas/Visualization"
          },
          {
            "properties": {
              "orientation": {
                "enum": [
                  "VERTICAL",
                  "HORIZONTAL"
                ],
                "type": "string"
              }
            },
            "type": "object"
          }
        ],
        "type": "object"
      },

New API

"Chart": {
        "allOf": [
          {
            "$ref": "#/schemas/Visualization"
          },
          {
            "properties": {
              "orientation": {
                "enum": [
                  "VERTICAL",
                  "HORIZONTAL"
                ],
                "type": "string"
              }
            },
            "type": "object"
          }
        ],
        "required": [
          "orientation"
        ],
        "type": "object"
      },
joschi commented 2 years ago

@mahnazEbrahimi Thanks for creating this issue!

Could you please share the complete or a trimmed down but working OpenAPI spec (new and old) so we can try to reproduce the issue?

mahnazEbrahimi commented 2 years ago

Thank you for your response. Please find the working and not working OpenAPI specs in the following path: https://github.com/mahnazEbrahimi/openapi-specs

In the not_working spec we have changed a schema called "DualAxisChart" which has a parent called "Visualization", it is referenced by our endpoint.

mahnazEbrahimi commented 2 years ago

@joschi Could you please give me an update on this issue? Thank you!

Dogacel commented 1 year ago

We also experience the same issue 👍