openapi-diff icon indicating copy to clipboard operation
openapi-diff copied to clipboard

Does not detect changes when making a field required in API

Open mahnazEbrahimi opened this issue 2 years ago • 4 comments

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"
      },

mahnazEbrahimi avatar Mar 04 '22 10:03 mahnazEbrahimi

@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?

joschi avatar Mar 04 '22 11:03 joschi

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 avatar Mar 04 '22 14:03 mahnazEbrahimi

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

mahnazEbrahimi avatar Apr 12 '22 08:04 mahnazEbrahimi

We also experience the same issue 👍

Dogacel avatar Mar 06 '23 15:03 Dogacel