From 96163e815f8472cad2d2dad3c3b757df166bb0dc Mon Sep 17 00:00:00 2001 From: Mike Harder Date: Thu, 23 May 2024 05:31:51 +0000 Subject: [PATCH 01/10] Add test for compatible properties with a $ref --- src/test/compatiblePropertiesTest.ts | 33 +++++++++++++++++ src/test/specs/compatible-properties-ref.json | 35 +++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 src/test/specs/compatible-properties-ref.json diff --git a/src/test/compatiblePropertiesTest.ts b/src/test/compatiblePropertiesTest.ts index 16cd8365..11d803f9 100644 --- a/src/test/compatiblePropertiesTest.ts +++ b/src/test/compatiblePropertiesTest.ts @@ -35,3 +35,36 @@ test("compatible-properties", async () => { ] assert.deepStrictEqual(result, expected) }) + +// Ensures that $ref are resolved when determining if types are compatible. +// For example, these should be compatible: +// 1. "bar": { "type":"string" } +// 2. "bar": { "$ref":"#/definitions/MyString" }, "MyString": { "type": "string" } +test("compatible-properties-ref", async () => { + const diff = new OpenApiDiff({}) + const file = "src/test/specs/compatible-properties-ref.json" + const resultStr = await diff.compare(file, file) + const result = JSON.parse(resultStr) + const filePath = fileUrl(path.resolve(file)) + const expected = [ + { + code: "NoVersionChange", + docUrl: "https://github.com/Azure/openapi-diff/tree/master/docs/rules/1001.md", + id: "1001", + message: "The versions have not changed.", + mode: "Update", + new: { + ref: `${filePath}#`, + path: "", + location: `${filePath}:1:1` + }, + old: { + ref: `${filePath}#`, + path: "", + location: `${filePath}:1:1` + }, + type: "Info" + } + ] + assert.deepStrictEqual(result, expected) +}) diff --git a/src/test/specs/compatible-properties-ref.json b/src/test/specs/compatible-properties-ref.json new file mode 100644 index 00000000..3dac4cb8 --- /dev/null +++ b/src/test/specs/compatible-properties-ref.json @@ -0,0 +1,35 @@ +{ + "swagger": "2.0", + "info": { + "title": "xms-enum-name", + "version": "1.0" + }, + "paths": { + }, + "definitions": { + "FooBarString": { + "type":"object", + "properties": { + "bar": { + "type":"string" + } + }, + "allOf": [ + { + "$ref": "#/definitions/FooBarStringRef" + } + ] + }, + "FooBarStringRef": { + "type":"object", + "properties": { + "bar": { + "$ref":"#/definitions/MyString" + } + } + }, + "MyString": { + "type": "string" + } + } +} From 21d8420053d1d1550ff531c77a9a6981ccac5e6b Mon Sep 17 00:00:00 2001 From: Konrad Jamrozik Date: Thu, 23 May 2024 00:42:43 -0700 Subject: [PATCH 02/10] incompat_fix --- src/lib/util/resolveSwagger.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/lib/util/resolveSwagger.ts b/src/lib/util/resolveSwagger.ts index 8f82340d..4453cfc7 100644 --- a/src/lib/util/resolveSwagger.ts +++ b/src/lib/util/resolveSwagger.ts @@ -293,6 +293,26 @@ export class ResolveSwagger { if (!unwrappedProperty) { throw new Error("Null unwrapped property.") } + + // Note: per https://editor-next.swagger.io/ tooltip when hovering over '$ref', + // other properties must be ignored when $ref is present: + // + // $ref: string + // Any time a subschema is expected, a schema may instead use an object containing a "$ref" property. + // The value of the $ref is a URI Reference. Resolved against the current URI base, + // it identifies the URI of a schema to use. + // All other properties in a "$ref" object MUST be ignored. + // + if (parentProperty.$ref && unwrappedProperty.$ref) { + return this.isEqual(this.dereference(parentProperty.$ref), this.dereference(unwrappedProperty.$ref)) + } + if (parentProperty.$ref) { + return this.isEqual(this.dereference(parentProperty.$ref), unwrappedProperty) + } + if (unwrappedProperty.$ref) { + return this.isEqual(parentProperty, this.dereference(unwrappedProperty.$ref)) + } + if ((!parentProperty.type || parentProperty.type === "object") && (!unwrappedProperty.type || unwrappedProperty.type === "object")) { let parentPropertyToCompare = parentProperty let unwrappedPropertyToCompare = unwrappedProperty From 71e39b6a7390454d4a9fcce06d228557c60fc552 Mon Sep 17 00:00:00 2001 From: Mike Harder Date: Thu, 23 May 2024 07:54:48 +0000 Subject: [PATCH 03/10] Fix test titles --- src/test/specs/compatible-properties-ref.json | 2 +- src/test/specs/compatible-properties.json | 2 +- src/test/specs/incompatible-properties.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/specs/compatible-properties-ref.json b/src/test/specs/compatible-properties-ref.json index 3dac4cb8..159ea9c4 100644 --- a/src/test/specs/compatible-properties-ref.json +++ b/src/test/specs/compatible-properties-ref.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "title": "xms-enum-name", + "title": "compatible-properties-ref", "version": "1.0" }, "paths": { diff --git a/src/test/specs/compatible-properties.json b/src/test/specs/compatible-properties.json index df2201d7..7c96d415 100644 --- a/src/test/specs/compatible-properties.json +++ b/src/test/specs/compatible-properties.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "title": "xms-enum-name", + "title": "compatible-properties", "version": "1.0" }, "paths": { diff --git a/src/test/specs/incompatible-properties.json b/src/test/specs/incompatible-properties.json index 35037219..5da3a67d 100644 --- a/src/test/specs/incompatible-properties.json +++ b/src/test/specs/incompatible-properties.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "title": "xms-enum-name", + "title": "incompatible-properties", "version": "1.0" }, "paths": { From 9fb77898c9a31124c5a0727eea9a68dd811c0ef8 Mon Sep 17 00:00:00 2001 From: Konrad Jamrozik Date: Thu, 23 May 2024 01:10:05 -0700 Subject: [PATCH 04/10] Update src/lib/util/resolveSwagger.ts Co-authored-by: Mike Harder --- src/lib/util/resolveSwagger.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/lib/util/resolveSwagger.ts b/src/lib/util/resolveSwagger.ts index 4453cfc7..e28ad1ac 100644 --- a/src/lib/util/resolveSwagger.ts +++ b/src/lib/util/resolveSwagger.ts @@ -303,14 +303,11 @@ export class ResolveSwagger { // it identifies the URI of a schema to use. // All other properties in a "$ref" object MUST be ignored. // - if (parentProperty.$ref && unwrappedProperty.$ref) { - return this.isEqual(this.dereference(parentProperty.$ref), this.dereference(unwrappedProperty.$ref)) - } - if (parentProperty.$ref) { - return this.isEqual(this.dereference(parentProperty.$ref), unwrappedProperty) - } - if (unwrappedProperty.$ref) { - return this.isEqual(parentProperty, this.dereference(unwrappedProperty.$ref)) + if (parentProperty.$ref || unwrappedProperty.$ref) { + return this.isEqual( + parentProperty.$ref ? this.dereference(parentProperty.$ref) : parentProperty, + unwrappedProperty.$ref ? this.dereference(unwrappedProperty.$ref) : unwrappedProperty + ) } if ((!parentProperty.type || parentProperty.type === "object") && (!unwrappedProperty.type || unwrappedProperty.type === "object")) { From c2b8ef1861679073f0fe172ba9c40d6c587a1002 Mon Sep 17 00:00:00 2001 From: Mike Harder Date: Thu, 23 May 2024 09:06:00 +0000 Subject: [PATCH 05/10] Simplify isEqual() --- src/lib/util/resolveSwagger.ts | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/src/lib/util/resolveSwagger.ts b/src/lib/util/resolveSwagger.ts index e28ad1ac..2f25641f 100644 --- a/src/lib/util/resolveSwagger.ts +++ b/src/lib/util/resolveSwagger.ts @@ -303,31 +303,16 @@ export class ResolveSwagger { // it identifies the URI of a schema to use. // All other properties in a "$ref" object MUST be ignored. // - if (parentProperty.$ref || unwrappedProperty.$ref) { - return this.isEqual( - parentProperty.$ref ? this.dereference(parentProperty.$ref) : parentProperty, - unwrappedProperty.$ref ? this.dereference(unwrappedProperty.$ref) : unwrappedProperty - ) - } + parentProperty = parentProperty.$ref ? this.dereference(parentProperty.$ref) : parentProperty + unwrappedProperty = unwrappedProperty.$ref ? this.dereference(unwrappedProperty.$ref) : unwrappedProperty if ((!parentProperty.type || parentProperty.type === "object") && (!unwrappedProperty.type || unwrappedProperty.type === "object")) { - let parentPropertyToCompare = parentProperty - let unwrappedPropertyToCompare = unwrappedProperty - if (parentProperty.$ref) { - parentPropertyToCompare = this.dereference(parentProperty.$ref) - } - if (unwrappedProperty.$ref) { - unwrappedPropertyToCompare = this.dereference(unwrappedProperty.$ref) - } - if (parentPropertyToCompare === unwrappedPropertyToCompare) { - return true - } - return false - } - if (parentProperty.type === "array" && unwrappedProperty.type === "array") { + return (parentProperty === unwrappedProperty) + } else if (parentProperty.type === "array" && unwrappedProperty.type === "array") { return this.isEqual(parentProperty.items, unwrappedProperty.items) + } else { + return (parentProperty.type === unwrappedProperty.type) && (parentProperty.format === unwrappedProperty.format) } - return parentProperty.type === unwrappedProperty.type && parentProperty.format === unwrappedProperty.format } private checkCircularAllOf(schema: any, visited: any[] | undefined, referenceChain: string[]) { From 3a3a33eac60613531346953809ed579f15bbfa09 Mon Sep 17 00:00:00 2001 From: Mike Harder Date: Thu, 23 May 2024 09:06:50 +0000 Subject: [PATCH 06/10] Format document --- src/lib/util/resolveSwagger.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/util/resolveSwagger.ts b/src/lib/util/resolveSwagger.ts index 2f25641f..adac48f7 100644 --- a/src/lib/util/resolveSwagger.ts +++ b/src/lib/util/resolveSwagger.ts @@ -294,24 +294,24 @@ export class ResolveSwagger { throw new Error("Null unwrapped property.") } - // Note: per https://editor-next.swagger.io/ tooltip when hovering over '$ref', + // Note: per https://editor-next.swagger.io/ tooltip when hovering over '$ref', // other properties must be ignored when $ref is present: // // $ref: string - // Any time a subschema is expected, a schema may instead use an object containing a "$ref" property. - // The value of the $ref is a URI Reference. Resolved against the current URI base, - // it identifies the URI of a schema to use. + // Any time a subschema is expected, a schema may instead use an object containing a "$ref" property. + // The value of the $ref is a URI Reference. Resolved against the current URI base, + // it identifies the URI of a schema to use. // All other properties in a "$ref" object MUST be ignored. // parentProperty = parentProperty.$ref ? this.dereference(parentProperty.$ref) : parentProperty unwrappedProperty = unwrappedProperty.$ref ? this.dereference(unwrappedProperty.$ref) : unwrappedProperty if ((!parentProperty.type || parentProperty.type === "object") && (!unwrappedProperty.type || unwrappedProperty.type === "object")) { - return (parentProperty === unwrappedProperty) + return parentProperty === unwrappedProperty } else if (parentProperty.type === "array" && unwrappedProperty.type === "array") { return this.isEqual(parentProperty.items, unwrappedProperty.items) } else { - return (parentProperty.type === unwrappedProperty.type) && (parentProperty.format === unwrappedProperty.format) + return parentProperty.type === unwrappedProperty.type && parentProperty.format === unwrappedProperty.format } } From 1cb7f55f6e53baacb8a0a2108e140748e23e3e04 Mon Sep 17 00:00:00 2001 From: Mike Harder Date: Thu, 23 May 2024 18:51:18 +0000 Subject: [PATCH 07/10] Improve tests --- src/test/compatiblePropertiesTest.ts | 36 +------- src/test/incompatiblePropertiesTest.ts | 84 +++++++++++++++++-- src/test/specs/compatible-properties-ref.json | 35 -------- src/test/specs/compatible-properties.json | 31 +++++-- .../refstring-object.json | 34 ++++++++ .../refstring-refobject.json | 37 ++++++++ .../string-object.json} | 21 +++-- .../string-refobject.json | 34 ++++++++ 8 files changed, 222 insertions(+), 90 deletions(-) delete mode 100644 src/test/specs/compatible-properties-ref.json create mode 100644 src/test/specs/incompatible-properties/refstring-object.json create mode 100644 src/test/specs/incompatible-properties/refstring-refobject.json rename src/test/specs/{incompatible-properties.json => incompatible-properties/string-object.json} (52%) create mode 100644 src/test/specs/incompatible-properties/string-refobject.json diff --git a/src/test/compatiblePropertiesTest.ts b/src/test/compatiblePropertiesTest.ts index 11d803f9..256d9965 100644 --- a/src/test/compatiblePropertiesTest.ts +++ b/src/test/compatiblePropertiesTest.ts @@ -7,42 +7,14 @@ import { fileUrl } from "./fileUrl" // Given a property with given type and name // When another property with the same name and compatible type is referenced // Then no issue is reported, as this is a valid scenario -test("compatible-properties", async () => { - const diff = new OpenApiDiff({}) - const file = "src/test/specs/compatible-properties.json" - const resultStr = await diff.compare(file, file) - const result = JSON.parse(resultStr) - const filePath = fileUrl(path.resolve(file)) - const expected = [ - { - code: "NoVersionChange", - docUrl: "https://github.com/Azure/openapi-diff/tree/master/docs/rules/1001.md", - id: "1001", - message: "The versions have not changed.", - mode: "Update", - new: { - ref: `${filePath}#`, - path: "", - location: `${filePath}:1:1` - }, - old: { - ref: `${filePath}#`, - path: "", - location: `${filePath}:1:1` - }, - type: "Info" - } - ] - assert.deepStrictEqual(result, expected) -}) - -// Ensures that $ref are resolved when determining if types are compatible. +// +// Also ensures that $ref are resolved when determining if types are compatible. // For example, these should be compatible: // 1. "bar": { "type":"string" } // 2. "bar": { "$ref":"#/definitions/MyString" }, "MyString": { "type": "string" } -test("compatible-properties-ref", async () => { +test("compatible-properties", async () => { const diff = new OpenApiDiff({}) - const file = "src/test/specs/compatible-properties-ref.json" + const file = "src/test/specs/compatible-properties.json" const resultStr = await diff.compare(file, file) const result = JSON.parse(resultStr) const filePath = fileUrl(path.resolve(file)) diff --git a/src/test/incompatiblePropertiesTest.ts b/src/test/incompatiblePropertiesTest.ts index 2b2ec2ad..081c2308 100644 --- a/src/test/incompatiblePropertiesTest.ts +++ b/src/test/incompatiblePropertiesTest.ts @@ -7,9 +7,16 @@ import { fileUrl } from "./fileUrl" // Given a property with given type and name // When another property with the same name but an incompatible type is referenced // Then an issue is reported, with output providing the exact source file locations of both of the occurrences of the property. -test("incompatible-properties", async () => { +// +// Also ensures that $ref are resolved when determining if types are compatible. +// For example, these should be incompatible: +// 1. "bar": { "type":"string" } +// 2. "bar": { "$ref":"#/definitions/MyObject" }, "MyObject": { "type": "object" } +test.each( + ["string-object", "string-refobject", "refstring-object", "refstring-refobject"] +)("incompatible-properties-%s", async (prop) => { const diff = new OpenApiDiff({}) - const file = "src/test/specs/incompatible-properties.json" + const file = `src/test/specs/incompatible-properties/${prop}.json` const filePath = fileUrl(path.resolve(file)) try { @@ -19,11 +26,74 @@ test("incompatible-properties", async () => { const e = error as Error assert.equal( e.message, - "incompatible properties : bar\n" + - " definitions/FooBarString/properties/bar\n" + - ` at ${filePath}#L13:8\n` + - " definitions/FooBarObject/properties/bar\n" + - ` at ${filePath}#L26:8` + `incompatible properties : ${prop}\n` + + ` definitions/Foo/properties/${prop}\n` + + ` at ${filePath}#L12:8\n` + + ` definitions/Foo2/properties/${prop}\n` + + ` at ${filePath}#L25:8` ) } }) + +// test("incompatible-properties-string-refobject", async () => { +// const diff = new OpenApiDiff({}) +// const file = "src/test/specs/incompatible-properties/string-refobject.json" +// const filePath = fileUrl(path.resolve(file)) + +// try { +// await diff.compare(file, file) +// assert.fail("expected diff.compare() to throw") +// } catch (error) { +// const e = error as Error +// assert.equal( +// e.message, +// "incompatible properties : string-refobject\n" + +// " definitions/Foo/properties/string-refobject\n" + +// ` at ${filePath}#L12:8\n` + +// " definitions/Foo2/properties/string-refobject\n" + +// ` at ${filePath}#L25:8` +// ) +// } +// }) + +// test("incompatible-properties-refstring-object", async () => { +// const diff = new OpenApiDiff({}) +// const file = "src/test/specs/incompatible-properties/string-refobject.json" +// const filePath = fileUrl(path.resolve(file)) + +// try { +// await diff.compare(file, file) +// assert.fail("expected diff.compare() to throw") +// } catch (error) { +// const e = error as Error +// assert.equal( +// e.message, +// "incompatible properties : refstring-object\n" + +// " definitions/Foo/properties/refstring-object\n" + +// ` at ${filePath}#L12:8\n` + +// " definitions/Foo2/properties/refstring-object\n" + +// ` at ${filePath}#L25:8` +// ) +// } +// }) + +// test("incompatible-properties-refstring-refobject", async () => { +// const diff = new OpenApiDiff({}) +// const file = "src/test/specs/incompatible-properties/refstring-refobject.json" +// const filePath = fileUrl(path.resolve(file)) + +// try { +// await diff.compare(file, file) +// assert.fail("expected diff.compare() to throw") +// } catch (error) { +// const e = error as Error +// assert.equal( +// e.message, +// "incompatible properties : refstring-refobject\n" + +// " definitions/Foo/properties/refstring-refobject\n" + +// ` at ${filePath}#L12:8\n` + +// " definitions/Foo2/properties/refstring-refobject\n" + +// ` at ${filePath}#L25:8` +// ) +// } +// }) diff --git a/src/test/specs/compatible-properties-ref.json b/src/test/specs/compatible-properties-ref.json deleted file mode 100644 index 159ea9c4..00000000 --- a/src/test/specs/compatible-properties-ref.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "compatible-properties-ref", - "version": "1.0" - }, - "paths": { - }, - "definitions": { - "FooBarString": { - "type":"object", - "properties": { - "bar": { - "type":"string" - } - }, - "allOf": [ - { - "$ref": "#/definitions/FooBarStringRef" - } - ] - }, - "FooBarStringRef": { - "type":"object", - "properties": { - "bar": { - "$ref":"#/definitions/MyString" - } - } - }, - "MyString": { - "type": "string" - } - } -} diff --git a/src/test/specs/compatible-properties.json b/src/test/specs/compatible-properties.json index 7c96d415..d15f1d64 100644 --- a/src/test/specs/compatible-properties.json +++ b/src/test/specs/compatible-properties.json @@ -7,26 +7,47 @@ "paths": { }, "definitions": { - "FooBarString": { + "Foo": { "type":"object", "properties": { - "bar": { + "string-string": { "type":"string" + }, + "string-refstring": { + "type":"string" + }, + "refstring-string": { + "$ref": "#/definitions/MyString" + }, + "refstring-refstring": { + "$ref": "#/definitions/MyString" } }, "allOf": [ { - "$ref": "#/definitions/FooBarString2" + "$ref": "#/definitions/Foo2" } ] }, - "FooBarString2": { + "Foo2": { "type":"object", "properties": { - "bar": { + "string-string": { + "type":"string" + }, + "string-refstring": { + "$ref": "#/definitions/MyString" + }, + "refstring-string": { "type":"string" + }, + "refstring-refstring": { + "$ref": "#/definitions/MyString" } } + }, + "MyString": { + "type": "string" } } } diff --git a/src/test/specs/incompatible-properties/refstring-object.json b/src/test/specs/incompatible-properties/refstring-object.json new file mode 100644 index 00000000..e96820a4 --- /dev/null +++ b/src/test/specs/incompatible-properties/refstring-object.json @@ -0,0 +1,34 @@ +{ + "swagger": "2.0", + "info": { + "title": "incompatible-properties", + "version": "1.0" + }, + "paths": {}, + "definitions": { + "Foo": { + "type": "object", + "properties": { + "refstring-object": { + "$ref": "#/definitions/MyString" + } + }, + "allOf": [ + { + "$ref": "#/definitions/Foo2" + } + ] + }, + "Foo2": { + "type": "object", + "properties": { + "refstring-object": { + "type": "object" + } + } + }, + "MyString": { + "type": "string" + } + } +} diff --git a/src/test/specs/incompatible-properties/refstring-refobject.json b/src/test/specs/incompatible-properties/refstring-refobject.json new file mode 100644 index 00000000..44b7857b --- /dev/null +++ b/src/test/specs/incompatible-properties/refstring-refobject.json @@ -0,0 +1,37 @@ +{ + "swagger": "2.0", + "info": { + "title": "incompatible-properties", + "version": "1.0" + }, + "paths": {}, + "definitions": { + "Foo": { + "type": "object", + "properties": { + "refstring-refobject": { + "$ref": "#/definitions/MyString" + } + }, + "allOf": [ + { + "$ref": "#/definitions/Foo2" + } + ] + }, + "Foo2": { + "type": "object", + "properties": { + "refstring-refobject": { + "$ref": "#/definitions/MyObject" + } + } + }, + "MyObject": { + "type": "object" + }, + "MyString": { + "type": "string" + } + } +} diff --git a/src/test/specs/incompatible-properties.json b/src/test/specs/incompatible-properties/string-object.json similarity index 52% rename from src/test/specs/incompatible-properties.json rename to src/test/specs/incompatible-properties/string-object.json index 5da3a67d..58f29f76 100644 --- a/src/test/specs/incompatible-properties.json +++ b/src/test/specs/incompatible-properties/string-object.json @@ -4,27 +4,26 @@ "title": "incompatible-properties", "version": "1.0" }, - "paths": { - }, + "paths": {}, "definitions": { - "FooBarString": { - "type":"object", + "Foo": { + "type": "object", "properties": { - "bar": { - "type":"string" + "string-object": { + "type": "string" } }, "allOf": [ { - "$ref": "#/definitions/FooBarObject" + "$ref": "#/definitions/Foo2" } ] }, - "FooBarObject": { - "type":"object", + "Foo2": { + "type": "object", "properties": { - "bar": { - "type":"object" + "string-object": { + "type": "object" } } } diff --git a/src/test/specs/incompatible-properties/string-refobject.json b/src/test/specs/incompatible-properties/string-refobject.json new file mode 100644 index 00000000..0450b5c5 --- /dev/null +++ b/src/test/specs/incompatible-properties/string-refobject.json @@ -0,0 +1,34 @@ +{ + "swagger": "2.0", + "info": { + "title": "incompatible-properties", + "version": "1.0" + }, + "paths": {}, + "definitions": { + "Foo": { + "type": "object", + "properties": { + "string-refobject": { + "type": "string" + } + }, + "allOf": [ + { + "$ref": "#/definitions/Foo2" + } + ] + }, + "Foo2": { + "type": "object", + "properties": { + "string-refobject": { + "$ref": "#/definitions/MyObject" + } + } + }, + "MyObject": { + "type": "object" + } + } +} From 31167e76be314a99b8644dff083d9996f013e42f Mon Sep 17 00:00:00 2001 From: Mike Harder Date: Thu, 23 May 2024 18:52:35 +0000 Subject: [PATCH 08/10] Improve test titles --- src/test/specs/incompatible-properties/refstring-object.json | 2 +- src/test/specs/incompatible-properties/refstring-refobject.json | 2 +- src/test/specs/incompatible-properties/string-object.json | 2 +- src/test/specs/incompatible-properties/string-refobject.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/specs/incompatible-properties/refstring-object.json b/src/test/specs/incompatible-properties/refstring-object.json index e96820a4..63097afa 100644 --- a/src/test/specs/incompatible-properties/refstring-object.json +++ b/src/test/specs/incompatible-properties/refstring-object.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "title": "incompatible-properties", + "title": "incompatible-properties-refstring-object", "version": "1.0" }, "paths": {}, diff --git a/src/test/specs/incompatible-properties/refstring-refobject.json b/src/test/specs/incompatible-properties/refstring-refobject.json index 44b7857b..cbd070da 100644 --- a/src/test/specs/incompatible-properties/refstring-refobject.json +++ b/src/test/specs/incompatible-properties/refstring-refobject.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "title": "incompatible-properties", + "title": "incompatible-properties-refstring-refobject", "version": "1.0" }, "paths": {}, diff --git a/src/test/specs/incompatible-properties/string-object.json b/src/test/specs/incompatible-properties/string-object.json index 58f29f76..f210e3a4 100644 --- a/src/test/specs/incompatible-properties/string-object.json +++ b/src/test/specs/incompatible-properties/string-object.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "title": "incompatible-properties", + "title": "incompatible-properties-string-object", "version": "1.0" }, "paths": {}, diff --git a/src/test/specs/incompatible-properties/string-refobject.json b/src/test/specs/incompatible-properties/string-refobject.json index 0450b5c5..b9668a9a 100644 --- a/src/test/specs/incompatible-properties/string-refobject.json +++ b/src/test/specs/incompatible-properties/string-refobject.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "title": "incompatible-properties", + "title": "incompatible-properties-string-refobject", "version": "1.0" }, "paths": {}, From 72c0dbd1149bf55506736e7640be10d19abcc89c Mon Sep 17 00:00:00 2001 From: Mike Harder Date: Thu, 23 May 2024 18:54:11 +0000 Subject: [PATCH 09/10] tslint-fix --- src/test/incompatiblePropertiesTest.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/test/incompatiblePropertiesTest.ts b/src/test/incompatiblePropertiesTest.ts index 081c2308..7cf13e32 100644 --- a/src/test/incompatiblePropertiesTest.ts +++ b/src/test/incompatiblePropertiesTest.ts @@ -12,9 +12,7 @@ import { fileUrl } from "./fileUrl" // For example, these should be incompatible: // 1. "bar": { "type":"string" } // 2. "bar": { "$ref":"#/definitions/MyObject" }, "MyObject": { "type": "object" } -test.each( - ["string-object", "string-refobject", "refstring-object", "refstring-refobject"] -)("incompatible-properties-%s", async (prop) => { +test.each(["string-object", "string-refobject", "refstring-object", "refstring-refobject"])("incompatible-properties-%s", async prop => { const diff = new OpenApiDiff({}) const file = `src/test/specs/incompatible-properties/${prop}.json` const filePath = fileUrl(path.resolve(file)) From 26d0d2ef3a1478a2f4a2e837fbd19cb9492e0ea6 Mon Sep 17 00:00:00 2001 From: Mike Harder Date: Thu, 23 May 2024 18:58:03 +0000 Subject: [PATCH 10/10] Increment version to 0.10.9 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index afef424f..5c3428fe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@azure/oad", - "version": "0.10.5", + "version": "0.10.9", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@azure/oad", - "version": "0.10.5", + "version": "0.10.9", "license": "MIT", "dependencies": { "@ts-common/fs": "^0.2.0", diff --git a/package.json b/package.json index b5d055b5..75aaa196 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@azure/oad", - "version": "0.10.8", + "version": "0.10.9", "author": { "name": "Microsoft Corporation", "email": "azsdkteam@microsoft.com",