// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`generateEndpointSpecPatches OAS version 3.0.1 3.0.x exclusiveMaximum and exclusiveMinimum booleans 1`] = `
[
  {
    "bodyPath": "/paths/~1api~1animals/post/responses/200/content/application~1json",
    "example": 20,
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"no":10},{"no":20}]}",
          "contentType": "application/json",
          "size": 30,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/properties/no/maximum",
    "schemaPath": "/properties/data/items/properties/no/maximum",
    "unpatchable": true,
    "validationError": {
      "instancePath": "/data/1/no",
      "keyword": "maximum",
      "message": "must be <= 19",
      "params": {
        "comparison": "<=",
        "limit": 19,
      },
      "schemaPath": "#/properties/data/items/properties/no/maximum",
    },
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 3.0.x exclusiveMaximum and exclusiveMinimum booleans 2`] = `
{
  "info": {},
  "openapi": "3.0.1",
  "paths": {
    "/api/animals": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "properties": {
                          "no": {
                            "exclusiveMaximum": true,
                            "exclusiveMinumum": true,
                            "maximum": 20,
                            "minumum": 10,
                            "type": "number",
                          },
                        },
                        "required": [
                          "no",
                        ],
                        "type": "object",
                      },
                      "type": "array",
                    },
                  },
                  "type": "object",
                },
              },
            },
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 allOf allOf in a property 1`] = `
[
  {
    "description": "update response body: add property as",
    "diff": {
      "description": "'as' is not documented",
      "example": 12,
      "instancePath": "/data/asda/as",
      "key": "as",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/data/allOf/1/properties/asda/properties",
      "propertyExamplePath": "/data/asda/as",
      "propertyPath": "/properties/data/allOf/1/properties/asda/properties/as",
    },
    "groupedOperations": [
      {
        "extra": "same",
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/allOf/1/properties/asda/required",
        "value": [
          "as",
        ],
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/allOf/1/properties/asda/properties/as",
        "value": {
          "type": "number",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":{"status":"ok","name":"me","age":50,"asda":{"as":12}}}",
          "contentType": "application/json",
          "size": 62,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property age",
    "diff": {
      "description": "'age' is not documented",
      "example": 50,
      "instancePath": "/data/age",
      "key": "age",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/data/allOf/0/properties",
      "propertyExamplePath": "/data/age",
      "propertyPath": "/properties/data/allOf/0/properties/age",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/allOf/0/required/-",
        "value": "age",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/allOf/0/properties/age",
        "value": {
          "type": "number",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":{"status":"ok","name":"me","age":50,"asda":{"as":12}}}",
          "contentType": "application/json",
          "size": 62,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 allOf allOf in a property 2`] = `
{
  "info": {},
  "openapi": "3.0.1",
  "paths": {
    "/api/animals": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "allOf": [
                        {
                          "properties": {
                            "age": {
                              "type": "number",
                            },
                            "status": {
                              "type": "string",
                            },
                          },
                          "required": [
                            "status",
                            "age",
                          ],
                          "type": "object",
                        },
                        {
                          "properties": {
                            "asda": {
                              "properties": {
                                "as": {
                                  "type": "number",
                                },
                              },
                              "required": [
                                "as",
                              ],
                              "type": "object",
                            },
                            "name": {
                              "type": "string",
                            },
                          },
                          "type": "object",
                        },
                      ],
                    },
                  },
                  "type": "object",
                },
              },
            },
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 allOf matching interaction 1`] = `[]`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 allOf matching interaction 2`] = `
{
  "info": {},
  "openapi": "3.0.1",
  "paths": {
    "/api/animals": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "age": {
                          "type": "number",
                        },
                        "status": {
                          "type": "string",
                        },
                      },
                      "required": [
                        "status",
                      ],
                      "type": "object",
                    },
                    {
                      "properties": {
                        "name": {
                          "type": "string",
                        },
                      },
                      "type": "object",
                    },
                  ],
                },
              },
            },
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 allOf with extra keys in interaction 1`] = `
[
  {
    "description": "update response body: add property as",
    "diff": {
      "description": "'as' is not documented",
      "example": 12,
      "instancePath": "/asda/as",
      "key": "as",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/allOf/1/properties/asda/properties",
      "propertyExamplePath": "/asda/as",
      "propertyPath": "/allOf/1/properties/asda/properties/as",
    },
    "groupedOperations": [
      {
        "extra": "same",
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/allOf/1/properties/asda/required",
        "value": [
          "as",
        ],
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/allOf/1/properties/asda/properties/as",
        "value": {
          "type": "number",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"status":"ok","name":"me","age":50,"asda":{"as":12}}",
          "contentType": "application/json",
          "size": 53,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property age",
    "diff": {
      "description": "'age' is not documented",
      "example": 50,
      "instancePath": "/age",
      "key": "age",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/allOf/0/properties",
      "propertyExamplePath": "/age",
      "propertyPath": "/allOf/0/properties/age",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/allOf/0/required/-",
        "value": "age",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/allOf/0/properties/age",
        "value": {
          "type": "number",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"status":"ok","name":"me","age":50,"asda":{"as":12}}",
          "contentType": "application/json",
          "size": 53,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 allOf with extra keys in interaction 2`] = `
{
  "info": {},
  "openapi": "3.0.1",
  "paths": {
    "/api/animals": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "age": {
                          "type": "number",
                        },
                        "status": {
                          "type": "string",
                        },
                      },
                      "required": [
                        "status",
                        "age",
                      ],
                      "type": "object",
                    },
                    {
                      "properties": {
                        "asda": {
                          "properties": {
                            "as": {
                              "type": "number",
                            },
                          },
                          "required": [
                            "as",
                          ],
                          "type": "object",
                        },
                        "name": {
                          "type": "string",
                        },
                      },
                      "type": "object",
                    },
                  ],
                },
              },
            },
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 allOf with missing keys in interaction 1`] = `
[
  {
    "description": "update response body: make property name optional",
    "diff": {
      "description": "required property 'name' was missing",
      "example": undefined,
      "instancePath": "/name",
      "key": "name",
      "keyword": "required",
      "kind": "MissingRequiredProperty",
      "parentObjectPath": "/allOf/1",
      "propertyPath": "/allOf/1/properties/name",
    },
    "groupedOperations": [
      {
        "op": "remove",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/allOf/1/required/0",
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"status":"ok"}",
          "contentType": "application/json",
          "size": 15,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 allOf with missing keys in interaction 2`] = `
{
  "info": {},
  "openapi": "3.0.1",
  "paths": {
    "/api/animals": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "status": {
                          "type": "string",
                        },
                      },
                      "required": [
                        "status",
                      ],
                      "type": "object",
                    },
                    {
                      "properties": {
                        "name": {
                          "type": "string",
                        },
                      },
                      "required": [],
                      "type": "object",
                    },
                  ],
                },
              },
            },
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 allOf with nested oneOf 1`] = `
[
  {
    "description": "update response body: add property results",
    "diff": {
      "description": "'results' is not documented",
      "example": [
        "123",
        "355",
        34,
      ],
      "instancePath": "/results",
      "key": "results",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/allOf/0/oneOf/0/properties",
      "propertyExamplePath": "/results",
      "propertyPath": "/allOf/0/oneOf/0/properties/results",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/allOf/0/oneOf/0/required/-",
        "value": "results",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/allOf/0/oneOf/0/properties/results",
        "value": {
          "items": {
            "type": "string",
          },
          "type": "array",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"hello":"ok","goodbye":"me","results":["123","355",34]}",
          "contentType": "application/json",
          "size": 56,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: make items oneOf",
    "diff": {
      "description": "'items' did not match schema",
      "example": 34,
      "expectedType": "string",
      "instancePath": "/results/2",
      "key": "items",
      "keyword": "type",
      "kind": "UnmatchedType",
      "propertyPath": "/allOf/0/oneOf/0/properties/results/items",
    },
    "groupedOperations": [
      {
        "op": "remove",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/allOf/0/oneOf/0/properties/results/items/type",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/allOf/0/oneOf/0/properties/results/items/oneOf",
        "value": [
          {
            "type": "string",
          },
          {
            "type": "number",
          },
        ],
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"hello":"ok","goodbye":"me","results":["123","355",34]}",
          "contentType": "application/json",
          "size": 56,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 allOf with nested oneOf 2`] = `
{
  "info": {},
  "openapi": "3.0.1",
  "paths": {
    "/api/animals": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "oneOf": [
                        {
                          "properties": {
                            "goodbye": {
                              "type": "string",
                            },
                            "hello": {
                              "type": "string",
                            },
                            "results": {
                              "items": {
                                "oneOf": [
                                  {
                                    "type": "string",
                                  },
                                  {
                                    "type": "number",
                                  },
                                ],
                              },
                              "type": "array",
                            },
                          },
                          "required": [
                            "hello",
                            "goodbye",
                            "results",
                          ],
                          "type": "object",
                        },
                      ],
                    },
                  ],
                },
              },
            },
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 allOf with nullable 1`] = `[]`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 allOf with nullable 2`] = `
{
  "info": {},
  "openapi": "3.0.1",
  "paths": {
    "/api/animals": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "key": {
                      "allOf": [
                        {
                          "properties": {
                            "goodbye": {
                              "type": "string",
                            },
                            "hello": {
                              "type": "string",
                            },
                          },
                          "required": [
                            "hello",
                            "goodbye",
                          ],
                          "type": "object",
                        },
                      ],
                      "nullable": true,
                    },
                  },
                  "required": [
                    "key",
                  ],
                  "type": "object",
                },
              },
            },
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 anyOf with nullable 1`] = `[]`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 anyOf with nullable 2`] = `
{
  "info": {},
  "openapi": "3.0.1",
  "paths": {
    "/api/animals": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "key": {
                      "anyOf": [
                        {
                          "properties": {
                            "goodbye": {
                              "type": "string",
                            },
                            "hello": {
                              "type": "string",
                            },
                          },
                          "required": [
                            "hello",
                            "goodbye",
                          ],
                          "type": "object",
                        },
                      ],
                      "nullable": true,
                    },
                  },
                  "required": [
                    "key",
                  ],
                  "type": "object",
                },
              },
            },
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 array with multiple items 1`] = `
[
  {
    "description": "update response body: add property books",
    "diff": {
      "description": "'books' is not documented",
      "example": [
        {
          "author_id": "6nTxAFM5ck4Hob77hGQoL",
          "id": "WjE9O1d8ELCb8POiOw4pn",
          "price": 10,
        },
        {
          "id": "asdf",
          "price": 1,
        },
        {
          "author_id": "6nTxAFM5ck4Hob77hGQoL",
          "id": "123",
        },
        null,
      ],
      "instancePath": "/books",
      "key": "books",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties",
      "propertyExamplePath": "/books",
      "propertyPath": "/properties/books",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties",
        "value": {},
      },
      {
        "extra": "same",
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/required",
        "value": [
          "books",
        ],
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books",
        "value": {
          "items": {
            "type": "object",
          },
          "type": "array",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"books":[{"id":"WjE9O1d8ELCb8POiOw4pn","author_id":"6nTxAFM5ck4Hob77hGQoL","price":10},{"id":"asdf","price":1},{"id":"123","author_id":"6nTxAFM5ck4Hob77hGQoL"},null]}",
          "contentType": "application/json",
          "size": 167,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property id",
    "diff": {
      "description": "'id' is not documented",
      "example": "WjE9O1d8ELCb8POiOw4pn",
      "instancePath": "/books/0/id",
      "key": "id",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/books/items/properties",
      "propertyExamplePath": "/books/0/id",
      "propertyPath": "/properties/books/items/properties/id",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/properties",
        "value": {},
      },
      {
        "extra": "same",
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/required",
        "value": [
          "id",
        ],
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/properties/id",
        "value": {
          "type": "string",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"books":[{"id":"WjE9O1d8ELCb8POiOw4pn","author_id":"6nTxAFM5ck4Hob77hGQoL","price":10},{"id":"asdf","price":1},{"id":"123","author_id":"6nTxAFM5ck4Hob77hGQoL"},null]}",
          "contentType": "application/json",
          "size": 167,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property author_id",
    "diff": {
      "description": "'author_id' is not documented",
      "example": "6nTxAFM5ck4Hob77hGQoL",
      "instancePath": "/books/0/author_id",
      "key": "author_id",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/books/items/properties",
      "propertyExamplePath": "/books/0/author_id",
      "propertyPath": "/properties/books/items/properties/author_id",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/required/-",
        "value": "author_id",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/properties/author_id",
        "value": {
          "type": "string",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"books":[{"id":"WjE9O1d8ELCb8POiOw4pn","author_id":"6nTxAFM5ck4Hob77hGQoL","price":10},{"id":"asdf","price":1},{"id":"123","author_id":"6nTxAFM5ck4Hob77hGQoL"},null]}",
          "contentType": "application/json",
          "size": 167,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property price",
    "diff": {
      "description": "'price' is not documented",
      "example": 10,
      "instancePath": "/books/0/price",
      "key": "price",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/books/items/properties",
      "propertyExamplePath": "/books/0/price",
      "propertyPath": "/properties/books/items/properties/price",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/required/-",
        "value": "price",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/properties/price",
        "value": {
          "type": "number",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"books":[{"id":"WjE9O1d8ELCb8POiOw4pn","author_id":"6nTxAFM5ck4Hob77hGQoL","price":10},{"id":"asdf","price":1},{"id":"123","author_id":"6nTxAFM5ck4Hob77hGQoL"},null]}",
          "contentType": "application/json",
          "size": 167,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: make items null",
    "diff": {
      "description": "'items' did not match schema",
      "example": null,
      "expectedType": "object",
      "instancePath": "/books/3",
      "key": "items",
      "keyword": "type",
      "kind": "UnmatchedType",
      "propertyPath": "/properties/books/items",
    },
    "groupedOperations": [
      {
        "op": "replace",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/nullable",
        "value": true,
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"books":[{"id":"WjE9O1d8ELCb8POiOw4pn","author_id":"6nTxAFM5ck4Hob77hGQoL","price":10},{"id":"asdf","price":1},{"id":"123","author_id":"6nTxAFM5ck4Hob77hGQoL"},null]}",
          "contentType": "application/json",
          "size": 167,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: make property author_id optional",
    "diff": {
      "description": "required property 'author_id' was missing",
      "example": undefined,
      "instancePath": "/books/1/author_id",
      "key": "author_id",
      "keyword": "required",
      "kind": "MissingRequiredProperty",
      "parentObjectPath": "/properties/books/items",
      "propertyPath": "/properties/books/items/properties/author_id",
    },
    "groupedOperations": [
      {
        "op": "remove",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/required/1",
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"books":[{"id":"WjE9O1d8ELCb8POiOw4pn","author_id":"6nTxAFM5ck4Hob77hGQoL","price":10},{"id":"asdf","price":1},{"id":"123","author_id":"6nTxAFM5ck4Hob77hGQoL"},null]}",
          "contentType": "application/json",
          "size": 167,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: make property price optional",
    "diff": {
      "description": "required property 'price' was missing",
      "example": undefined,
      "instancePath": "/books/2/price",
      "key": "price",
      "keyword": "required",
      "kind": "MissingRequiredProperty",
      "parentObjectPath": "/properties/books/items",
      "propertyPath": "/properties/books/items/properties/price",
    },
    "groupedOperations": [
      {
        "op": "remove",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/required/1",
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"books":[{"id":"WjE9O1d8ELCb8POiOw4pn","author_id":"6nTxAFM5ck4Hob77hGQoL","price":10},{"id":"asdf","price":1},{"id":"123","author_id":"6nTxAFM5ck4Hob77hGQoL"},null]}",
          "contentType": "application/json",
          "size": 167,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 array with multiple items 2`] = `
{
  "info": {},
  "openapi": "3.0.1",
  "paths": {
    "/api/animals": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "books": {
                      "items": {
                        "nullable": true,
                        "properties": {
                          "author_id": {
                            "type": "string",
                          },
                          "id": {
                            "type": "string",
                          },
                          "price": {
                            "type": "number",
                          },
                        },
                        "required": [
                          "id",
                        ],
                        "type": "object",
                      },
                      "type": "array",
                    },
                  },
                  "required": [
                    "books",
                  ],
                  "type": "object",
                },
              },
            },
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 collects unpatchable diffs 1`] = `
[
  {
    "bodyPath": "/paths/~1api~1animals/post/responses/200/content/application~1json",
    "example": "not-ok",
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"status":"ok"},{"status":"not-ok"}]}",
          "contentType": "application/json",
          "size": 46,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/properties/status/const",
    "schemaPath": "/properties/data/items/properties/status/const",
    "unpatchable": true,
    "validationError": {
      "instancePath": "/data/1/status",
      "keyword": "const",
      "message": "must be equal to constant",
      "params": {
        "allowedValue": "ok",
      },
      "schemaPath": "#/properties/data/items/properties/status/const",
    },
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 collects unpatchable diffs 2`] = `
{
  "info": {},
  "openapi": "3.0.1",
  "paths": {
    "/api/animals": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "properties": {
                          "status": {
                            "const": "ok",
                            "type": "string",
                          },
                        },
                        "required": [
                          "status",
                        ],
                        "type": "object",
                      },
                      "type": "array",
                    },
                  },
                  "type": "object",
                },
              },
            },
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 existing schema that does not match 1`] = `
[
  {
    "description": "update response body: make property data optional",
    "diff": {
      "description": "required property 'data' was missing",
      "example": undefined,
      "instancePath": "/data",
      "key": "data",
      "keyword": "required",
      "kind": "MissingRequiredProperty",
      "parentObjectPath": "",
      "propertyPath": "/properties/data",
    },
    "groupedOperations": [
      {
        "op": "remove",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/required/0",
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"books":[{"id":"WjE9O1d8ELCb8POiOw4pn","name":"Pride and Prejudice","author_id":"6nTxAFM5ck4Hob77hGQoL","price":10,"created_at":"2023-01-22T17:17:41.326Z","updated_at":"2023-01-22T17:17:41.326Z"},{"id":"vZsYVmzdxtihxQNqCs-3f","name":"The Great Gatsby","author_id":"NjpTwgmENj11rGdUgpCQ9","price":15,"created_at":"2022-10-22T10:11:51.421Z","updated_at":"2022-10-22T10:11:51.421Z"}]}",
          "contentType": "application/json",
          "size": 382,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: make property next optional",
    "diff": {
      "description": "required property 'next' was missing",
      "example": undefined,
      "instancePath": "/next",
      "key": "next",
      "keyword": "required",
      "kind": "MissingRequiredProperty",
      "parentObjectPath": "",
      "propertyPath": "/properties/next",
    },
    "groupedOperations": [
      {
        "op": "remove",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/required/0",
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"books":[{"id":"WjE9O1d8ELCb8POiOw4pn","name":"Pride and Prejudice","author_id":"6nTxAFM5ck4Hob77hGQoL","price":10,"created_at":"2023-01-22T17:17:41.326Z","updated_at":"2023-01-22T17:17:41.326Z"},{"id":"vZsYVmzdxtihxQNqCs-3f","name":"The Great Gatsby","author_id":"NjpTwgmENj11rGdUgpCQ9","price":15,"created_at":"2022-10-22T10:11:51.421Z","updated_at":"2022-10-22T10:11:51.421Z"}]}",
          "contentType": "application/json",
          "size": 382,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: make property has_more_data optional",
    "diff": {
      "description": "required property 'has_more_data' was missing",
      "example": undefined,
      "instancePath": "/has_more_data",
      "key": "has_more_data",
      "keyword": "required",
      "kind": "MissingRequiredProperty",
      "parentObjectPath": "",
      "propertyPath": "/properties/has_more_data",
    },
    "groupedOperations": [
      {
        "op": "remove",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/required/0",
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"books":[{"id":"WjE9O1d8ELCb8POiOw4pn","name":"Pride and Prejudice","author_id":"6nTxAFM5ck4Hob77hGQoL","price":10,"created_at":"2023-01-22T17:17:41.326Z","updated_at":"2023-01-22T17:17:41.326Z"},{"id":"vZsYVmzdxtihxQNqCs-3f","name":"The Great Gatsby","author_id":"NjpTwgmENj11rGdUgpCQ9","price":15,"created_at":"2022-10-22T10:11:51.421Z","updated_at":"2022-10-22T10:11:51.421Z"}]}",
          "contentType": "application/json",
          "size": 382,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property books",
    "diff": {
      "description": "'books' is not documented",
      "example": [
        {
          "author_id": "6nTxAFM5ck4Hob77hGQoL",
          "created_at": "2023-01-22T17:17:41.326Z",
          "id": "WjE9O1d8ELCb8POiOw4pn",
          "name": "Pride and Prejudice",
          "price": 10,
          "updated_at": "2023-01-22T17:17:41.326Z",
        },
        {
          "author_id": "NjpTwgmENj11rGdUgpCQ9",
          "created_at": "2022-10-22T10:11:51.421Z",
          "id": "vZsYVmzdxtihxQNqCs-3f",
          "name": "The Great Gatsby",
          "price": 15,
          "updated_at": "2022-10-22T10:11:51.421Z",
        },
      ],
      "instancePath": "/books",
      "key": "books",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties",
      "propertyExamplePath": "/books",
      "propertyPath": "/properties/books",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/required/-",
        "value": "books",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books",
        "value": {
          "items": {
            "type": "object",
          },
          "type": "array",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"books":[{"id":"WjE9O1d8ELCb8POiOw4pn","name":"Pride and Prejudice","author_id":"6nTxAFM5ck4Hob77hGQoL","price":10,"created_at":"2023-01-22T17:17:41.326Z","updated_at":"2023-01-22T17:17:41.326Z"},{"id":"vZsYVmzdxtihxQNqCs-3f","name":"The Great Gatsby","author_id":"NjpTwgmENj11rGdUgpCQ9","price":15,"created_at":"2022-10-22T10:11:51.421Z","updated_at":"2022-10-22T10:11:51.421Z"}]}",
          "contentType": "application/json",
          "size": 382,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property id",
    "diff": {
      "description": "'id' is not documented",
      "example": "WjE9O1d8ELCb8POiOw4pn",
      "instancePath": "/books/0/id",
      "key": "id",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/books/items/properties",
      "propertyExamplePath": "/books/0/id",
      "propertyPath": "/properties/books/items/properties/id",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/properties",
        "value": {},
      },
      {
        "extra": "same",
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/required",
        "value": [
          "id",
        ],
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/properties/id",
        "value": {
          "type": "string",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"books":[{"id":"WjE9O1d8ELCb8POiOw4pn","name":"Pride and Prejudice","author_id":"6nTxAFM5ck4Hob77hGQoL","price":10,"created_at":"2023-01-22T17:17:41.326Z","updated_at":"2023-01-22T17:17:41.326Z"},{"id":"vZsYVmzdxtihxQNqCs-3f","name":"The Great Gatsby","author_id":"NjpTwgmENj11rGdUgpCQ9","price":15,"created_at":"2022-10-22T10:11:51.421Z","updated_at":"2022-10-22T10:11:51.421Z"}]}",
          "contentType": "application/json",
          "size": 382,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property name",
    "diff": {
      "description": "'name' is not documented",
      "example": "Pride and Prejudice",
      "instancePath": "/books/0/name",
      "key": "name",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/books/items/properties",
      "propertyExamplePath": "/books/0/name",
      "propertyPath": "/properties/books/items/properties/name",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/required/-",
        "value": "name",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/properties/name",
        "value": {
          "type": "string",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"books":[{"id":"WjE9O1d8ELCb8POiOw4pn","name":"Pride and Prejudice","author_id":"6nTxAFM5ck4Hob77hGQoL","price":10,"created_at":"2023-01-22T17:17:41.326Z","updated_at":"2023-01-22T17:17:41.326Z"},{"id":"vZsYVmzdxtihxQNqCs-3f","name":"The Great Gatsby","author_id":"NjpTwgmENj11rGdUgpCQ9","price":15,"created_at":"2022-10-22T10:11:51.421Z","updated_at":"2022-10-22T10:11:51.421Z"}]}",
          "contentType": "application/json",
          "size": 382,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property author_id",
    "diff": {
      "description": "'author_id' is not documented",
      "example": "6nTxAFM5ck4Hob77hGQoL",
      "instancePath": "/books/0/author_id",
      "key": "author_id",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/books/items/properties",
      "propertyExamplePath": "/books/0/author_id",
      "propertyPath": "/properties/books/items/properties/author_id",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/required/-",
        "value": "author_id",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/properties/author_id",
        "value": {
          "type": "string",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"books":[{"id":"WjE9O1d8ELCb8POiOw4pn","name":"Pride and Prejudice","author_id":"6nTxAFM5ck4Hob77hGQoL","price":10,"created_at":"2023-01-22T17:17:41.326Z","updated_at":"2023-01-22T17:17:41.326Z"},{"id":"vZsYVmzdxtihxQNqCs-3f","name":"The Great Gatsby","author_id":"NjpTwgmENj11rGdUgpCQ9","price":15,"created_at":"2022-10-22T10:11:51.421Z","updated_at":"2022-10-22T10:11:51.421Z"}]}",
          "contentType": "application/json",
          "size": 382,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property price",
    "diff": {
      "description": "'price' is not documented",
      "example": 10,
      "instancePath": "/books/0/price",
      "key": "price",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/books/items/properties",
      "propertyExamplePath": "/books/0/price",
      "propertyPath": "/properties/books/items/properties/price",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/required/-",
        "value": "price",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/properties/price",
        "value": {
          "type": "number",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"books":[{"id":"WjE9O1d8ELCb8POiOw4pn","name":"Pride and Prejudice","author_id":"6nTxAFM5ck4Hob77hGQoL","price":10,"created_at":"2023-01-22T17:17:41.326Z","updated_at":"2023-01-22T17:17:41.326Z"},{"id":"vZsYVmzdxtihxQNqCs-3f","name":"The Great Gatsby","author_id":"NjpTwgmENj11rGdUgpCQ9","price":15,"created_at":"2022-10-22T10:11:51.421Z","updated_at":"2022-10-22T10:11:51.421Z"}]}",
          "contentType": "application/json",
          "size": 382,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property created_at",
    "diff": {
      "description": "'created_at' is not documented",
      "example": "2023-01-22T17:17:41.326Z",
      "instancePath": "/books/0/created_at",
      "key": "created_at",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/books/items/properties",
      "propertyExamplePath": "/books/0/created_at",
      "propertyPath": "/properties/books/items/properties/created_at",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/required/-",
        "value": "created_at",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/properties/created_at",
        "value": {
          "type": "string",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"books":[{"id":"WjE9O1d8ELCb8POiOw4pn","name":"Pride and Prejudice","author_id":"6nTxAFM5ck4Hob77hGQoL","price":10,"created_at":"2023-01-22T17:17:41.326Z","updated_at":"2023-01-22T17:17:41.326Z"},{"id":"vZsYVmzdxtihxQNqCs-3f","name":"The Great Gatsby","author_id":"NjpTwgmENj11rGdUgpCQ9","price":15,"created_at":"2022-10-22T10:11:51.421Z","updated_at":"2022-10-22T10:11:51.421Z"}]}",
          "contentType": "application/json",
          "size": 382,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property updated_at",
    "diff": {
      "description": "'updated_at' is not documented",
      "example": "2023-01-22T17:17:41.326Z",
      "instancePath": "/books/0/updated_at",
      "key": "updated_at",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/books/items/properties",
      "propertyExamplePath": "/books/0/updated_at",
      "propertyPath": "/properties/books/items/properties/updated_at",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/required/-",
        "value": "updated_at",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/properties/updated_at",
        "value": {
          "type": "string",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"books":[{"id":"WjE9O1d8ELCb8POiOw4pn","name":"Pride and Prejudice","author_id":"6nTxAFM5ck4Hob77hGQoL","price":10,"created_at":"2023-01-22T17:17:41.326Z","updated_at":"2023-01-22T17:17:41.326Z"},{"id":"vZsYVmzdxtihxQNqCs-3f","name":"The Great Gatsby","author_id":"NjpTwgmENj11rGdUgpCQ9","price":15,"created_at":"2022-10-22T10:11:51.421Z","updated_at":"2022-10-22T10:11:51.421Z"}]}",
          "contentType": "application/json",
          "size": 382,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 existing schema that does not match 2`] = `
{
  "info": {},
  "openapi": "3.0.1",
  "paths": {
    "/api/animals": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "books": {
                      "items": {
                        "properties": {
                          "author_id": {
                            "type": "string",
                          },
                          "created_at": {
                            "type": "string",
                          },
                          "id": {
                            "type": "string",
                          },
                          "name": {
                            "type": "string",
                          },
                          "price": {
                            "type": "number",
                          },
                          "updated_at": {
                            "type": "string",
                          },
                        },
                        "required": [
                          "id",
                          "name",
                          "author_id",
                          "price",
                          "created_at",
                          "updated_at",
                        ],
                        "type": "object",
                      },
                      "type": "array",
                    },
                    "data": {
                      "items": {
                        "type": "object",
                      },
                      "type": "array",
                    },
                    "has_more_data": {
                      "type": "boolean",
                    },
                    "next": {
                      "nullable": true,
                    },
                  },
                  "required": [
                    "books",
                  ],
                  "type": "object",
                },
              },
            },
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 header parameter not documented 1`] = `
[
  {
    "description": "operation: add 200 response",
    "diff": {
      "contentType": "application/json",
      "kind": "UnmatchedResponseStatusCode",
      "statusCode": "200",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200",
        "value": {
          "description": "200 response",
        },
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content",
        "value": {
          "application/json": {},
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [
          {
            "name": "undocumented",
            "value": "abc",
          },
        ],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post",
  },
  {
    "description": "update response body: add schema object",
    "diff": undefined,
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
        "value": {},
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/type",
        "value": "object",
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [
          {
            "name": "undocumented",
            "value": "abc",
          },
        ],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 header parameter not documented 2`] = `
{
  "info": {},
  "openapi": "3.0.1",
  "paths": {
    "/api/animals": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                },
              },
            },
            "description": "200 response",
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 header parameter required but not seen 1`] = `
[
  {
    "description": "operation: add 200 response",
    "diff": {
      "contentType": "application/json",
      "kind": "UnmatchedResponseStatusCode",
      "statusCode": "200",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200",
        "value": {
          "description": "200 response",
        },
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content",
        "value": {
          "application/json": {},
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post",
  },
  {
    "description": "make required header parameter optional",
    "diff": {
      "in": "header",
      "kind": "MissingRequiredRequiredParameter",
      "name": "required",
    },
    "groupedOperations": [
      {
        "op": "replace",
        "path": "/paths/~1api~1animals/post/parameters/0/required",
        "value": false,
      },
    ],
    "impact": [
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/parameters/0",
  },
  {
    "description": "update response body: add schema object",
    "diff": undefined,
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
        "value": {},
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/type",
        "value": "object",
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 header parameter required but not seen 2`] = `
{
  "info": {},
  "openapi": "3.0.1",
  "paths": {
    "/api/animals": {
      "post": {
        "parameters": [
          {
            "in": "header",
            "name": "required",
            "required": false,
            "schema": {
              "type": "string",
            },
          },
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                },
              },
            },
            "description": "200 response",
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 interactions with non-alphanumeric keys 1`] = `
[
  {
    "description": "operation: add 200 response",
    "diff": {
      "contentType": "application/json",
      "kind": "UnmatchedResponseStatusCode",
      "statusCode": "200",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200",
        "value": {
          "description": "200 response",
        },
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content",
        "value": {
          "application/json": {},
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post",
  },
  {
    "description": "update response body: add schema object",
    "diff": undefined,
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
        "value": {},
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/type",
        "value": "object",
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property data",
    "diff": {
      "description": "'data' is not documented",
      "example": [
        {
          "failure_rate()": 0,
          "tpm()": 0,
          "tuple(('duration', 300))": [
            [
              "duration",
              300,
            ],
          ],
          "user_misery()": 0,
          "😃things": [
            "duration",
            300,
          ],
        },
      ],
      "instancePath": "/data",
      "key": "data",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties",
      "propertyExamplePath": "/data",
      "propertyPath": "/properties/data",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties",
        "value": {},
      },
      {
        "extra": "same",
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/required",
        "value": [
          "data",
        ],
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data",
        "value": {
          "items": {
            "type": "object",
          },
          "type": "array",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property meta",
    "diff": {
      "description": "'meta' is not documented",
      "example": {
        "dataset": "discover",
        "fields": {
          "blah()": "number",
          "project_threshold_config": "string",
          "tuple(('duration', 300))": "string",
        },
        "isMetricsData": false,
        "tips": {
          "columns": null,
          "query": null,
        },
        "units": {
          "blah()": null,
          "tuple(('duration', 300))": null,
          "😃things": null,
        },
      },
      "instancePath": "/meta",
      "key": "meta",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties",
      "propertyExamplePath": "/meta",
      "propertyPath": "/properties/meta",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/required/-",
        "value": "meta",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta",
        "value": {
          "type": "object",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property tuple(('duration', 300))",
    "diff": {
      "description": "'tuple(('duration', 300))' is not documented",
      "example": [
        [
          "duration",
          300,
        ],
      ],
      "instancePath": "/data/0/tuple(('duration', 300))",
      "key": "tuple(('duration', 300))",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/data/items/properties",
      "propertyExamplePath": "/data/0/tuple(('duration', 300))",
      "propertyPath": "/properties/data/items/properties/tuple(('duration', 300))",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/properties",
        "value": {},
      },
      {
        "extra": "same",
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/required",
        "value": [
          "tuple(('duration', 300))",
        ],
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/properties/tuple(('duration', 300))",
        "value": {
          "items": {
            "items": {
              "type": "string",
            },
            "type": "array",
          },
          "type": "array",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property tpm()",
    "diff": {
      "description": "'tpm()' is not documented",
      "example": 0,
      "instancePath": "/data/0/tpm()",
      "key": "tpm()",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/data/items/properties",
      "propertyExamplePath": "/data/0/tpm()",
      "propertyPath": "/properties/data/items/properties/tpm()",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/required/-",
        "value": "tpm()",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/properties/tpm()",
        "value": {
          "type": "number",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property failure_rate()",
    "diff": {
      "description": "'failure_rate()' is not documented",
      "example": 0,
      "instancePath": "/data/0/failure_rate()",
      "key": "failure_rate()",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/data/items/properties",
      "propertyExamplePath": "/data/0/failure_rate()",
      "propertyPath": "/properties/data/items/properties/failure_rate()",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/required/-",
        "value": "failure_rate()",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/properties/failure_rate()",
        "value": {
          "type": "number",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property user_misery()",
    "diff": {
      "description": "'user_misery()' is not documented",
      "example": 0,
      "instancePath": "/data/0/user_misery()",
      "key": "user_misery()",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/data/items/properties",
      "propertyExamplePath": "/data/0/user_misery()",
      "propertyPath": "/properties/data/items/properties/user_misery()",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/required/-",
        "value": "user_misery()",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/properties/user_misery()",
        "value": {
          "type": "number",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property 😃things",
    "diff": {
      "description": "'😃things' is not documented",
      "example": [
        "duration",
        300,
      ],
      "instancePath": "/data/0/😃things",
      "key": "😃things",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/data/items/properties",
      "propertyExamplePath": "/data/0/😃things",
      "propertyPath": "/properties/data/items/properties/😃things",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/required/-",
        "value": "😃things",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/properties/😃things",
        "value": {
          "items": {
            "type": "string",
          },
          "type": "array",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property fields",
    "diff": {
      "description": "'fields' is not documented",
      "example": {
        "blah()": "number",
        "project_threshold_config": "string",
        "tuple(('duration', 300))": "string",
      },
      "instancePath": "/meta/fields",
      "key": "fields",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/meta/properties",
      "propertyExamplePath": "/meta/fields",
      "propertyPath": "/properties/meta/properties/fields",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties",
        "value": {},
      },
      {
        "extra": "same",
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/required",
        "value": [
          "fields",
        ],
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/fields",
        "value": {
          "type": "object",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property units",
    "diff": {
      "description": "'units' is not documented",
      "example": {
        "blah()": null,
        "tuple(('duration', 300))": null,
        "😃things": null,
      },
      "instancePath": "/meta/units",
      "key": "units",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/meta/properties",
      "propertyExamplePath": "/meta/units",
      "propertyPath": "/properties/meta/properties/units",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/required/-",
        "value": "units",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/units",
        "value": {
          "type": "object",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property isMetricsData",
    "diff": {
      "description": "'isMetricsData' is not documented",
      "example": false,
      "instancePath": "/meta/isMetricsData",
      "key": "isMetricsData",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/meta/properties",
      "propertyExamplePath": "/meta/isMetricsData",
      "propertyPath": "/properties/meta/properties/isMetricsData",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/required/-",
        "value": "isMetricsData",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/isMetricsData",
        "value": {
          "type": "boolean",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property tips",
    "diff": {
      "description": "'tips' is not documented",
      "example": {
        "columns": null,
        "query": null,
      },
      "instancePath": "/meta/tips",
      "key": "tips",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/meta/properties",
      "propertyExamplePath": "/meta/tips",
      "propertyPath": "/properties/meta/properties/tips",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/required/-",
        "value": "tips",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/tips",
        "value": {
          "type": "object",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property dataset",
    "diff": {
      "description": "'dataset' is not documented",
      "example": "discover",
      "instancePath": "/meta/dataset",
      "key": "dataset",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/meta/properties",
      "propertyExamplePath": "/meta/dataset",
      "propertyPath": "/properties/meta/properties/dataset",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/required/-",
        "value": "dataset",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/dataset",
        "value": {
          "type": "string",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: make items oneOf",
    "diff": {
      "description": "'items' did not match schema",
      "example": 300,
      "expectedType": "string",
      "instancePath": "/data/0/tuple(('duration', 300))/0/1",
      "key": "items",
      "keyword": "type",
      "kind": "UnmatchedType",
      "propertyPath": "/properties/data/items/properties/tuple(('duration', 300))/items/items",
    },
    "groupedOperations": [
      {
        "op": "remove",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/properties/tuple(('duration', 300))/items/items/type",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/properties/tuple(('duration', 300))/items/items/oneOf",
        "value": [
          {
            "type": "string",
          },
          {
            "type": "number",
          },
        ],
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: make items oneOf",
    "diff": {
      "description": "'items' did not match schema",
      "example": 300,
      "expectedType": "string",
      "instancePath": "/data/0/😃things/1",
      "key": "items",
      "keyword": "type",
      "kind": "UnmatchedType",
      "propertyPath": "/properties/data/items/properties/😃things/items",
    },
    "groupedOperations": [
      {
        "op": "remove",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/properties/😃things/items/type",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/properties/😃things/items/oneOf",
        "value": [
          {
            "type": "string",
          },
          {
            "type": "number",
          },
        ],
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property tuple(('duration', 300))",
    "diff": {
      "description": "'tuple(('duration', 300))' is not documented",
      "example": "string",
      "instancePath": "/meta/fields/tuple(('duration', 300))",
      "key": "tuple(('duration', 300))",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/meta/properties/fields/properties",
      "propertyExamplePath": "/meta/fields/tuple(('duration', 300))",
      "propertyPath": "/properties/meta/properties/fields/properties/tuple(('duration', 300))",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/fields/properties",
        "value": {},
      },
      {
        "extra": "same",
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/fields/required",
        "value": [
          "tuple(('duration', 300))",
        ],
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/fields/properties/tuple(('duration', 300))",
        "value": {
          "type": "string",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property blah()",
    "diff": {
      "description": "'blah()' is not documented",
      "example": "number",
      "instancePath": "/meta/fields/blah()",
      "key": "blah()",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/meta/properties/fields/properties",
      "propertyExamplePath": "/meta/fields/blah()",
      "propertyPath": "/properties/meta/properties/fields/properties/blah()",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/fields/required/-",
        "value": "blah()",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/fields/properties/blah()",
        "value": {
          "type": "string",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property project_threshold_config",
    "diff": {
      "description": "'project_threshold_config' is not documented",
      "example": "string",
      "instancePath": "/meta/fields/project_threshold_config",
      "key": "project_threshold_config",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/meta/properties/fields/properties",
      "propertyExamplePath": "/meta/fields/project_threshold_config",
      "propertyPath": "/properties/meta/properties/fields/properties/project_threshold_config",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/fields/required/-",
        "value": "project_threshold_config",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/fields/properties/project_threshold_config",
        "value": {
          "type": "string",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property tuple(('duration', 300))",
    "diff": {
      "description": "'tuple(('duration', 300))' is not documented",
      "example": null,
      "instancePath": "/meta/units/tuple(('duration', 300))",
      "key": "tuple(('duration', 300))",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/meta/properties/units/properties",
      "propertyExamplePath": "/meta/units/tuple(('duration', 300))",
      "propertyPath": "/properties/meta/properties/units/properties/tuple(('duration', 300))",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/units/properties",
        "value": {},
      },
      {
        "extra": "same",
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/units/required",
        "value": [
          "tuple(('duration', 300))",
        ],
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/units/properties/tuple(('duration', 300))",
        "value": {
          "nullable": true,
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property blah()",
    "diff": {
      "description": "'blah()' is not documented",
      "example": null,
      "instancePath": "/meta/units/blah()",
      "key": "blah()",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/meta/properties/units/properties",
      "propertyExamplePath": "/meta/units/blah()",
      "propertyPath": "/properties/meta/properties/units/properties/blah()",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/units/required/-",
        "value": "blah()",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/units/properties/blah()",
        "value": {
          "nullable": true,
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property 😃things",
    "diff": {
      "description": "'😃things' is not documented",
      "example": null,
      "instancePath": "/meta/units/😃things",
      "key": "😃things",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/meta/properties/units/properties",
      "propertyExamplePath": "/meta/units/😃things",
      "propertyPath": "/properties/meta/properties/units/properties/😃things",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/units/required/-",
        "value": "😃things",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/units/properties/😃things",
        "value": {
          "nullable": true,
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property query",
    "diff": {
      "description": "'query' is not documented",
      "example": null,
      "instancePath": "/meta/tips/query",
      "key": "query",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/meta/properties/tips/properties",
      "propertyExamplePath": "/meta/tips/query",
      "propertyPath": "/properties/meta/properties/tips/properties/query",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/tips/properties",
        "value": {},
      },
      {
        "extra": "same",
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/tips/required",
        "value": [
          "query",
        ],
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/tips/properties/query",
        "value": {
          "nullable": true,
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property columns",
    "diff": {
      "description": "'columns' is not documented",
      "example": null,
      "instancePath": "/meta/tips/columns",
      "key": "columns",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/meta/properties/tips/properties",
      "propertyExamplePath": "/meta/tips/columns",
      "propertyPath": "/properties/meta/properties/tips/properties/columns",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/tips/required/-",
        "value": "columns",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/tips/properties/columns",
        "value": {
          "nullable": true,
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 interactions with non-alphanumeric keys 2`] = `
{
  "info": {},
  "openapi": "3.0.1",
  "paths": {
    "/api/animals": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "properties": {
                          "failure_rate()": {
                            "type": "number",
                          },
                          "tpm()": {
                            "type": "number",
                          },
                          "tuple(('duration', 300))": {
                            "items": {
                              "items": {
                                "oneOf": [
                                  {
                                    "type": "string",
                                  },
                                  {
                                    "type": "number",
                                  },
                                ],
                              },
                              "type": "array",
                            },
                            "type": "array",
                          },
                          "user_misery()": {
                            "type": "number",
                          },
                          "😃things": {
                            "items": {
                              "oneOf": [
                                {
                                  "type": "string",
                                },
                                {
                                  "type": "number",
                                },
                              ],
                            },
                            "type": "array",
                          },
                        },
                        "required": [
                          "tuple(('duration', 300))",
                          "tpm()",
                          "failure_rate()",
                          "user_misery()",
                          "😃things",
                        ],
                        "type": "object",
                      },
                      "type": "array",
                    },
                    "meta": {
                      "properties": {
                        "dataset": {
                          "type": "string",
                        },
                        "fields": {
                          "properties": {
                            "blah()": {
                              "type": "string",
                            },
                            "project_threshold_config": {
                              "type": "string",
                            },
                            "tuple(('duration', 300))": {
                              "type": "string",
                            },
                          },
                          "required": [
                            "tuple(('duration', 300))",
                            "blah()",
                            "project_threshold_config",
                          ],
                          "type": "object",
                        },
                        "isMetricsData": {
                          "type": "boolean",
                        },
                        "tips": {
                          "properties": {
                            "columns": {
                              "nullable": true,
                            },
                            "query": {
                              "nullable": true,
                            },
                          },
                          "required": [
                            "query",
                            "columns",
                          ],
                          "type": "object",
                        },
                        "units": {
                          "properties": {
                            "blah()": {
                              "nullable": true,
                            },
                            "tuple(('duration', 300))": {
                              "nullable": true,
                            },
                            "😃things": {
                              "nullable": true,
                            },
                          },
                          "required": [
                            "tuple(('duration', 300))",
                            "blah()",
                            "😃things",
                          ],
                          "type": "object",
                        },
                      },
                      "required": [
                        "fields",
                        "units",
                        "isMetricsData",
                        "tips",
                        "dataset",
                      ],
                      "type": "object",
                    },
                  },
                  "required": [
                    "data",
                    "meta",
                  ],
                  "type": "object",
                },
              },
            },
            "description": "200 response",
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 mismatched type in schema 1`] = `
[
  {
    "description": "update response body: make name oneOf",
    "diff": {
      "description": "'name' did not match schema",
      "example": "me",
      "expectedType": "number",
      "instancePath": "/name",
      "key": "name",
      "keyword": "type",
      "kind": "UnmatchedType",
      "propertyPath": "/properties/name",
    },
    "groupedOperations": [
      {
        "op": "remove",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/name/type",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/name/oneOf",
        "value": [
          {
            "type": "number",
          },
          {
            "type": "string",
          },
        ],
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"name":"me"}",
          "contentType": "application/json",
          "size": 13,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 mismatched type in schema 2`] = `
{
  "info": {},
  "openapi": "3.0.1",
  "paths": {
    "/api/animals": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "name": {
                      "oneOf": [
                        {
                          "type": "number",
                        },
                        {
                          "type": "string",
                        },
                      ],
                    },
                  },
                  "type": "object",
                },
              },
            },
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 missing required property 1`] = `
[
  {
    "description": "update response body: make property name optional",
    "diff": {
      "description": "required property 'name' was missing",
      "example": undefined,
      "instancePath": "/name",
      "key": "name",
      "keyword": "required",
      "kind": "MissingRequiredProperty",
      "parentObjectPath": "",
      "propertyPath": "/properties/name",
    },
    "groupedOperations": [
      {
        "op": "remove",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/required/0",
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 missing required property 2`] = `
{
  "info": {},
  "openapi": "3.0.1",
  "paths": {
    "/api/animals": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "name": {
                      "type": "string",
                    },
                  },
                  "required": [],
                  "type": "object",
                },
              },
            },
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 oneOf with nullable 1`] = `[]`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 oneOf with nullable 2`] = `
{
  "info": {},
  "openapi": "3.0.1",
  "paths": {
    "/api/animals": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "key": {
                      "nullable": true,
                      "oneOf": [
                        {
                          "properties": {
                            "goodbye": {
                              "type": "string",
                            },
                            "hello": {
                              "type": "string",
                            },
                          },
                          "required": [
                            "hello",
                            "goodbye",
                          ],
                          "type": "object",
                        },
                      ],
                    },
                  },
                  "required": [
                    "key",
                  ],
                  "type": "object",
                },
              },
            },
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 query parameter not documented 1`] = `
[
  {
    "description": "operation: add 200 response",
    "diff": {
      "contentType": "application/json",
      "kind": "UnmatchedResponseStatusCode",
      "statusCode": "200",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200",
        "value": {
          "description": "200 response",
        },
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content",
        "value": {
          "application/json": {},
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [
          {
            "name": "undocumented",
            "value": "abc",
          },
        ],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post",
  },
  {
    "description": "add parameters array to operation",
    "diff": {
      "kind": "MissingRequestParametersArray",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/parameters",
        "value": [],
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [
          {
            "name": "undocumented",
            "value": "abc",
          },
        ],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post",
  },
  {
    "description": "add undocumented query parameter",
    "diff": {
      "in": "query",
      "kind": "UnmatchedRequestParameter",
      "name": "undocumented",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/parameters/-",
        "value": {
          "in": "query",
          "name": "undocumented",
          "required": true,
          "schema": {
            "type": "string",
          },
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [
          {
            "name": "undocumented",
            "value": "abc",
          },
        ],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/parameters",
  },
  {
    "description": "update response body: add schema object",
    "diff": undefined,
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
        "value": {},
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/type",
        "value": "object",
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [
          {
            "name": "undocumented",
            "value": "abc",
          },
        ],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 query parameter not documented 2`] = `
{
  "info": {},
  "openapi": "3.0.1",
  "paths": {
    "/api/animals": {
      "post": {
        "parameters": [
          {
            "in": "query",
            "name": "undocumented",
            "required": true,
            "schema": {
              "type": "string",
            },
          },
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                },
              },
            },
            "description": "200 response",
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 query parameter required but not seen 1`] = `
[
  {
    "description": "operation: add 200 response",
    "diff": {
      "contentType": "application/json",
      "kind": "UnmatchedResponseStatusCode",
      "statusCode": "200",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200",
        "value": {
          "description": "200 response",
        },
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content",
        "value": {
          "application/json": {},
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post",
  },
  {
    "description": "make required query parameter optional",
    "diff": {
      "in": "query",
      "kind": "MissingRequiredRequiredParameter",
      "name": "required",
    },
    "groupedOperations": [
      {
        "op": "replace",
        "path": "/paths/~1api~1animals/post/parameters/0/required",
        "value": false,
      },
    ],
    "impact": [
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/parameters/0",
  },
  {
    "description": "update response body: add schema object",
    "diff": undefined,
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
        "value": {},
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/type",
        "value": "object",
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 query parameter required but not seen 2`] = `
{
  "info": {},
  "openapi": "3.0.1",
  "paths": {
    "/api/animals": {
      "post": {
        "parameters": [
          {
            "in": "query",
            "name": "required",
            "required": false,
            "schema": {
              "type": "string",
            },
          },
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                },
              },
            },
            "description": "200 response",
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 response headers not documented 1`] = `
[
  {
    "description": "operation: add 200 response",
    "diff": {
      "contentType": "application/json",
      "kind": "UnmatchedResponseStatusCode",
      "statusCode": "200",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200",
        "value": {
          "description": "200 response",
        },
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content",
        "value": {
          "application/json": {},
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [
          {
            "name": "undocumented",
            "value": "abc",
          },
        ],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post",
  },
  {
    "description": "update response body: add schema object",
    "diff": undefined,
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
        "value": {},
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/type",
        "value": "object",
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [
          {
            "name": "undocumented",
            "value": "abc",
          },
        ],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 response headers not documented 2`] = `
{
  "info": {},
  "openapi": "3.0.1",
  "paths": {
    "/api/animals": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                },
              },
            },
            "description": "200 response",
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 response headers required but not seen 1`] = `
[
  {
    "description": "make required response header in 200 response optional",
    "diff": {
      "kind": "MissingRequiredResponseHeader",
      "name": "required",
      "statusCode": "200",
    },
    "groupedOperations": [
      {
        "op": "replace",
        "path": "/paths/~1api~1animals/post/responses/200/headers/required/required",
        "value": false,
      },
    ],
    "impact": [
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/headers/required",
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 response headers required but not seen 2`] = `
{
  "info": {},
  "openapi": "3.0.1",
  "paths": {
    "/api/animals": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "properties": {
                          "status": {
                            "const": "ok",
                            "type": "string",
                          },
                        },
                        "required": [
                          "status",
                        ],
                        "type": "object",
                      },
                      "type": "array",
                    },
                  },
                  "type": "object",
                },
              },
            },
            "headers": {
              "required": {
                "name": "required",
                "required": false,
                "schema": {
                  "type": "string",
                },
              },
            },
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 schema with arrays with polymorphic items 1`] = `
[
  {
    "description": "update response body: make status null",
    "diff": {
      "description": "'status' did not match schema",
      "example": null,
      "expectedType": "string",
      "instancePath": "/data/0/status",
      "key": "status",
      "keyword": "type",
      "kind": "UnmatchedType",
      "propertyPath": "/properties/data/items/properties/status",
    },
    "groupedOperations": [
      {
        "op": "replace",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/properties/status/nullable",
        "value": true,
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"status":null},{"status":"something-else"},{"status":"another-thing"},{"status":null},{"status":123}]}",
          "contentType": "application/json",
          "size": 112,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: make status null",
    "diff": {
      "description": "'status' did not match schema",
      "example": null,
      "expectedType": "string",
      "instancePath": "/data/3/status",
      "key": "status",
      "keyword": "type",
      "kind": "UnmatchedType",
      "propertyPath": "/properties/data/items/properties/status",
    },
    "groupedOperations": [
      {
        "op": "replace",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/properties/status/nullable",
        "value": true,
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"status":null},{"status":"something-else"},{"status":"another-thing"},{"status":null},{"status":123}]}",
          "contentType": "application/json",
          "size": 112,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: make status oneOf",
    "diff": {
      "description": "'status' did not match schema",
      "example": 123,
      "expectedType": "string",
      "instancePath": "/data/4/status",
      "key": "status",
      "keyword": "type",
      "kind": "UnmatchedType",
      "propertyPath": "/properties/data/items/properties/status",
    },
    "groupedOperations": [
      {
        "op": "remove",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/properties/status/type",
      },
      {
        "op": "remove",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/properties/status/nullable",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/properties/status/oneOf",
        "value": [
          {
            "nullable": true,
            "type": "string",
          },
          {
            "type": "number",
          },
        ],
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"status":null},{"status":"something-else"},{"status":"another-thing"},{"status":null},{"status":123}]}",
          "contentType": "application/json",
          "size": 112,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 schema with arrays with polymorphic items 2`] = `
{
  "info": {},
  "openapi": "3.0.1",
  "paths": {
    "/api/animals": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "properties": {
                          "status": {
                            "oneOf": [
                              {
                                "nullable": true,
                                "type": "string",
                              },
                              {
                                "type": "number",
                              },
                            ],
                          },
                        },
                        "required": [
                          "status",
                        ],
                        "type": "object",
                      },
                      "type": "array",
                    },
                  },
                  "type": "object",
                },
              },
            },
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 schema with enum 1`] = `
[
  {
    "description": "update response body: add enum something-else to status ",
    "diff": {
      "description": "'status' does not have enum value something-else",
      "example": {
        "data": [
          {
            "status": "something-else",
          },
          {
            "status": "another-thing",
          },
        ],
        "status": "something-else",
      },
      "instancePath": "/status",
      "key": "status",
      "keyword": "enum",
      "kind": "MissingEnumValue",
      "propertyPath": "/properties/status/enum",
      "value": "something-else",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/status/enum/-",
        "value": "something-else",
      },
    ],
    "impact": [
      "Addition",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"status":"something-else","data":[{"status":"something-else"},{"status":"another-thing"}]}",
          "contentType": "application/json",
          "size": 91,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add enum something-else to status ",
    "diff": {
      "description": "'status' does not have enum value something-else",
      "example": {
        "data": [
          {
            "status": "something-else",
          },
          {
            "status": "another-thing",
          },
        ],
        "status": "something-else",
      },
      "instancePath": "/data/0/status",
      "key": "status",
      "keyword": "enum",
      "kind": "MissingEnumValue",
      "propertyPath": "/properties/data/items/properties/status/enum",
      "value": "something-else",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/properties/status/enum/-",
        "value": "something-else",
      },
    ],
    "impact": [
      "Addition",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"status":"something-else","data":[{"status":"something-else"},{"status":"another-thing"}]}",
          "contentType": "application/json",
          "size": 91,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add enum another-thing to status ",
    "diff": {
      "description": "'status' does not have enum value another-thing",
      "example": {
        "data": [
          {
            "status": "something-else",
          },
          {
            "status": "another-thing",
          },
        ],
        "status": "something-else",
      },
      "instancePath": "/data/1/status",
      "key": "status",
      "keyword": "enum",
      "kind": "MissingEnumValue",
      "propertyPath": "/properties/data/items/properties/status/enum",
      "value": "another-thing",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/properties/status/enum/-",
        "value": "another-thing",
      },
    ],
    "impact": [
      "Addition",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"status":"something-else","data":[{"status":"something-else"},{"status":"another-thing"}]}",
          "contentType": "application/json",
          "size": 91,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 schema with enum 2`] = `
{
  "info": {},
  "openapi": "3.0.1",
  "paths": {
    "/api/animals": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "properties": {
                          "status": {
                            "enum": [
                              "ready",
                              "not_ready",
                              "something-else",
                              "another-thing",
                            ],
                            "type": "string",
                          },
                        },
                        "type": "object",
                      },
                      "type": "array",
                    },
                    "status": {
                      "enum": [
                        "ready",
                        "not_ready",
                        "something-else",
                      ],
                      "type": "string",
                    },
                  },
                  "required": [
                    "status",
                  ],
                  "type": "object",
                },
              },
            },
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 undocumented property in schema 1`] = `
[
  {
    "description": "update response body: add property name",
    "diff": {
      "description": "'name' is not documented",
      "example": "me",
      "instancePath": "/name",
      "key": "name",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties",
      "propertyExamplePath": "/name",
      "propertyPath": "/properties/name",
    },
    "groupedOperations": [
      {
        "extra": "same",
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/required",
        "value": [
          "name",
        ],
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/name",
        "value": {
          "type": "string",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"name":"me"}",
          "contentType": "application/json",
          "size": 13,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 undocumented property in schema 2`] = `
{
  "info": {},
  "openapi": "3.0.1",
  "paths": {
    "/api/animals": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "name": {
                      "type": "string",
                    },
                  },
                  "required": [
                    "name",
                  ],
                  "type": "object",
                },
              },
            },
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 undocumented request body 1`] = `
[
  {
    "description": "operation: add 'application/json' body as a valid request body type",
    "diff": {
      "contentType": "application/json",
      "kind": "UnmatchedRequestBody",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody",
        "value": {
          "content": {},
        },
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json",
        "value": {
          "schema": {},
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post",
  },
  {
    "description": "operation: add 200 response",
    "diff": {
      "contentType": "application/json",
      "kind": "UnmatchedResponseStatusCode",
      "statusCode": "200",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200",
        "value": {
          "description": "200 response",
        },
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content",
        "value": {
          "application/json": {},
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post",
  },
  {
    "description": "update request body: add schema object",
    "diff": undefined,
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/type",
        "value": "object",
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema",
  },
  {
    "description": "update request body: add property name",
    "diff": {
      "description": "'name' is not documented",
      "example": "me",
      "instancePath": "/name",
      "key": "name",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties",
      "propertyExamplePath": "/name",
      "propertyPath": "/properties/name",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/properties",
        "value": {},
      },
      {
        "extra": "same",
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/required",
        "value": [
          "name",
        ],
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/properties/name",
        "value": {
          "type": "string",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema",
  },
  {
    "description": "update request body: add property age",
    "diff": {
      "description": "'age' is not documented",
      "example": 100,
      "instancePath": "/age",
      "key": "age",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties",
      "propertyExamplePath": "/age",
      "propertyPath": "/properties/age",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/required/-",
        "value": "age",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/properties/age",
        "value": {
          "type": "number",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema",
  },
  {
    "description": "update request body: add property created_at",
    "diff": {
      "description": "'created_at' is not documented",
      "example": "2023-07-20T14:39:22.184Z",
      "instancePath": "/created_at",
      "key": "created_at",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties",
      "propertyExamplePath": "/created_at",
      "propertyPath": "/properties/created_at",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/required/-",
        "value": "created_at",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/properties/created_at",
        "value": {
          "type": "string",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema",
  },
  {
    "description": "update request body: add property hobbies",
    "diff": {
      "description": "'hobbies' is not documented",
      "example": [
        "running",
        {
          "name": "fishing",
          "type": "sport",
        },
        {
          "bad": null,
          "name": "basketball",
          "skill": 100,
          "type": "sport",
        },
      ],
      "instancePath": "/hobbies",
      "key": "hobbies",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties",
      "propertyExamplePath": "/hobbies",
      "propertyPath": "/properties/hobbies",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/required/-",
        "value": "hobbies",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/properties/hobbies",
        "value": {
          "items": {
            "type": "string",
          },
          "type": "array",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema",
  },
  {
    "description": "update request body: add property active",
    "diff": {
      "description": "'active' is not documented",
      "example": true,
      "instancePath": "/active",
      "key": "active",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties",
      "propertyExamplePath": "/active",
      "propertyPath": "/properties/active",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/required/-",
        "value": "active",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/properties/active",
        "value": {
          "type": "boolean",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema",
  },
  {
    "description": "update request body: make items oneOf",
    "diff": {
      "description": "'items' did not match schema",
      "example": {
        "name": "fishing",
        "type": "sport",
      },
      "expectedType": "string",
      "instancePath": "/hobbies/1",
      "key": "items",
      "keyword": "type",
      "kind": "UnmatchedType",
      "propertyPath": "/properties/hobbies/items",
    },
    "groupedOperations": [
      {
        "op": "remove",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/properties/hobbies/items/type",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/properties/hobbies/items/oneOf",
        "value": [
          {
            "type": "string",
          },
          {
            "type": "object",
          },
        ],
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema",
  },
  {
    "description": "update request body: add property type",
    "diff": {
      "description": "'type' is not documented",
      "example": "sport",
      "instancePath": "/hobbies/1/type",
      "key": "type",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/hobbies/items/oneOf/1/properties",
      "propertyExamplePath": "/hobbies/1/type",
      "propertyPath": "/properties/hobbies/items/oneOf/1/properties/type",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/properties/hobbies/items/oneOf/1/properties",
        "value": {},
      },
      {
        "extra": "same",
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/properties/hobbies/items/oneOf/1/required",
        "value": [
          "type",
        ],
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/properties/hobbies/items/oneOf/1/properties/type",
        "value": {
          "type": "string",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema",
  },
  {
    "description": "update request body: add property name",
    "diff": {
      "description": "'name' is not documented",
      "example": "fishing",
      "instancePath": "/hobbies/1/name",
      "key": "name",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/hobbies/items/oneOf/1/properties",
      "propertyExamplePath": "/hobbies/1/name",
      "propertyPath": "/properties/hobbies/items/oneOf/1/properties/name",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/properties/hobbies/items/oneOf/1/required/-",
        "value": "name",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/properties/hobbies/items/oneOf/1/properties/name",
        "value": {
          "type": "string",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema",
  },
  {
    "description": "update request body: add property skill",
    "diff": {
      "description": "'skill' is not documented",
      "example": 100,
      "instancePath": "/hobbies/2/skill",
      "key": "skill",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/hobbies/items/oneOf/1/properties",
      "propertyExamplePath": "/hobbies/2/skill",
      "propertyPath": "/properties/hobbies/items/oneOf/1/properties/skill",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/properties/hobbies/items/oneOf/1/required/-",
        "value": "skill",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/properties/hobbies/items/oneOf/1/properties/skill",
        "value": {
          "type": "number",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema",
  },
  {
    "description": "update request body: add property bad",
    "diff": {
      "description": "'bad' is not documented",
      "example": null,
      "instancePath": "/hobbies/2/bad",
      "key": "bad",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/hobbies/items/oneOf/1/properties",
      "propertyExamplePath": "/hobbies/2/bad",
      "propertyPath": "/properties/hobbies/items/oneOf/1/properties/bad",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/properties/hobbies/items/oneOf/1/required/-",
        "value": "bad",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/properties/hobbies/items/oneOf/1/properties/bad",
        "value": {
          "nullable": true,
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema",
  },
  {
    "description": "update request body: make property skill optional",
    "diff": {
      "description": "required property 'skill' was missing",
      "example": undefined,
      "instancePath": "/hobbies/1/skill",
      "key": "skill",
      "keyword": "required",
      "kind": "MissingRequiredProperty",
      "parentObjectPath": "/properties/hobbies/items/oneOf/1",
      "propertyPath": "/properties/hobbies/items/oneOf/1/properties/skill",
    },
    "groupedOperations": [
      {
        "op": "remove",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/properties/hobbies/items/oneOf/1/required/2",
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema",
  },
  {
    "description": "update request body: make property bad optional",
    "diff": {
      "description": "required property 'bad' was missing",
      "example": undefined,
      "instancePath": "/hobbies/1/bad",
      "key": "bad",
      "keyword": "required",
      "kind": "MissingRequiredProperty",
      "parentObjectPath": "/properties/hobbies/items/oneOf/1",
      "propertyPath": "/properties/hobbies/items/oneOf/1/properties/bad",
    },
    "groupedOperations": [
      {
        "op": "remove",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/properties/hobbies/items/oneOf/1/required/2",
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema",
  },
  {
    "description": "update response body: add schema object",
    "diff": undefined,
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
        "value": {},
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/type",
        "value": "object",
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 undocumented request body 2`] = `
{
  "info": {},
  "openapi": "3.0.1",
  "paths": {
    "/api/animals": {
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "active": {
                    "type": "boolean",
                  },
                  "age": {
                    "type": "number",
                  },
                  "created_at": {
                    "type": "string",
                  },
                  "hobbies": {
                    "items": {
                      "oneOf": [
                        {
                          "type": "string",
                        },
                        {
                          "properties": {
                            "bad": {
                              "nullable": true,
                            },
                            "name": {
                              "type": "string",
                            },
                            "skill": {
                              "type": "number",
                            },
                            "type": {
                              "type": "string",
                            },
                          },
                          "required": [
                            "type",
                            "name",
                          ],
                          "type": "object",
                        },
                      ],
                    },
                    "type": "array",
                  },
                  "name": {
                    "type": "string",
                  },
                },
                "required": [
                  "name",
                  "age",
                  "created_at",
                  "hobbies",
                  "active",
                ],
                "type": "object",
              },
            },
          },
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                },
              },
            },
            "description": "200 response",
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 undocumented response body 1`] = `
[
  {
    "description": "operation: add 200 response",
    "diff": {
      "contentType": "application/json",
      "kind": "UnmatchedResponseStatusCode",
      "statusCode": "200",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200",
        "value": {
          "description": "200 response",
        },
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content",
        "value": {
          "application/json": {},
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post",
  },
  {
    "description": "update response body: add schema object",
    "diff": undefined,
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
        "value": {},
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/type",
        "value": "object",
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property name",
    "diff": {
      "description": "'name' is not documented",
      "example": "me",
      "instancePath": "/name",
      "key": "name",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties",
      "propertyExamplePath": "/name",
      "propertyPath": "/properties/name",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties",
        "value": {},
      },
      {
        "extra": "same",
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/required",
        "value": [
          "name",
        ],
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/name",
        "value": {
          "type": "string",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property age",
    "diff": {
      "description": "'age' is not documented",
      "example": 100,
      "instancePath": "/age",
      "key": "age",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties",
      "propertyExamplePath": "/age",
      "propertyPath": "/properties/age",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/required/-",
        "value": "age",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/age",
        "value": {
          "type": "number",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property created_at",
    "diff": {
      "description": "'created_at' is not documented",
      "example": "2023-07-20T14:39:22.184Z",
      "instancePath": "/created_at",
      "key": "created_at",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties",
      "propertyExamplePath": "/created_at",
      "propertyPath": "/properties/created_at",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/required/-",
        "value": "created_at",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/created_at",
        "value": {
          "type": "string",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property hobbies",
    "diff": {
      "description": "'hobbies' is not documented",
      "example": [
        "running",
        {
          "name": "fishing",
          "type": "sport",
        },
        {
          "bad": null,
          "name": "basketball",
          "skill": 100,
          "type": "sport",
        },
      ],
      "instancePath": "/hobbies",
      "key": "hobbies",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties",
      "propertyExamplePath": "/hobbies",
      "propertyPath": "/properties/hobbies",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/required/-",
        "value": "hobbies",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/hobbies",
        "value": {
          "items": {
            "type": "string",
          },
          "type": "array",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property active",
    "diff": {
      "description": "'active' is not documented",
      "example": true,
      "instancePath": "/active",
      "key": "active",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties",
      "propertyExamplePath": "/active",
      "propertyPath": "/properties/active",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/required/-",
        "value": "active",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/active",
        "value": {
          "type": "boolean",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: make items oneOf",
    "diff": {
      "description": "'items' did not match schema",
      "example": {
        "name": "fishing",
        "type": "sport",
      },
      "expectedType": "string",
      "instancePath": "/hobbies/1",
      "key": "items",
      "keyword": "type",
      "kind": "UnmatchedType",
      "propertyPath": "/properties/hobbies/items",
    },
    "groupedOperations": [
      {
        "op": "remove",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/hobbies/items/type",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/hobbies/items/oneOf",
        "value": [
          {
            "type": "string",
          },
          {
            "type": "object",
          },
        ],
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property type",
    "diff": {
      "description": "'type' is not documented",
      "example": "sport",
      "instancePath": "/hobbies/1/type",
      "key": "type",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/hobbies/items/oneOf/1/properties",
      "propertyExamplePath": "/hobbies/1/type",
      "propertyPath": "/properties/hobbies/items/oneOf/1/properties/type",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/hobbies/items/oneOf/1/properties",
        "value": {},
      },
      {
        "extra": "same",
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/hobbies/items/oneOf/1/required",
        "value": [
          "type",
        ],
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/hobbies/items/oneOf/1/properties/type",
        "value": {
          "type": "string",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property name",
    "diff": {
      "description": "'name' is not documented",
      "example": "fishing",
      "instancePath": "/hobbies/1/name",
      "key": "name",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/hobbies/items/oneOf/1/properties",
      "propertyExamplePath": "/hobbies/1/name",
      "propertyPath": "/properties/hobbies/items/oneOf/1/properties/name",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/hobbies/items/oneOf/1/required/-",
        "value": "name",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/hobbies/items/oneOf/1/properties/name",
        "value": {
          "type": "string",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property skill",
    "diff": {
      "description": "'skill' is not documented",
      "example": 100,
      "instancePath": "/hobbies/2/skill",
      "key": "skill",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/hobbies/items/oneOf/1/properties",
      "propertyExamplePath": "/hobbies/2/skill",
      "propertyPath": "/properties/hobbies/items/oneOf/1/properties/skill",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/hobbies/items/oneOf/1/required/-",
        "value": "skill",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/hobbies/items/oneOf/1/properties/skill",
        "value": {
          "type": "number",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property bad",
    "diff": {
      "description": "'bad' is not documented",
      "example": null,
      "instancePath": "/hobbies/2/bad",
      "key": "bad",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/hobbies/items/oneOf/1/properties",
      "propertyExamplePath": "/hobbies/2/bad",
      "propertyPath": "/properties/hobbies/items/oneOf/1/properties/bad",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/hobbies/items/oneOf/1/required/-",
        "value": "bad",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/hobbies/items/oneOf/1/properties/bad",
        "value": {
          "nullable": true,
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: make property skill optional",
    "diff": {
      "description": "required property 'skill' was missing",
      "example": undefined,
      "instancePath": "/hobbies/1/skill",
      "key": "skill",
      "keyword": "required",
      "kind": "MissingRequiredProperty",
      "parentObjectPath": "/properties/hobbies/items/oneOf/1",
      "propertyPath": "/properties/hobbies/items/oneOf/1/properties/skill",
    },
    "groupedOperations": [
      {
        "op": "remove",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/hobbies/items/oneOf/1/required/2",
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: make property bad optional",
    "diff": {
      "description": "required property 'bad' was missing",
      "example": undefined,
      "instancePath": "/hobbies/1/bad",
      "key": "bad",
      "keyword": "required",
      "kind": "MissingRequiredProperty",
      "parentObjectPath": "/properties/hobbies/items/oneOf/1",
      "propertyPath": "/properties/hobbies/items/oneOf/1/properties/bad",
    },
    "groupedOperations": [
      {
        "op": "remove",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/hobbies/items/oneOf/1/required/2",
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.0.1 undocumented response body 2`] = `
{
  "info": {},
  "openapi": "3.0.1",
  "paths": {
    "/api/animals": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "active": {
                      "type": "boolean",
                    },
                    "age": {
                      "type": "number",
                    },
                    "created_at": {
                      "type": "string",
                    },
                    "hobbies": {
                      "items": {
                        "oneOf": [
                          {
                            "type": "string",
                          },
                          {
                            "properties": {
                              "bad": {
                                "nullable": true,
                              },
                              "name": {
                                "type": "string",
                              },
                              "skill": {
                                "type": "number",
                              },
                              "type": {
                                "type": "string",
                              },
                            },
                            "required": [
                              "type",
                              "name",
                            ],
                            "type": "object",
                          },
                        ],
                      },
                      "type": "array",
                    },
                    "name": {
                      "type": "string",
                    },
                  },
                  "required": [
                    "name",
                    "age",
                    "created_at",
                    "hobbies",
                    "active",
                  ],
                  "type": "object",
                },
              },
            },
            "description": "200 response",
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 allOf allOf in a property 1`] = `
[
  {
    "description": "update response body: add property as",
    "diff": {
      "description": "'as' is not documented",
      "example": 12,
      "instancePath": "/data/asda/as",
      "key": "as",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/data/allOf/1/properties/asda/properties",
      "propertyExamplePath": "/data/asda/as",
      "propertyPath": "/properties/data/allOf/1/properties/asda/properties/as",
    },
    "groupedOperations": [
      {
        "extra": "same",
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/allOf/1/properties/asda/required",
        "value": [
          "as",
        ],
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/allOf/1/properties/asda/properties/as",
        "value": {
          "type": "number",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":{"status":"ok","name":"me","age":50,"asda":{"as":12}}}",
          "contentType": "application/json",
          "size": 62,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property age",
    "diff": {
      "description": "'age' is not documented",
      "example": 50,
      "instancePath": "/data/age",
      "key": "age",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/data/allOf/0/properties",
      "propertyExamplePath": "/data/age",
      "propertyPath": "/properties/data/allOf/0/properties/age",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/allOf/0/required/-",
        "value": "age",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/allOf/0/properties/age",
        "value": {
          "type": "number",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":{"status":"ok","name":"me","age":50,"asda":{"as":12}}}",
          "contentType": "application/json",
          "size": 62,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 allOf allOf in a property 2`] = `
{
  "info": {},
  "openapi": "3.1.0",
  "paths": {
    "/api/animals": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "allOf": [
                        {
                          "properties": {
                            "age": {
                              "type": "number",
                            },
                            "status": {
                              "type": "string",
                            },
                          },
                          "required": [
                            "status",
                            "age",
                          ],
                          "type": "object",
                        },
                        {
                          "properties": {
                            "asda": {
                              "properties": {
                                "as": {
                                  "type": "number",
                                },
                              },
                              "required": [
                                "as",
                              ],
                              "type": "object",
                            },
                            "name": {
                              "type": "string",
                            },
                          },
                          "type": "object",
                        },
                      ],
                    },
                  },
                  "type": "object",
                },
              },
            },
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 allOf matching interaction 1`] = `[]`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 allOf matching interaction 2`] = `
{
  "info": {},
  "openapi": "3.1.0",
  "paths": {
    "/api/animals": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "age": {
                          "type": "number",
                        },
                        "status": {
                          "type": "string",
                        },
                      },
                      "required": [
                        "status",
                      ],
                      "type": "object",
                    },
                    {
                      "properties": {
                        "name": {
                          "type": "string",
                        },
                      },
                      "type": "object",
                    },
                  ],
                },
              },
            },
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 allOf with extra keys in interaction 1`] = `
[
  {
    "description": "update response body: add property as",
    "diff": {
      "description": "'as' is not documented",
      "example": 12,
      "instancePath": "/asda/as",
      "key": "as",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/allOf/1/properties/asda/properties",
      "propertyExamplePath": "/asda/as",
      "propertyPath": "/allOf/1/properties/asda/properties/as",
    },
    "groupedOperations": [
      {
        "extra": "same",
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/allOf/1/properties/asda/required",
        "value": [
          "as",
        ],
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/allOf/1/properties/asda/properties/as",
        "value": {
          "type": "number",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"status":"ok","name":"me","age":50,"asda":{"as":12}}",
          "contentType": "application/json",
          "size": 53,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property age",
    "diff": {
      "description": "'age' is not documented",
      "example": 50,
      "instancePath": "/age",
      "key": "age",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/allOf/0/properties",
      "propertyExamplePath": "/age",
      "propertyPath": "/allOf/0/properties/age",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/allOf/0/required/-",
        "value": "age",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/allOf/0/properties/age",
        "value": {
          "type": "number",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"status":"ok","name":"me","age":50,"asda":{"as":12}}",
          "contentType": "application/json",
          "size": 53,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 allOf with extra keys in interaction 2`] = `
{
  "info": {},
  "openapi": "3.1.0",
  "paths": {
    "/api/animals": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "age": {
                          "type": "number",
                        },
                        "status": {
                          "type": "string",
                        },
                      },
                      "required": [
                        "status",
                        "age",
                      ],
                      "type": "object",
                    },
                    {
                      "properties": {
                        "asda": {
                          "properties": {
                            "as": {
                              "type": "number",
                            },
                          },
                          "required": [
                            "as",
                          ],
                          "type": "object",
                        },
                        "name": {
                          "type": "string",
                        },
                      },
                      "type": "object",
                    },
                  ],
                },
              },
            },
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 allOf with missing keys in interaction 1`] = `
[
  {
    "description": "update response body: make property name optional",
    "diff": {
      "description": "required property 'name' was missing",
      "example": undefined,
      "instancePath": "/name",
      "key": "name",
      "keyword": "required",
      "kind": "MissingRequiredProperty",
      "parentObjectPath": "/allOf/1",
      "propertyPath": "/allOf/1/properties/name",
    },
    "groupedOperations": [
      {
        "op": "remove",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/allOf/1/required/0",
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"status":"ok"}",
          "contentType": "application/json",
          "size": 15,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 allOf with missing keys in interaction 2`] = `
{
  "info": {},
  "openapi": "3.1.0",
  "paths": {
    "/api/animals": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "status": {
                          "type": "string",
                        },
                      },
                      "required": [
                        "status",
                      ],
                      "type": "object",
                    },
                    {
                      "properties": {
                        "name": {
                          "type": "string",
                        },
                      },
                      "required": [],
                      "type": "object",
                    },
                  ],
                },
              },
            },
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 allOf with nested oneOf 1`] = `
[
  {
    "description": "update response body: add property results",
    "diff": {
      "description": "'results' is not documented",
      "example": [
        "123",
        "355",
        34,
      ],
      "instancePath": "/results",
      "key": "results",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/allOf/0/oneOf/0/properties",
      "propertyExamplePath": "/results",
      "propertyPath": "/allOf/0/oneOf/0/properties/results",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/allOf/0/oneOf/0/required/-",
        "value": "results",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/allOf/0/oneOf/0/properties/results",
        "value": {
          "items": {
            "type": "string",
          },
          "type": "array",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"hello":"ok","goodbye":"me","results":["123","355",34]}",
          "contentType": "application/json",
          "size": 56,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: make items oneOf",
    "diff": {
      "description": "'items' did not match schema",
      "example": 34,
      "expectedType": "string",
      "instancePath": "/results/2",
      "key": "items",
      "keyword": "type",
      "kind": "UnmatchedType",
      "propertyPath": "/allOf/0/oneOf/0/properties/results/items",
    },
    "groupedOperations": [
      {
        "op": "remove",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/allOf/0/oneOf/0/properties/results/items/type",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/allOf/0/oneOf/0/properties/results/items/oneOf",
        "value": [
          {
            "type": "string",
          },
          {
            "type": "number",
          },
        ],
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"hello":"ok","goodbye":"me","results":["123","355",34]}",
          "contentType": "application/json",
          "size": 56,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 allOf with nested oneOf 2`] = `
{
  "info": {},
  "openapi": "3.1.0",
  "paths": {
    "/api/animals": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "oneOf": [
                        {
                          "properties": {
                            "goodbye": {
                              "type": "string",
                            },
                            "hello": {
                              "type": "string",
                            },
                            "results": {
                              "items": {
                                "oneOf": [
                                  {
                                    "type": "string",
                                  },
                                  {
                                    "type": "number",
                                  },
                                ],
                              },
                              "type": "array",
                            },
                          },
                          "required": [
                            "hello",
                            "goodbye",
                            "results",
                          ],
                          "type": "object",
                        },
                      ],
                    },
                  ],
                },
              },
            },
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 array with multiple items 1`] = `
[
  {
    "description": "update response body: add property books",
    "diff": {
      "description": "'books' is not documented",
      "example": [
        {
          "author_id": "6nTxAFM5ck4Hob77hGQoL",
          "id": "WjE9O1d8ELCb8POiOw4pn",
          "price": 10,
        },
        {
          "id": "asdf",
          "price": 1,
        },
        {
          "author_id": "6nTxAFM5ck4Hob77hGQoL",
          "id": "123",
        },
        null,
      ],
      "instancePath": "/books",
      "key": "books",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties",
      "propertyExamplePath": "/books",
      "propertyPath": "/properties/books",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties",
        "value": {},
      },
      {
        "extra": "same",
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/required",
        "value": [
          "books",
        ],
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books",
        "value": {
          "items": {
            "type": "object",
          },
          "type": "array",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"books":[{"id":"WjE9O1d8ELCb8POiOw4pn","author_id":"6nTxAFM5ck4Hob77hGQoL","price":10},{"id":"asdf","price":1},{"id":"123","author_id":"6nTxAFM5ck4Hob77hGQoL"},null]}",
          "contentType": "application/json",
          "size": 167,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property id",
    "diff": {
      "description": "'id' is not documented",
      "example": "WjE9O1d8ELCb8POiOw4pn",
      "instancePath": "/books/0/id",
      "key": "id",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/books/items/properties",
      "propertyExamplePath": "/books/0/id",
      "propertyPath": "/properties/books/items/properties/id",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/properties",
        "value": {},
      },
      {
        "extra": "same",
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/required",
        "value": [
          "id",
        ],
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/properties/id",
        "value": {
          "type": "string",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"books":[{"id":"WjE9O1d8ELCb8POiOw4pn","author_id":"6nTxAFM5ck4Hob77hGQoL","price":10},{"id":"asdf","price":1},{"id":"123","author_id":"6nTxAFM5ck4Hob77hGQoL"},null]}",
          "contentType": "application/json",
          "size": 167,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property author_id",
    "diff": {
      "description": "'author_id' is not documented",
      "example": "6nTxAFM5ck4Hob77hGQoL",
      "instancePath": "/books/0/author_id",
      "key": "author_id",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/books/items/properties",
      "propertyExamplePath": "/books/0/author_id",
      "propertyPath": "/properties/books/items/properties/author_id",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/required/-",
        "value": "author_id",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/properties/author_id",
        "value": {
          "type": "string",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"books":[{"id":"WjE9O1d8ELCb8POiOw4pn","author_id":"6nTxAFM5ck4Hob77hGQoL","price":10},{"id":"asdf","price":1},{"id":"123","author_id":"6nTxAFM5ck4Hob77hGQoL"},null]}",
          "contentType": "application/json",
          "size": 167,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property price",
    "diff": {
      "description": "'price' is not documented",
      "example": 10,
      "instancePath": "/books/0/price",
      "key": "price",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/books/items/properties",
      "propertyExamplePath": "/books/0/price",
      "propertyPath": "/properties/books/items/properties/price",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/required/-",
        "value": "price",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/properties/price",
        "value": {
          "type": "number",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"books":[{"id":"WjE9O1d8ELCb8POiOw4pn","author_id":"6nTxAFM5ck4Hob77hGQoL","price":10},{"id":"asdf","price":1},{"id":"123","author_id":"6nTxAFM5ck4Hob77hGQoL"},null]}",
          "contentType": "application/json",
          "size": 167,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: make items null",
    "diff": {
      "description": "'items' did not match schema",
      "example": null,
      "expectedType": "object",
      "instancePath": "/books/3",
      "key": "items",
      "keyword": "type",
      "kind": "UnmatchedType",
      "propertyPath": "/properties/books/items",
    },
    "groupedOperations": [
      {
        "op": "replace",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/type",
        "value": [
          "object",
          "null",
        ],
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"books":[{"id":"WjE9O1d8ELCb8POiOw4pn","author_id":"6nTxAFM5ck4Hob77hGQoL","price":10},{"id":"asdf","price":1},{"id":"123","author_id":"6nTxAFM5ck4Hob77hGQoL"},null]}",
          "contentType": "application/json",
          "size": 167,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: make property author_id optional",
    "diff": {
      "description": "required property 'author_id' was missing",
      "example": undefined,
      "instancePath": "/books/1/author_id",
      "key": "author_id",
      "keyword": "required",
      "kind": "MissingRequiredProperty",
      "parentObjectPath": "/properties/books/items",
      "propertyPath": "/properties/books/items/properties/author_id",
    },
    "groupedOperations": [
      {
        "op": "remove",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/required/1",
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"books":[{"id":"WjE9O1d8ELCb8POiOw4pn","author_id":"6nTxAFM5ck4Hob77hGQoL","price":10},{"id":"asdf","price":1},{"id":"123","author_id":"6nTxAFM5ck4Hob77hGQoL"},null]}",
          "contentType": "application/json",
          "size": 167,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: make property price optional",
    "diff": {
      "description": "required property 'price' was missing",
      "example": undefined,
      "instancePath": "/books/2/price",
      "key": "price",
      "keyword": "required",
      "kind": "MissingRequiredProperty",
      "parentObjectPath": "/properties/books/items",
      "propertyPath": "/properties/books/items/properties/price",
    },
    "groupedOperations": [
      {
        "op": "remove",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/required/1",
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"books":[{"id":"WjE9O1d8ELCb8POiOw4pn","author_id":"6nTxAFM5ck4Hob77hGQoL","price":10},{"id":"asdf","price":1},{"id":"123","author_id":"6nTxAFM5ck4Hob77hGQoL"},null]}",
          "contentType": "application/json",
          "size": 167,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 array with multiple items 2`] = `
{
  "info": {},
  "openapi": "3.1.0",
  "paths": {
    "/api/animals": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "books": {
                      "items": {
                        "properties": {
                          "author_id": {
                            "type": "string",
                          },
                          "id": {
                            "type": "string",
                          },
                          "price": {
                            "type": "number",
                          },
                        },
                        "required": [
                          "id",
                        ],
                        "type": [
                          "object",
                          "null",
                        ],
                      },
                      "type": "array",
                    },
                  },
                  "required": [
                    "books",
                  ],
                  "type": "object",
                },
              },
            },
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 collects unpatchable diffs 1`] = `
[
  {
    "bodyPath": "/paths/~1api~1animals/post/responses/200/content/application~1json",
    "example": "not-ok",
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"status":"ok"},{"status":"not-ok"}]}",
          "contentType": "application/json",
          "size": 46,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/properties/status/const",
    "schemaPath": "/properties/data/items/properties/status/const",
    "unpatchable": true,
    "validationError": {
      "instancePath": "/data/1/status",
      "keyword": "const",
      "message": "must be equal to constant",
      "params": {
        "allowedValue": "ok",
      },
      "schemaPath": "#/properties/data/items/properties/status/const",
    },
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 collects unpatchable diffs 2`] = `
{
  "info": {},
  "openapi": "3.1.0",
  "paths": {
    "/api/animals": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "properties": {
                          "status": {
                            "const": "ok",
                            "type": "string",
                          },
                        },
                        "required": [
                          "status",
                        ],
                        "type": "object",
                      },
                      "type": "array",
                    },
                  },
                  "type": "object",
                },
              },
            },
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 existing schema that does not match 1`] = `
[
  {
    "description": "update response body: make property data optional",
    "diff": {
      "description": "required property 'data' was missing",
      "example": undefined,
      "instancePath": "/data",
      "key": "data",
      "keyword": "required",
      "kind": "MissingRequiredProperty",
      "parentObjectPath": "",
      "propertyPath": "/properties/data",
    },
    "groupedOperations": [
      {
        "op": "remove",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/required/0",
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"books":[{"id":"WjE9O1d8ELCb8POiOw4pn","name":"Pride and Prejudice","author_id":"6nTxAFM5ck4Hob77hGQoL","price":10,"created_at":"2023-01-22T17:17:41.326Z","updated_at":"2023-01-22T17:17:41.326Z"},{"id":"vZsYVmzdxtihxQNqCs-3f","name":"The Great Gatsby","author_id":"NjpTwgmENj11rGdUgpCQ9","price":15,"created_at":"2022-10-22T10:11:51.421Z","updated_at":"2022-10-22T10:11:51.421Z"}]}",
          "contentType": "application/json",
          "size": 382,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: make property next optional",
    "diff": {
      "description": "required property 'next' was missing",
      "example": undefined,
      "instancePath": "/next",
      "key": "next",
      "keyword": "required",
      "kind": "MissingRequiredProperty",
      "parentObjectPath": "",
      "propertyPath": "/properties/next",
    },
    "groupedOperations": [
      {
        "op": "remove",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/required/0",
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"books":[{"id":"WjE9O1d8ELCb8POiOw4pn","name":"Pride and Prejudice","author_id":"6nTxAFM5ck4Hob77hGQoL","price":10,"created_at":"2023-01-22T17:17:41.326Z","updated_at":"2023-01-22T17:17:41.326Z"},{"id":"vZsYVmzdxtihxQNqCs-3f","name":"The Great Gatsby","author_id":"NjpTwgmENj11rGdUgpCQ9","price":15,"created_at":"2022-10-22T10:11:51.421Z","updated_at":"2022-10-22T10:11:51.421Z"}]}",
          "contentType": "application/json",
          "size": 382,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: make property has_more_data optional",
    "diff": {
      "description": "required property 'has_more_data' was missing",
      "example": undefined,
      "instancePath": "/has_more_data",
      "key": "has_more_data",
      "keyword": "required",
      "kind": "MissingRequiredProperty",
      "parentObjectPath": "",
      "propertyPath": "/properties/has_more_data",
    },
    "groupedOperations": [
      {
        "op": "remove",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/required/0",
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"books":[{"id":"WjE9O1d8ELCb8POiOw4pn","name":"Pride and Prejudice","author_id":"6nTxAFM5ck4Hob77hGQoL","price":10,"created_at":"2023-01-22T17:17:41.326Z","updated_at":"2023-01-22T17:17:41.326Z"},{"id":"vZsYVmzdxtihxQNqCs-3f","name":"The Great Gatsby","author_id":"NjpTwgmENj11rGdUgpCQ9","price":15,"created_at":"2022-10-22T10:11:51.421Z","updated_at":"2022-10-22T10:11:51.421Z"}]}",
          "contentType": "application/json",
          "size": 382,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property books",
    "diff": {
      "description": "'books' is not documented",
      "example": [
        {
          "author_id": "6nTxAFM5ck4Hob77hGQoL",
          "created_at": "2023-01-22T17:17:41.326Z",
          "id": "WjE9O1d8ELCb8POiOw4pn",
          "name": "Pride and Prejudice",
          "price": 10,
          "updated_at": "2023-01-22T17:17:41.326Z",
        },
        {
          "author_id": "NjpTwgmENj11rGdUgpCQ9",
          "created_at": "2022-10-22T10:11:51.421Z",
          "id": "vZsYVmzdxtihxQNqCs-3f",
          "name": "The Great Gatsby",
          "price": 15,
          "updated_at": "2022-10-22T10:11:51.421Z",
        },
      ],
      "instancePath": "/books",
      "key": "books",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties",
      "propertyExamplePath": "/books",
      "propertyPath": "/properties/books",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/required/-",
        "value": "books",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books",
        "value": {
          "items": {
            "type": "object",
          },
          "type": "array",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"books":[{"id":"WjE9O1d8ELCb8POiOw4pn","name":"Pride and Prejudice","author_id":"6nTxAFM5ck4Hob77hGQoL","price":10,"created_at":"2023-01-22T17:17:41.326Z","updated_at":"2023-01-22T17:17:41.326Z"},{"id":"vZsYVmzdxtihxQNqCs-3f","name":"The Great Gatsby","author_id":"NjpTwgmENj11rGdUgpCQ9","price":15,"created_at":"2022-10-22T10:11:51.421Z","updated_at":"2022-10-22T10:11:51.421Z"}]}",
          "contentType": "application/json",
          "size": 382,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property id",
    "diff": {
      "description": "'id' is not documented",
      "example": "WjE9O1d8ELCb8POiOw4pn",
      "instancePath": "/books/0/id",
      "key": "id",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/books/items/properties",
      "propertyExamplePath": "/books/0/id",
      "propertyPath": "/properties/books/items/properties/id",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/properties",
        "value": {},
      },
      {
        "extra": "same",
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/required",
        "value": [
          "id",
        ],
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/properties/id",
        "value": {
          "type": "string",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"books":[{"id":"WjE9O1d8ELCb8POiOw4pn","name":"Pride and Prejudice","author_id":"6nTxAFM5ck4Hob77hGQoL","price":10,"created_at":"2023-01-22T17:17:41.326Z","updated_at":"2023-01-22T17:17:41.326Z"},{"id":"vZsYVmzdxtihxQNqCs-3f","name":"The Great Gatsby","author_id":"NjpTwgmENj11rGdUgpCQ9","price":15,"created_at":"2022-10-22T10:11:51.421Z","updated_at":"2022-10-22T10:11:51.421Z"}]}",
          "contentType": "application/json",
          "size": 382,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property name",
    "diff": {
      "description": "'name' is not documented",
      "example": "Pride and Prejudice",
      "instancePath": "/books/0/name",
      "key": "name",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/books/items/properties",
      "propertyExamplePath": "/books/0/name",
      "propertyPath": "/properties/books/items/properties/name",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/required/-",
        "value": "name",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/properties/name",
        "value": {
          "type": "string",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"books":[{"id":"WjE9O1d8ELCb8POiOw4pn","name":"Pride and Prejudice","author_id":"6nTxAFM5ck4Hob77hGQoL","price":10,"created_at":"2023-01-22T17:17:41.326Z","updated_at":"2023-01-22T17:17:41.326Z"},{"id":"vZsYVmzdxtihxQNqCs-3f","name":"The Great Gatsby","author_id":"NjpTwgmENj11rGdUgpCQ9","price":15,"created_at":"2022-10-22T10:11:51.421Z","updated_at":"2022-10-22T10:11:51.421Z"}]}",
          "contentType": "application/json",
          "size": 382,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property author_id",
    "diff": {
      "description": "'author_id' is not documented",
      "example": "6nTxAFM5ck4Hob77hGQoL",
      "instancePath": "/books/0/author_id",
      "key": "author_id",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/books/items/properties",
      "propertyExamplePath": "/books/0/author_id",
      "propertyPath": "/properties/books/items/properties/author_id",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/required/-",
        "value": "author_id",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/properties/author_id",
        "value": {
          "type": "string",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"books":[{"id":"WjE9O1d8ELCb8POiOw4pn","name":"Pride and Prejudice","author_id":"6nTxAFM5ck4Hob77hGQoL","price":10,"created_at":"2023-01-22T17:17:41.326Z","updated_at":"2023-01-22T17:17:41.326Z"},{"id":"vZsYVmzdxtihxQNqCs-3f","name":"The Great Gatsby","author_id":"NjpTwgmENj11rGdUgpCQ9","price":15,"created_at":"2022-10-22T10:11:51.421Z","updated_at":"2022-10-22T10:11:51.421Z"}]}",
          "contentType": "application/json",
          "size": 382,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property price",
    "diff": {
      "description": "'price' is not documented",
      "example": 10,
      "instancePath": "/books/0/price",
      "key": "price",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/books/items/properties",
      "propertyExamplePath": "/books/0/price",
      "propertyPath": "/properties/books/items/properties/price",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/required/-",
        "value": "price",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/properties/price",
        "value": {
          "type": "number",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"books":[{"id":"WjE9O1d8ELCb8POiOw4pn","name":"Pride and Prejudice","author_id":"6nTxAFM5ck4Hob77hGQoL","price":10,"created_at":"2023-01-22T17:17:41.326Z","updated_at":"2023-01-22T17:17:41.326Z"},{"id":"vZsYVmzdxtihxQNqCs-3f","name":"The Great Gatsby","author_id":"NjpTwgmENj11rGdUgpCQ9","price":15,"created_at":"2022-10-22T10:11:51.421Z","updated_at":"2022-10-22T10:11:51.421Z"}]}",
          "contentType": "application/json",
          "size": 382,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property created_at",
    "diff": {
      "description": "'created_at' is not documented",
      "example": "2023-01-22T17:17:41.326Z",
      "instancePath": "/books/0/created_at",
      "key": "created_at",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/books/items/properties",
      "propertyExamplePath": "/books/0/created_at",
      "propertyPath": "/properties/books/items/properties/created_at",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/required/-",
        "value": "created_at",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/properties/created_at",
        "value": {
          "type": "string",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"books":[{"id":"WjE9O1d8ELCb8POiOw4pn","name":"Pride and Prejudice","author_id":"6nTxAFM5ck4Hob77hGQoL","price":10,"created_at":"2023-01-22T17:17:41.326Z","updated_at":"2023-01-22T17:17:41.326Z"},{"id":"vZsYVmzdxtihxQNqCs-3f","name":"The Great Gatsby","author_id":"NjpTwgmENj11rGdUgpCQ9","price":15,"created_at":"2022-10-22T10:11:51.421Z","updated_at":"2022-10-22T10:11:51.421Z"}]}",
          "contentType": "application/json",
          "size": 382,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property updated_at",
    "diff": {
      "description": "'updated_at' is not documented",
      "example": "2023-01-22T17:17:41.326Z",
      "instancePath": "/books/0/updated_at",
      "key": "updated_at",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/books/items/properties",
      "propertyExamplePath": "/books/0/updated_at",
      "propertyPath": "/properties/books/items/properties/updated_at",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/required/-",
        "value": "updated_at",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/books/items/properties/updated_at",
        "value": {
          "type": "string",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"books":[{"id":"WjE9O1d8ELCb8POiOw4pn","name":"Pride and Prejudice","author_id":"6nTxAFM5ck4Hob77hGQoL","price":10,"created_at":"2023-01-22T17:17:41.326Z","updated_at":"2023-01-22T17:17:41.326Z"},{"id":"vZsYVmzdxtihxQNqCs-3f","name":"The Great Gatsby","author_id":"NjpTwgmENj11rGdUgpCQ9","price":15,"created_at":"2022-10-22T10:11:51.421Z","updated_at":"2022-10-22T10:11:51.421Z"}]}",
          "contentType": "application/json",
          "size": 382,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 existing schema that does not match 2`] = `
{
  "info": {},
  "openapi": "3.1.0",
  "paths": {
    "/api/animals": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "books": {
                      "items": {
                        "properties": {
                          "author_id": {
                            "type": "string",
                          },
                          "created_at": {
                            "type": "string",
                          },
                          "id": {
                            "type": "string",
                          },
                          "name": {
                            "type": "string",
                          },
                          "price": {
                            "type": "number",
                          },
                          "updated_at": {
                            "type": "string",
                          },
                        },
                        "required": [
                          "id",
                          "name",
                          "author_id",
                          "price",
                          "created_at",
                          "updated_at",
                        ],
                        "type": "object",
                      },
                      "type": "array",
                    },
                    "data": {
                      "items": {
                        "type": "object",
                      },
                      "type": "array",
                    },
                    "has_more_data": {
                      "type": "boolean",
                    },
                    "next": {
                      "nullable": true,
                    },
                  },
                  "required": [
                    "books",
                  ],
                  "type": "object",
                },
              },
            },
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 header parameter not documented 1`] = `
[
  {
    "description": "operation: add 200 response",
    "diff": {
      "contentType": "application/json",
      "kind": "UnmatchedResponseStatusCode",
      "statusCode": "200",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200",
        "value": {
          "description": "200 response",
        },
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content",
        "value": {
          "application/json": {},
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [
          {
            "name": "undocumented",
            "value": "abc",
          },
        ],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post",
  },
  {
    "description": "update response body: add schema object",
    "diff": undefined,
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
        "value": {},
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/type",
        "value": "object",
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [
          {
            "name": "undocumented",
            "value": "abc",
          },
        ],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 header parameter not documented 2`] = `
{
  "info": {},
  "openapi": "3.1.0",
  "paths": {
    "/api/animals": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                },
              },
            },
            "description": "200 response",
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 header parameter required but not seen 1`] = `
[
  {
    "description": "operation: add 200 response",
    "diff": {
      "contentType": "application/json",
      "kind": "UnmatchedResponseStatusCode",
      "statusCode": "200",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200",
        "value": {
          "description": "200 response",
        },
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content",
        "value": {
          "application/json": {},
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post",
  },
  {
    "description": "make required header parameter optional",
    "diff": {
      "in": "header",
      "kind": "MissingRequiredRequiredParameter",
      "name": "required",
    },
    "groupedOperations": [
      {
        "op": "replace",
        "path": "/paths/~1api~1animals/post/parameters/0/required",
        "value": false,
      },
    ],
    "impact": [
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/parameters/0",
  },
  {
    "description": "update response body: add schema object",
    "diff": undefined,
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
        "value": {},
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/type",
        "value": "object",
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 header parameter required but not seen 2`] = `
{
  "info": {},
  "openapi": "3.1.0",
  "paths": {
    "/api/animals": {
      "post": {
        "parameters": [
          {
            "in": "header",
            "name": "required",
            "required": false,
            "schema": {
              "type": "string",
            },
          },
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                },
              },
            },
            "description": "200 response",
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 interactions with non-alphanumeric keys 1`] = `
[
  {
    "description": "operation: add 200 response",
    "diff": {
      "contentType": "application/json",
      "kind": "UnmatchedResponseStatusCode",
      "statusCode": "200",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200",
        "value": {
          "description": "200 response",
        },
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content",
        "value": {
          "application/json": {},
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post",
  },
  {
    "description": "update response body: add schema object",
    "diff": undefined,
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
        "value": {},
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/type",
        "value": "object",
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property data",
    "diff": {
      "description": "'data' is not documented",
      "example": [
        {
          "failure_rate()": 0,
          "tpm()": 0,
          "tuple(('duration', 300))": [
            [
              "duration",
              300,
            ],
          ],
          "user_misery()": 0,
          "😃things": [
            "duration",
            300,
          ],
        },
      ],
      "instancePath": "/data",
      "key": "data",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties",
      "propertyExamplePath": "/data",
      "propertyPath": "/properties/data",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties",
        "value": {},
      },
      {
        "extra": "same",
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/required",
        "value": [
          "data",
        ],
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data",
        "value": {
          "items": {
            "type": "object",
          },
          "type": "array",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property meta",
    "diff": {
      "description": "'meta' is not documented",
      "example": {
        "dataset": "discover",
        "fields": {
          "blah()": "number",
          "project_threshold_config": "string",
          "tuple(('duration', 300))": "string",
        },
        "isMetricsData": false,
        "tips": {
          "columns": null,
          "query": null,
        },
        "units": {
          "blah()": null,
          "tuple(('duration', 300))": null,
          "😃things": null,
        },
      },
      "instancePath": "/meta",
      "key": "meta",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties",
      "propertyExamplePath": "/meta",
      "propertyPath": "/properties/meta",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/required/-",
        "value": "meta",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta",
        "value": {
          "type": "object",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property tuple(('duration', 300))",
    "diff": {
      "description": "'tuple(('duration', 300))' is not documented",
      "example": [
        [
          "duration",
          300,
        ],
      ],
      "instancePath": "/data/0/tuple(('duration', 300))",
      "key": "tuple(('duration', 300))",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/data/items/properties",
      "propertyExamplePath": "/data/0/tuple(('duration', 300))",
      "propertyPath": "/properties/data/items/properties/tuple(('duration', 300))",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/properties",
        "value": {},
      },
      {
        "extra": "same",
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/required",
        "value": [
          "tuple(('duration', 300))",
        ],
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/properties/tuple(('duration', 300))",
        "value": {
          "items": {
            "items": {
              "type": "string",
            },
            "type": "array",
          },
          "type": "array",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property tpm()",
    "diff": {
      "description": "'tpm()' is not documented",
      "example": 0,
      "instancePath": "/data/0/tpm()",
      "key": "tpm()",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/data/items/properties",
      "propertyExamplePath": "/data/0/tpm()",
      "propertyPath": "/properties/data/items/properties/tpm()",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/required/-",
        "value": "tpm()",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/properties/tpm()",
        "value": {
          "type": "number",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property failure_rate()",
    "diff": {
      "description": "'failure_rate()' is not documented",
      "example": 0,
      "instancePath": "/data/0/failure_rate()",
      "key": "failure_rate()",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/data/items/properties",
      "propertyExamplePath": "/data/0/failure_rate()",
      "propertyPath": "/properties/data/items/properties/failure_rate()",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/required/-",
        "value": "failure_rate()",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/properties/failure_rate()",
        "value": {
          "type": "number",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property user_misery()",
    "diff": {
      "description": "'user_misery()' is not documented",
      "example": 0,
      "instancePath": "/data/0/user_misery()",
      "key": "user_misery()",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/data/items/properties",
      "propertyExamplePath": "/data/0/user_misery()",
      "propertyPath": "/properties/data/items/properties/user_misery()",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/required/-",
        "value": "user_misery()",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/properties/user_misery()",
        "value": {
          "type": "number",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property 😃things",
    "diff": {
      "description": "'😃things' is not documented",
      "example": [
        "duration",
        300,
      ],
      "instancePath": "/data/0/😃things",
      "key": "😃things",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/data/items/properties",
      "propertyExamplePath": "/data/0/😃things",
      "propertyPath": "/properties/data/items/properties/😃things",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/required/-",
        "value": "😃things",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/properties/😃things",
        "value": {
          "items": {
            "type": "string",
          },
          "type": "array",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property fields",
    "diff": {
      "description": "'fields' is not documented",
      "example": {
        "blah()": "number",
        "project_threshold_config": "string",
        "tuple(('duration', 300))": "string",
      },
      "instancePath": "/meta/fields",
      "key": "fields",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/meta/properties",
      "propertyExamplePath": "/meta/fields",
      "propertyPath": "/properties/meta/properties/fields",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties",
        "value": {},
      },
      {
        "extra": "same",
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/required",
        "value": [
          "fields",
        ],
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/fields",
        "value": {
          "type": "object",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property units",
    "diff": {
      "description": "'units' is not documented",
      "example": {
        "blah()": null,
        "tuple(('duration', 300))": null,
        "😃things": null,
      },
      "instancePath": "/meta/units",
      "key": "units",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/meta/properties",
      "propertyExamplePath": "/meta/units",
      "propertyPath": "/properties/meta/properties/units",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/required/-",
        "value": "units",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/units",
        "value": {
          "type": "object",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property isMetricsData",
    "diff": {
      "description": "'isMetricsData' is not documented",
      "example": false,
      "instancePath": "/meta/isMetricsData",
      "key": "isMetricsData",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/meta/properties",
      "propertyExamplePath": "/meta/isMetricsData",
      "propertyPath": "/properties/meta/properties/isMetricsData",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/required/-",
        "value": "isMetricsData",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/isMetricsData",
        "value": {
          "type": "boolean",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property tips",
    "diff": {
      "description": "'tips' is not documented",
      "example": {
        "columns": null,
        "query": null,
      },
      "instancePath": "/meta/tips",
      "key": "tips",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/meta/properties",
      "propertyExamplePath": "/meta/tips",
      "propertyPath": "/properties/meta/properties/tips",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/required/-",
        "value": "tips",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/tips",
        "value": {
          "type": "object",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property dataset",
    "diff": {
      "description": "'dataset' is not documented",
      "example": "discover",
      "instancePath": "/meta/dataset",
      "key": "dataset",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/meta/properties",
      "propertyExamplePath": "/meta/dataset",
      "propertyPath": "/properties/meta/properties/dataset",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/required/-",
        "value": "dataset",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/dataset",
        "value": {
          "type": "string",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: make items oneOf",
    "diff": {
      "description": "'items' did not match schema",
      "example": 300,
      "expectedType": "string",
      "instancePath": "/data/0/tuple(('duration', 300))/0/1",
      "key": "items",
      "keyword": "type",
      "kind": "UnmatchedType",
      "propertyPath": "/properties/data/items/properties/tuple(('duration', 300))/items/items",
    },
    "groupedOperations": [
      {
        "op": "remove",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/properties/tuple(('duration', 300))/items/items/type",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/properties/tuple(('duration', 300))/items/items/oneOf",
        "value": [
          {
            "type": "string",
          },
          {
            "type": "number",
          },
        ],
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: make items oneOf",
    "diff": {
      "description": "'items' did not match schema",
      "example": 300,
      "expectedType": "string",
      "instancePath": "/data/0/😃things/1",
      "key": "items",
      "keyword": "type",
      "kind": "UnmatchedType",
      "propertyPath": "/properties/data/items/properties/😃things/items",
    },
    "groupedOperations": [
      {
        "op": "remove",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/properties/😃things/items/type",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/properties/😃things/items/oneOf",
        "value": [
          {
            "type": "string",
          },
          {
            "type": "number",
          },
        ],
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property tuple(('duration', 300))",
    "diff": {
      "description": "'tuple(('duration', 300))' is not documented",
      "example": "string",
      "instancePath": "/meta/fields/tuple(('duration', 300))",
      "key": "tuple(('duration', 300))",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/meta/properties/fields/properties",
      "propertyExamplePath": "/meta/fields/tuple(('duration', 300))",
      "propertyPath": "/properties/meta/properties/fields/properties/tuple(('duration', 300))",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/fields/properties",
        "value": {},
      },
      {
        "extra": "same",
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/fields/required",
        "value": [
          "tuple(('duration', 300))",
        ],
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/fields/properties/tuple(('duration', 300))",
        "value": {
          "type": "string",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property blah()",
    "diff": {
      "description": "'blah()' is not documented",
      "example": "number",
      "instancePath": "/meta/fields/blah()",
      "key": "blah()",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/meta/properties/fields/properties",
      "propertyExamplePath": "/meta/fields/blah()",
      "propertyPath": "/properties/meta/properties/fields/properties/blah()",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/fields/required/-",
        "value": "blah()",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/fields/properties/blah()",
        "value": {
          "type": "string",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property project_threshold_config",
    "diff": {
      "description": "'project_threshold_config' is not documented",
      "example": "string",
      "instancePath": "/meta/fields/project_threshold_config",
      "key": "project_threshold_config",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/meta/properties/fields/properties",
      "propertyExamplePath": "/meta/fields/project_threshold_config",
      "propertyPath": "/properties/meta/properties/fields/properties/project_threshold_config",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/fields/required/-",
        "value": "project_threshold_config",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/fields/properties/project_threshold_config",
        "value": {
          "type": "string",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property tuple(('duration', 300))",
    "diff": {
      "description": "'tuple(('duration', 300))' is not documented",
      "example": null,
      "instancePath": "/meta/units/tuple(('duration', 300))",
      "key": "tuple(('duration', 300))",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/meta/properties/units/properties",
      "propertyExamplePath": "/meta/units/tuple(('duration', 300))",
      "propertyPath": "/properties/meta/properties/units/properties/tuple(('duration', 300))",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/units/properties",
        "value": {},
      },
      {
        "extra": "same",
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/units/required",
        "value": [
          "tuple(('duration', 300))",
        ],
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/units/properties/tuple(('duration', 300))",
        "value": {
          "type": "null",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property blah()",
    "diff": {
      "description": "'blah()' is not documented",
      "example": null,
      "instancePath": "/meta/units/blah()",
      "key": "blah()",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/meta/properties/units/properties",
      "propertyExamplePath": "/meta/units/blah()",
      "propertyPath": "/properties/meta/properties/units/properties/blah()",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/units/required/-",
        "value": "blah()",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/units/properties/blah()",
        "value": {
          "type": "null",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property 😃things",
    "diff": {
      "description": "'😃things' is not documented",
      "example": null,
      "instancePath": "/meta/units/😃things",
      "key": "😃things",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/meta/properties/units/properties",
      "propertyExamplePath": "/meta/units/😃things",
      "propertyPath": "/properties/meta/properties/units/properties/😃things",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/units/required/-",
        "value": "😃things",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/units/properties/😃things",
        "value": {
          "type": "null",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property query",
    "diff": {
      "description": "'query' is not documented",
      "example": null,
      "instancePath": "/meta/tips/query",
      "key": "query",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/meta/properties/tips/properties",
      "propertyExamplePath": "/meta/tips/query",
      "propertyPath": "/properties/meta/properties/tips/properties/query",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/tips/properties",
        "value": {},
      },
      {
        "extra": "same",
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/tips/required",
        "value": [
          "query",
        ],
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/tips/properties/query",
        "value": {
          "type": "null",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property columns",
    "diff": {
      "description": "'columns' is not documented",
      "example": null,
      "instancePath": "/meta/tips/columns",
      "key": "columns",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/meta/properties/tips/properties",
      "propertyExamplePath": "/meta/tips/columns",
      "propertyPath": "/properties/meta/properties/tips/properties/columns",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/tips/required/-",
        "value": "columns",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/meta/properties/tips/properties/columns",
        "value": {
          "type": "null",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"tuple(('duration', 300))":[["duration",300]],"tpm()":0,"failure_rate()":0,"user_misery()":0,"😃things":["duration",300]}],"meta":{"fields":{"tuple(('duration', 300))":"string","blah()":"number","project_threshold_config":"string"},"units":{"tuple(('duration', 300))":null,"blah()":null,"😃things":null},"isMetricsData":false,"tips":{"query":null,"columns":null},"dataset":"discover"}}",
          "contentType": "application/json",
          "size": 395,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 interactions with non-alphanumeric keys 2`] = `
{
  "info": {},
  "openapi": "3.1.0",
  "paths": {
    "/api/animals": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "properties": {
                          "failure_rate()": {
                            "type": "number",
                          },
                          "tpm()": {
                            "type": "number",
                          },
                          "tuple(('duration', 300))": {
                            "items": {
                              "items": {
                                "oneOf": [
                                  {
                                    "type": "string",
                                  },
                                  {
                                    "type": "number",
                                  },
                                ],
                              },
                              "type": "array",
                            },
                            "type": "array",
                          },
                          "user_misery()": {
                            "type": "number",
                          },
                          "😃things": {
                            "items": {
                              "oneOf": [
                                {
                                  "type": "string",
                                },
                                {
                                  "type": "number",
                                },
                              ],
                            },
                            "type": "array",
                          },
                        },
                        "required": [
                          "tuple(('duration', 300))",
                          "tpm()",
                          "failure_rate()",
                          "user_misery()",
                          "😃things",
                        ],
                        "type": "object",
                      },
                      "type": "array",
                    },
                    "meta": {
                      "properties": {
                        "dataset": {
                          "type": "string",
                        },
                        "fields": {
                          "properties": {
                            "blah()": {
                              "type": "string",
                            },
                            "project_threshold_config": {
                              "type": "string",
                            },
                            "tuple(('duration', 300))": {
                              "type": "string",
                            },
                          },
                          "required": [
                            "tuple(('duration', 300))",
                            "blah()",
                            "project_threshold_config",
                          ],
                          "type": "object",
                        },
                        "isMetricsData": {
                          "type": "boolean",
                        },
                        "tips": {
                          "properties": {
                            "columns": {
                              "type": "null",
                            },
                            "query": {
                              "type": "null",
                            },
                          },
                          "required": [
                            "query",
                            "columns",
                          ],
                          "type": "object",
                        },
                        "units": {
                          "properties": {
                            "blah()": {
                              "type": "null",
                            },
                            "tuple(('duration', 300))": {
                              "type": "null",
                            },
                            "😃things": {
                              "type": "null",
                            },
                          },
                          "required": [
                            "tuple(('duration', 300))",
                            "blah()",
                            "😃things",
                          ],
                          "type": "object",
                        },
                      },
                      "required": [
                        "fields",
                        "units",
                        "isMetricsData",
                        "tips",
                        "dataset",
                      ],
                      "type": "object",
                    },
                  },
                  "required": [
                    "data",
                    "meta",
                  ],
                  "type": "object",
                },
              },
            },
            "description": "200 response",
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 mismatched type in schema 1`] = `
[
  {
    "description": "update response body: make name oneOf",
    "diff": {
      "description": "'name' did not match schema",
      "example": "me",
      "expectedType": "number",
      "instancePath": "/name",
      "key": "name",
      "keyword": "type",
      "kind": "UnmatchedType",
      "propertyPath": "/properties/name",
    },
    "groupedOperations": [
      {
        "op": "remove",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/name/type",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/name/oneOf",
        "value": [
          {
            "type": "number",
          },
          {
            "type": "string",
          },
        ],
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"name":"me"}",
          "contentType": "application/json",
          "size": 13,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 mismatched type in schema 2`] = `
{
  "info": {},
  "openapi": "3.1.0",
  "paths": {
    "/api/animals": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "name": {
                      "oneOf": [
                        {
                          "type": "number",
                        },
                        {
                          "type": "string",
                        },
                      ],
                    },
                  },
                  "type": "object",
                },
              },
            },
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 missing required property 1`] = `
[
  {
    "description": "update response body: make property name optional",
    "diff": {
      "description": "required property 'name' was missing",
      "example": undefined,
      "instancePath": "/name",
      "key": "name",
      "keyword": "required",
      "kind": "MissingRequiredProperty",
      "parentObjectPath": "",
      "propertyPath": "/properties/name",
    },
    "groupedOperations": [
      {
        "op": "remove",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/required/0",
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 missing required property 2`] = `
{
  "info": {},
  "openapi": "3.1.0",
  "paths": {
    "/api/animals": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "name": {
                      "type": "string",
                    },
                  },
                  "required": [],
                  "type": "object",
                },
              },
            },
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 query parameter not documented 1`] = `
[
  {
    "description": "operation: add 200 response",
    "diff": {
      "contentType": "application/json",
      "kind": "UnmatchedResponseStatusCode",
      "statusCode": "200",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200",
        "value": {
          "description": "200 response",
        },
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content",
        "value": {
          "application/json": {},
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [
          {
            "name": "undocumented",
            "value": "abc",
          },
        ],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post",
  },
  {
    "description": "add parameters array to operation",
    "diff": {
      "kind": "MissingRequestParametersArray",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/parameters",
        "value": [],
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [
          {
            "name": "undocumented",
            "value": "abc",
          },
        ],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post",
  },
  {
    "description": "add undocumented query parameter",
    "diff": {
      "in": "query",
      "kind": "UnmatchedRequestParameter",
      "name": "undocumented",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/parameters/-",
        "value": {
          "in": "query",
          "name": "undocumented",
          "required": true,
          "schema": {
            "type": "string",
          },
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [
          {
            "name": "undocumented",
            "value": "abc",
          },
        ],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/parameters",
  },
  {
    "description": "update response body: add schema object",
    "diff": undefined,
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
        "value": {},
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/type",
        "value": "object",
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [
          {
            "name": "undocumented",
            "value": "abc",
          },
        ],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 query parameter not documented 2`] = `
{
  "info": {},
  "openapi": "3.1.0",
  "paths": {
    "/api/animals": {
      "post": {
        "parameters": [
          {
            "in": "query",
            "name": "undocumented",
            "required": true,
            "schema": {
              "type": "string",
            },
          },
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                },
              },
            },
            "description": "200 response",
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 query parameter required but not seen 1`] = `
[
  {
    "description": "operation: add 200 response",
    "diff": {
      "contentType": "application/json",
      "kind": "UnmatchedResponseStatusCode",
      "statusCode": "200",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200",
        "value": {
          "description": "200 response",
        },
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content",
        "value": {
          "application/json": {},
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post",
  },
  {
    "description": "make required query parameter optional",
    "diff": {
      "in": "query",
      "kind": "MissingRequiredRequiredParameter",
      "name": "required",
    },
    "groupedOperations": [
      {
        "op": "replace",
        "path": "/paths/~1api~1animals/post/parameters/0/required",
        "value": false,
      },
    ],
    "impact": [
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/parameters/0",
  },
  {
    "description": "update response body: add schema object",
    "diff": undefined,
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
        "value": {},
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/type",
        "value": "object",
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 query parameter required but not seen 2`] = `
{
  "info": {},
  "openapi": "3.1.0",
  "paths": {
    "/api/animals": {
      "post": {
        "parameters": [
          {
            "in": "query",
            "name": "required",
            "required": false,
            "schema": {
              "type": "string",
            },
          },
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                },
              },
            },
            "description": "200 response",
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 response headers not documented 1`] = `
[
  {
    "description": "operation: add 200 response",
    "diff": {
      "contentType": "application/json",
      "kind": "UnmatchedResponseStatusCode",
      "statusCode": "200",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200",
        "value": {
          "description": "200 response",
        },
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content",
        "value": {
          "application/json": {},
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [
          {
            "name": "undocumented",
            "value": "abc",
          },
        ],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post",
  },
  {
    "description": "update response body: add schema object",
    "diff": undefined,
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
        "value": {},
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/type",
        "value": "object",
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [
          {
            "name": "undocumented",
            "value": "abc",
          },
        ],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 response headers not documented 2`] = `
{
  "info": {},
  "openapi": "3.1.0",
  "paths": {
    "/api/animals": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                },
              },
            },
            "description": "200 response",
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 response headers required but not seen 1`] = `
[
  {
    "description": "make required response header in 200 response optional",
    "diff": {
      "kind": "MissingRequiredResponseHeader",
      "name": "required",
      "statusCode": "200",
    },
    "groupedOperations": [
      {
        "op": "replace",
        "path": "/paths/~1api~1animals/post/responses/200/headers/required/required",
        "value": false,
      },
    ],
    "impact": [
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/headers/required",
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 response headers required but not seen 2`] = `
{
  "info": {},
  "openapi": "3.1.0",
  "paths": {
    "/api/animals": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "properties": {
                          "status": {
                            "const": "ok",
                            "type": "string",
                          },
                        },
                        "required": [
                          "status",
                        ],
                        "type": "object",
                      },
                      "type": "array",
                    },
                  },
                  "type": "object",
                },
              },
            },
            "headers": {
              "required": {
                "name": "required",
                "required": false,
                "schema": {
                  "type": "string",
                },
              },
            },
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 schema with arrays with polymorphic items 1`] = `
[
  {
    "description": "update response body: make status null",
    "diff": {
      "description": "'status' did not match schema",
      "example": null,
      "expectedType": "string",
      "instancePath": "/data/0/status",
      "key": "status",
      "keyword": "type",
      "kind": "UnmatchedType",
      "propertyPath": "/properties/data/items/properties/status",
    },
    "groupedOperations": [
      {
        "op": "replace",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/properties/status/type",
        "value": [
          "string",
          "null",
        ],
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"status":null},{"status":"something-else"},{"status":"another-thing"},{"status":null},{"status":123}]}",
          "contentType": "application/json",
          "size": 112,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: make status oneOf",
    "diff": {
      "description": "'status' did not match schema",
      "example": 123,
      "expectedType": "string,null",
      "instancePath": "/data/4/status",
      "key": "status",
      "keyword": "type",
      "kind": "UnmatchedType",
      "propertyPath": "/properties/data/items/properties/status",
    },
    "groupedOperations": [
      {
        "op": "remove",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/properties/status/type",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/properties/status/oneOf",
        "value": [
          {
            "type": [
              "string",
              "null",
            ],
          },
          {
            "type": "number",
          },
        ],
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"data":[{"status":null},{"status":"something-else"},{"status":"another-thing"},{"status":null},{"status":123}]}",
          "contentType": "application/json",
          "size": 112,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 schema with arrays with polymorphic items 2`] = `
{
  "info": {},
  "openapi": "3.1.0",
  "paths": {
    "/api/animals": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "properties": {
                          "status": {
                            "oneOf": [
                              {
                                "type": [
                                  "string",
                                  "null",
                                ],
                              },
                              {
                                "type": "number",
                              },
                            ],
                          },
                        },
                        "required": [
                          "status",
                        ],
                        "type": "object",
                      },
                      "type": "array",
                    },
                  },
                  "type": "object",
                },
              },
            },
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 schema with enum 1`] = `
[
  {
    "description": "update response body: add enum something-else to status ",
    "diff": {
      "description": "'status' does not have enum value something-else",
      "example": {
        "data": [
          {
            "status": "something-else",
          },
          {
            "status": "another-thing",
          },
        ],
        "status": "something-else",
      },
      "instancePath": "/status",
      "key": "status",
      "keyword": "enum",
      "kind": "MissingEnumValue",
      "propertyPath": "/properties/status/enum",
      "value": "something-else",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/status/enum/-",
        "value": "something-else",
      },
    ],
    "impact": [
      "Addition",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"status":"something-else","data":[{"status":"something-else"},{"status":"another-thing"}]}",
          "contentType": "application/json",
          "size": 91,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add enum something-else to status ",
    "diff": {
      "description": "'status' does not have enum value something-else",
      "example": {
        "data": [
          {
            "status": "something-else",
          },
          {
            "status": "another-thing",
          },
        ],
        "status": "something-else",
      },
      "instancePath": "/data/0/status",
      "key": "status",
      "keyword": "enum",
      "kind": "MissingEnumValue",
      "propertyPath": "/properties/data/items/properties/status/enum",
      "value": "something-else",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/properties/status/enum/-",
        "value": "something-else",
      },
    ],
    "impact": [
      "Addition",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"status":"something-else","data":[{"status":"something-else"},{"status":"another-thing"}]}",
          "contentType": "application/json",
          "size": 91,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add enum another-thing to status ",
    "diff": {
      "description": "'status' does not have enum value another-thing",
      "example": {
        "data": [
          {
            "status": "something-else",
          },
          {
            "status": "another-thing",
          },
        ],
        "status": "something-else",
      },
      "instancePath": "/data/1/status",
      "key": "status",
      "keyword": "enum",
      "kind": "MissingEnumValue",
      "propertyPath": "/properties/data/items/properties/status/enum",
      "value": "another-thing",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/data/items/properties/status/enum/-",
        "value": "another-thing",
      },
    ],
    "impact": [
      "Addition",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"status":"something-else","data":[{"status":"something-else"},{"status":"another-thing"}]}",
          "contentType": "application/json",
          "size": 91,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 schema with enum 2`] = `
{
  "info": {},
  "openapi": "3.1.0",
  "paths": {
    "/api/animals": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "properties": {
                          "status": {
                            "enum": [
                              "ready",
                              "not_ready",
                              "something-else",
                              "another-thing",
                            ],
                            "type": "string",
                          },
                        },
                        "type": "object",
                      },
                      "type": "array",
                    },
                    "status": {
                      "enum": [
                        "ready",
                        "not_ready",
                        "something-else",
                      ],
                      "type": "string",
                    },
                  },
                  "required": [
                    "status",
                  ],
                  "type": "object",
                },
              },
            },
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 undocumented property in schema 1`] = `
[
  {
    "description": "update response body: add property name",
    "diff": {
      "description": "'name' is not documented",
      "example": "me",
      "instancePath": "/name",
      "key": "name",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties",
      "propertyExamplePath": "/name",
      "propertyPath": "/properties/name",
    },
    "groupedOperations": [
      {
        "extra": "same",
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/required",
        "value": [
          "name",
        ],
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/name",
        "value": {
          "type": "string",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"name":"me"}",
          "contentType": "application/json",
          "size": 13,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 undocumented property in schema 2`] = `
{
  "info": {},
  "openapi": "3.1.0",
  "paths": {
    "/api/animals": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "name": {
                      "type": "string",
                    },
                  },
                  "required": [
                    "name",
                  ],
                  "type": "object",
                },
              },
            },
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 undocumented request body 1`] = `
[
  {
    "description": "operation: add 'application/json' body as a valid request body type",
    "diff": {
      "contentType": "application/json",
      "kind": "UnmatchedRequestBody",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody",
        "value": {
          "content": {},
        },
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json",
        "value": {
          "schema": {},
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post",
  },
  {
    "description": "operation: add 200 response",
    "diff": {
      "contentType": "application/json",
      "kind": "UnmatchedResponseStatusCode",
      "statusCode": "200",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200",
        "value": {
          "description": "200 response",
        },
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content",
        "value": {
          "application/json": {},
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post",
  },
  {
    "description": "update request body: add schema object",
    "diff": undefined,
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/type",
        "value": "object",
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema",
  },
  {
    "description": "update request body: add property name",
    "diff": {
      "description": "'name' is not documented",
      "example": "me",
      "instancePath": "/name",
      "key": "name",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties",
      "propertyExamplePath": "/name",
      "propertyPath": "/properties/name",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/properties",
        "value": {},
      },
      {
        "extra": "same",
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/required",
        "value": [
          "name",
        ],
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/properties/name",
        "value": {
          "type": "string",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema",
  },
  {
    "description": "update request body: add property age",
    "diff": {
      "description": "'age' is not documented",
      "example": 100,
      "instancePath": "/age",
      "key": "age",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties",
      "propertyExamplePath": "/age",
      "propertyPath": "/properties/age",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/required/-",
        "value": "age",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/properties/age",
        "value": {
          "type": "number",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema",
  },
  {
    "description": "update request body: add property created_at",
    "diff": {
      "description": "'created_at' is not documented",
      "example": "2023-07-20T14:39:22.184Z",
      "instancePath": "/created_at",
      "key": "created_at",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties",
      "propertyExamplePath": "/created_at",
      "propertyPath": "/properties/created_at",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/required/-",
        "value": "created_at",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/properties/created_at",
        "value": {
          "type": "string",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema",
  },
  {
    "description": "update request body: add property hobbies",
    "diff": {
      "description": "'hobbies' is not documented",
      "example": [
        "running",
        {
          "name": "fishing",
          "type": "sport",
        },
        {
          "bad": null,
          "name": "basketball",
          "skill": 100,
          "type": "sport",
        },
      ],
      "instancePath": "/hobbies",
      "key": "hobbies",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties",
      "propertyExamplePath": "/hobbies",
      "propertyPath": "/properties/hobbies",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/required/-",
        "value": "hobbies",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/properties/hobbies",
        "value": {
          "items": {
            "type": "string",
          },
          "type": "array",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema",
  },
  {
    "description": "update request body: add property active",
    "diff": {
      "description": "'active' is not documented",
      "example": true,
      "instancePath": "/active",
      "key": "active",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties",
      "propertyExamplePath": "/active",
      "propertyPath": "/properties/active",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/required/-",
        "value": "active",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/properties/active",
        "value": {
          "type": "boolean",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema",
  },
  {
    "description": "update request body: make items oneOf",
    "diff": {
      "description": "'items' did not match schema",
      "example": {
        "name": "fishing",
        "type": "sport",
      },
      "expectedType": "string",
      "instancePath": "/hobbies/1",
      "key": "items",
      "keyword": "type",
      "kind": "UnmatchedType",
      "propertyPath": "/properties/hobbies/items",
    },
    "groupedOperations": [
      {
        "op": "remove",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/properties/hobbies/items/type",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/properties/hobbies/items/oneOf",
        "value": [
          {
            "type": "string",
          },
          {
            "type": "object",
          },
        ],
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema",
  },
  {
    "description": "update request body: add property type",
    "diff": {
      "description": "'type' is not documented",
      "example": "sport",
      "instancePath": "/hobbies/1/type",
      "key": "type",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/hobbies/items/oneOf/1/properties",
      "propertyExamplePath": "/hobbies/1/type",
      "propertyPath": "/properties/hobbies/items/oneOf/1/properties/type",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/properties/hobbies/items/oneOf/1/properties",
        "value": {},
      },
      {
        "extra": "same",
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/properties/hobbies/items/oneOf/1/required",
        "value": [
          "type",
        ],
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/properties/hobbies/items/oneOf/1/properties/type",
        "value": {
          "type": "string",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema",
  },
  {
    "description": "update request body: add property name",
    "diff": {
      "description": "'name' is not documented",
      "example": "fishing",
      "instancePath": "/hobbies/1/name",
      "key": "name",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/hobbies/items/oneOf/1/properties",
      "propertyExamplePath": "/hobbies/1/name",
      "propertyPath": "/properties/hobbies/items/oneOf/1/properties/name",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/properties/hobbies/items/oneOf/1/required/-",
        "value": "name",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/properties/hobbies/items/oneOf/1/properties/name",
        "value": {
          "type": "string",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema",
  },
  {
    "description": "update request body: add property skill",
    "diff": {
      "description": "'skill' is not documented",
      "example": 100,
      "instancePath": "/hobbies/2/skill",
      "key": "skill",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/hobbies/items/oneOf/1/properties",
      "propertyExamplePath": "/hobbies/2/skill",
      "propertyPath": "/properties/hobbies/items/oneOf/1/properties/skill",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/properties/hobbies/items/oneOf/1/required/-",
        "value": "skill",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/properties/hobbies/items/oneOf/1/properties/skill",
        "value": {
          "type": "number",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema",
  },
  {
    "description": "update request body: add property bad",
    "diff": {
      "description": "'bad' is not documented",
      "example": null,
      "instancePath": "/hobbies/2/bad",
      "key": "bad",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/hobbies/items/oneOf/1/properties",
      "propertyExamplePath": "/hobbies/2/bad",
      "propertyPath": "/properties/hobbies/items/oneOf/1/properties/bad",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/properties/hobbies/items/oneOf/1/required/-",
        "value": "bad",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/properties/hobbies/items/oneOf/1/properties/bad",
        "value": {
          "type": "null",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema",
  },
  {
    "description": "update request body: make property skill optional",
    "diff": {
      "description": "required property 'skill' was missing",
      "example": undefined,
      "instancePath": "/hobbies/1/skill",
      "key": "skill",
      "keyword": "required",
      "kind": "MissingRequiredProperty",
      "parentObjectPath": "/properties/hobbies/items/oneOf/1",
      "propertyPath": "/properties/hobbies/items/oneOf/1/properties/skill",
    },
    "groupedOperations": [
      {
        "op": "remove",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/properties/hobbies/items/oneOf/1/required/2",
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema",
  },
  {
    "description": "update request body: make property bad optional",
    "diff": {
      "description": "required property 'bad' was missing",
      "example": undefined,
      "instancePath": "/hobbies/1/bad",
      "key": "bad",
      "keyword": "required",
      "kind": "MissingRequiredProperty",
      "parentObjectPath": "/properties/hobbies/items/oneOf/1",
      "propertyPath": "/properties/hobbies/items/oneOf/1/properties/bad",
    },
    "groupedOperations": [
      {
        "op": "remove",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema/properties/hobbies/items/oneOf/1/required/2",
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema",
  },
  {
    "description": "update response body: add schema object",
    "diff": undefined,
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
        "value": {},
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/type",
        "value": "object",
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{}",
          "contentType": "application/json",
          "size": 2,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 undocumented request body 2`] = `
{
  "info": {},
  "openapi": "3.1.0",
  "paths": {
    "/api/animals": {
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "active": {
                    "type": "boolean",
                  },
                  "age": {
                    "type": "number",
                  },
                  "created_at": {
                    "type": "string",
                  },
                  "hobbies": {
                    "items": {
                      "oneOf": [
                        {
                          "type": "string",
                        },
                        {
                          "properties": {
                            "bad": {
                              "type": "null",
                            },
                            "name": {
                              "type": "string",
                            },
                            "skill": {
                              "type": "number",
                            },
                            "type": {
                              "type": "string",
                            },
                          },
                          "required": [
                            "type",
                            "name",
                          ],
                          "type": "object",
                        },
                      ],
                    },
                    "type": "array",
                  },
                  "name": {
                    "type": "string",
                  },
                },
                "required": [
                  "name",
                  "age",
                  "created_at",
                  "hobbies",
                  "active",
                ],
                "type": "object",
              },
            },
          },
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                },
              },
            },
            "description": "200 response",
          },
        },
      },
    },
  },
}
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 undocumented response body 1`] = `
[
  {
    "description": "operation: add 200 response",
    "diff": {
      "contentType": "application/json",
      "kind": "UnmatchedResponseStatusCode",
      "statusCode": "200",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200",
        "value": {
          "description": "200 response",
        },
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content",
        "value": {
          "application/json": {},
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post",
  },
  {
    "description": "update response body: add schema object",
    "diff": undefined,
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
        "value": {},
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/type",
        "value": "object",
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property name",
    "diff": {
      "description": "'name' is not documented",
      "example": "me",
      "instancePath": "/name",
      "key": "name",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties",
      "propertyExamplePath": "/name",
      "propertyPath": "/properties/name",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties",
        "value": {},
      },
      {
        "extra": "same",
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/required",
        "value": [
          "name",
        ],
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/name",
        "value": {
          "type": "string",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property age",
    "diff": {
      "description": "'age' is not documented",
      "example": 100,
      "instancePath": "/age",
      "key": "age",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties",
      "propertyExamplePath": "/age",
      "propertyPath": "/properties/age",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/required/-",
        "value": "age",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/age",
        "value": {
          "type": "number",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property created_at",
    "diff": {
      "description": "'created_at' is not documented",
      "example": "2023-07-20T14:39:22.184Z",
      "instancePath": "/created_at",
      "key": "created_at",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties",
      "propertyExamplePath": "/created_at",
      "propertyPath": "/properties/created_at",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/required/-",
        "value": "created_at",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/created_at",
        "value": {
          "type": "string",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property hobbies",
    "diff": {
      "description": "'hobbies' is not documented",
      "example": [
        "running",
        {
          "name": "fishing",
          "type": "sport",
        },
        {
          "bad": null,
          "name": "basketball",
          "skill": 100,
          "type": "sport",
        },
      ],
      "instancePath": "/hobbies",
      "key": "hobbies",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties",
      "propertyExamplePath": "/hobbies",
      "propertyPath": "/properties/hobbies",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/required/-",
        "value": "hobbies",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/hobbies",
        "value": {
          "items": {
            "type": "string",
          },
          "type": "array",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property active",
    "diff": {
      "description": "'active' is not documented",
      "example": true,
      "instancePath": "/active",
      "key": "active",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties",
      "propertyExamplePath": "/active",
      "propertyPath": "/properties/active",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/required/-",
        "value": "active",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/active",
        "value": {
          "type": "boolean",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: make items oneOf",
    "diff": {
      "description": "'items' did not match schema",
      "example": {
        "name": "fishing",
        "type": "sport",
      },
      "expectedType": "string",
      "instancePath": "/hobbies/1",
      "key": "items",
      "keyword": "type",
      "kind": "UnmatchedType",
      "propertyPath": "/properties/hobbies/items",
    },
    "groupedOperations": [
      {
        "op": "remove",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/hobbies/items/type",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/hobbies/items/oneOf",
        "value": [
          {
            "type": "string",
          },
          {
            "type": "object",
          },
        ],
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property type",
    "diff": {
      "description": "'type' is not documented",
      "example": "sport",
      "instancePath": "/hobbies/1/type",
      "key": "type",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/hobbies/items/oneOf/1/properties",
      "propertyExamplePath": "/hobbies/1/type",
      "propertyPath": "/properties/hobbies/items/oneOf/1/properties/type",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/hobbies/items/oneOf/1/properties",
        "value": {},
      },
      {
        "extra": "same",
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/hobbies/items/oneOf/1/required",
        "value": [
          "type",
        ],
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/hobbies/items/oneOf/1/properties/type",
        "value": {
          "type": "string",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property name",
    "diff": {
      "description": "'name' is not documented",
      "example": "fishing",
      "instancePath": "/hobbies/1/name",
      "key": "name",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/hobbies/items/oneOf/1/properties",
      "propertyExamplePath": "/hobbies/1/name",
      "propertyPath": "/properties/hobbies/items/oneOf/1/properties/name",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/hobbies/items/oneOf/1/required/-",
        "value": "name",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/hobbies/items/oneOf/1/properties/name",
        "value": {
          "type": "string",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property skill",
    "diff": {
      "description": "'skill' is not documented",
      "example": 100,
      "instancePath": "/hobbies/2/skill",
      "key": "skill",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/hobbies/items/oneOf/1/properties",
      "propertyExamplePath": "/hobbies/2/skill",
      "propertyPath": "/properties/hobbies/items/oneOf/1/properties/skill",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/hobbies/items/oneOf/1/required/-",
        "value": "skill",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/hobbies/items/oneOf/1/properties/skill",
        "value": {
          "type": "number",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: add property bad",
    "diff": {
      "description": "'bad' is not documented",
      "example": null,
      "instancePath": "/hobbies/2/bad",
      "key": "bad",
      "keyword": "additionalProperties",
      "kind": "AdditionalProperty",
      "parentObjectPath": "/properties/hobbies/items/oneOf/1/properties",
      "propertyExamplePath": "/hobbies/2/bad",
      "propertyPath": "/properties/hobbies/items/oneOf/1/properties/bad",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/hobbies/items/oneOf/1/required/-",
        "value": "bad",
      },
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/hobbies/items/oneOf/1/properties/bad",
        "value": {
          "type": "null",
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: make property skill optional",
    "diff": {
      "description": "required property 'skill' was missing",
      "example": undefined,
      "instancePath": "/hobbies/1/skill",
      "key": "skill",
      "keyword": "required",
      "kind": "MissingRequiredProperty",
      "parentObjectPath": "/properties/hobbies/items/oneOf/1",
      "propertyPath": "/properties/hobbies/items/oneOf/1/properties/skill",
    },
    "groupedOperations": [
      {
        "op": "remove",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/hobbies/items/oneOf/1/required/2",
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
  {
    "description": "update response body: make property bad optional",
    "diff": {
      "description": "required property 'bad' was missing",
      "example": undefined,
      "instancePath": "/hobbies/1/bad",
      "key": "bad",
      "keyword": "required",
      "kind": "MissingRequiredProperty",
      "parentObjectPath": "/properties/hobbies/items/oneOf/1",
      "propertyPath": "/properties/hobbies/items/oneOf/1/properties/bad",
    },
    "groupedOperations": [
      {
        "op": "remove",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema/properties/hobbies/items/oneOf/1/required/2",
      },
    ],
    "impact": [
      "Addition",
      "BackwardsIncompatible",
    ],
    "interaction": {
      "request": {
        "body": null,
        "headers": [],
        "host": "localhost:3030",
        "method": "post",
        "path": "/api/animals",
        "query": [],
      },
      "response": {
        "body": {
          "body": "{"name":"me","age":100,"created_at":"2023-07-20T14:39:22.184Z","hobbies":["running",{"type":"sport","name":"fishing"},{"type":"sport","name":"basketball","skill":100,"bad":null}],"active":true}",
          "contentType": "application/json",
          "size": 193,
        },
        "headers": [],
        "statusCode": "200",
      },
    },
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
]
`;

exports[`generateEndpointSpecPatches OAS version 3.1.0 undocumented response body 2`] = `
{
  "info": {},
  "openapi": "3.1.0",
  "paths": {
    "/api/animals": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "active": {
                      "type": "boolean",
                    },
                    "age": {
                      "type": "number",
                    },
                    "created_at": {
                      "type": "string",
                    },
                    "hobbies": {
                      "items": {
                        "oneOf": [
                          {
                            "type": "string",
                          },
                          {
                            "properties": {
                              "bad": {
                                "type": "null",
                              },
                              "name": {
                                "type": "string",
                              },
                              "skill": {
                                "type": "number",
                              },
                              "type": {
                                "type": "string",
                              },
                            },
                            "required": [
                              "type",
                              "name",
                            ],
                            "type": "object",
                          },
                        ],
                      },
                      "type": "array",
                    },
                    "name": {
                      "type": "string",
                    },
                  },
                  "required": [
                    "name",
                    "age",
                    "created_at",
                    "hobbies",
                    "active",
                  ],
                  "type": "object",
                },
              },
            },
            "description": "200 response",
          },
        },
      },
    },
  },
}
`;

exports[`generatePathAndMethodSpecPatches generates a method if the path exists but method does not 1`] = `
[
  {
    "description": "add 'POST' method for '/api/animals'",
    "diff": {
      "kind": "UnmatchedMethod",
      "pathPattern": "/api/animals",
      "subject": "post",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1animals/post",
        "value": {
          "responses": {},
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "path": "/paths/~1api~1animals",
  },
]
`;

exports[`generatePathAndMethodSpecPatches generates a method if the path exists but method does not 2`] = `
{
  "info": {},
  "paths": {
    "/api/animals": {
      "get": {
        "responses": {},
      },
      "post": {
        "responses": {},
      },
    },
  },
}
`;

exports[`generatePathAndMethodSpecPatches generates path and method if endpoint does not exist 1`] = `
[
  {
    "description": "add '/api/users' and method GET",
    "diff": {
      "kind": "UnmatchedPath",
      "subject": "/api/users",
    },
    "groupedOperations": [
      {
        "op": "add",
        "path": "/paths/~1api~1users",
        "value": {},
      },
      {
        "op": "add",
        "path": "/paths/~1api~1users/get",
        "value": {
          "responses": {},
        },
      },
    ],
    "impact": [
      "Addition",
      "BackwardsCompatible",
    ],
    "path": "/paths",
  },
]
`;

exports[`generatePathAndMethodSpecPatches generates path and method if endpoint does not exist 2`] = `
{
  "info": {},
  "paths": {
    "/api/animals": {
      "get": {
        "responses": {},
      },
    },
    "/api/users": {
      "get": {
        "responses": {},
      },
    },
  },
}
`;

exports[`generateRefRefactorPatches adds new component schema if no close schema 1`] = `
[
  {
    "description": "create and use $ref for body",
    "diff": undefined,
    "groupedOperations": [
      {
        "op": "add",
        "path": "/components/schemas/PostApiAnimals200ResponseBody",
        "value": {
          "properties": {
            "age": {
              "type": "number",
            },
            "created_at": {
              "type": "string",
            },
            "id": {
              "type": "string",
            },
            "name": {
              "type": "string",
            },
          },
          "required": [
            "name",
            "id",
          ],
          "type": "object",
        },
      },
      {
        "op": "replace",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
        "value": {
          "$ref": "#/components/schemas/PostApiAnimals200ResponseBody",
        },
      },
    ],
    "impact": [
      "Refactor",
    ],
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
]
`;

exports[`generateRefRefactorPatches adds new component schema if no close schema 2`] = `
{
  "components": {
    "schemas": {
      "MySchema": {
        "content": {
          "application/json": {
            "schema": {
              "properties": {
                "age": {
                  "type": "number",
                },
              },
              "type": "object",
            },
          },
        },
      },
      "PostApiAnimals200ResponseBody": {
        "properties": {
          "age": {
            "type": "number",
          },
          "created_at": {
            "type": "string",
          },
          "id": {
            "type": "string",
          },
          "name": {
            "type": "string",
          },
        },
        "required": [
          "name",
          "id",
        ],
        "type": "object",
      },
    },
  },
  "info": {},
  "openapi": "3.0.1",
  "paths": {
    "/api/animals": {
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "id": {
                    "format": "int64",
                    "type": "integer",
                  },
                },
                "type": "object",
              },
            },
          },
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostApiAnimals200ResponseBody",
                },
              },
            },
          },
        },
      },
    },
  },
}
`;

exports[`generateRefRefactorPatches only tried to add component schema once 1`] = `
[
  {
    "description": "create and use $ref for body",
    "diff": undefined,
    "groupedOperations": [
      {
        "op": "add",
        "path": "/components",
        "value": {
          "schemas": {},
        },
      },
      {
        "op": "add",
        "path": "/components/schemas/PostApiAnimalsRequestBody",
        "value": {
          "properties": {
            "id": {
              "format": "int64",
              "type": "integer",
            },
          },
          "type": "object",
        },
      },
      {
        "op": "replace",
        "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema",
        "value": {
          "$ref": "#/components/schemas/PostApiAnimalsRequestBody",
        },
      },
    ],
    "impact": [
      "Refactor",
    ],
    "path": "/paths/~1api~1animals/post/requestBody/content/application~1json/schema",
  },
  {
    "description": "create and use $ref for body",
    "diff": undefined,
    "groupedOperations": [
      {
        "op": "add",
        "path": "/components/schemas/PostApiAnimals200ResponseBody",
        "value": {
          "properties": {
            "age": {
              "type": "number",
            },
            "created_at": {
              "type": "string",
            },
            "id": {
              "type": "string",
            },
            "name": {
              "type": "string",
            },
          },
          "required": [
            "name",
            "id",
          ],
          "type": "object",
        },
      },
      {
        "op": "replace",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
        "value": {
          "$ref": "#/components/schemas/PostApiAnimals200ResponseBody",
        },
      },
    ],
    "impact": [
      "Refactor",
    ],
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
]
`;

exports[`generateRefRefactorPatches only tried to add component schema once 2`] = `
{
  "components": {
    "schemas": {
      "PostApiAnimals200ResponseBody": {
        "properties": {
          "age": {
            "type": "number",
          },
          "created_at": {
            "type": "string",
          },
          "id": {
            "type": "string",
          },
          "name": {
            "type": "string",
          },
        },
        "required": [
          "name",
          "id",
        ],
        "type": "object",
      },
      "PostApiAnimalsRequestBody": {
        "properties": {
          "id": {
            "format": "int64",
            "type": "integer",
          },
        },
        "type": "object",
      },
    },
  },
  "info": {},
  "openapi": "3.0.1",
  "paths": {
    "/api/animals": {
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PostApiAnimalsRequestBody",
              },
            },
          },
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostApiAnimals200ResponseBody",
                },
              },
            },
          },
        },
      },
    },
  },
}
`;

exports[`generateRefRefactorPatches uses existing component schema if close enough 1`] = `
[
  {
    "description": "use $ref /components/schemas/MySchema",
    "diff": undefined,
    "groupedOperations": [
      {
        "op": "replace",
        "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
        "value": {
          "$ref": "#/components/schemas/MySchema",
        },
      },
    ],
    "impact": [
      "Refactor",
    ],
    "path": "/paths/~1api~1animals/post/responses/200/content/application~1json/schema",
  },
]
`;

exports[`generateRefRefactorPatches uses existing component schema if close enough 2`] = `
{
  "components": {
    "schemas": {
      "MySchema": {
        "properties": {
          "age": {
            "type": "number",
          },
          "created_at": {
            "type": "string",
          },
          "id": {
            "type": "string",
          },
          "name": {
            "type": "string",
          },
        },
        "required": [
          "name",
          "id",
        ],
        "type": "object",
      },
    },
  },
  "info": {},
  "openapi": "3.0.1",
  "paths": {
    "/api/animals": {
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "id": {
                    "format": "int64",
                    "type": "integer",
                  },
                },
                "type": "object",
              },
            },
          },
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MySchema",
                },
              },
            },
          },
        },
      },
    },
  },
}
`;
