Skip to content

Commit 880bdc3

Browse files
committed
allow inherited properties to be structurally equal
1 parent 7409f93 commit 880bdc3

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/lib/util/resolveSwagger.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { toArray } from "@ts-common/iterator"
66
import { cloneDeep, Data, FilePosition, getFilePosition, getInfo, getPath, ObjectInfo } from "@ts-common/source-map"
77
import * as sourceMap from "source-map"
88
import * as sm from "@ts-common/string-map"
9+
import equal from "fast-deep-equal"
910
import { readFileSync, writeFileSync } from "fs"
1011
import * as path from "path"
1112
import { pathToJsonPointer } from "./utils"
@@ -247,12 +248,13 @@ export class ResolveSwagger {
247248
if (allOfSchema.properties) {
248249
sm.keys(allOfSchema.properties).forEach(key => {
249250
if (sm.keys(schemaList).some(k => k === key)) {
250-
if (!this.isEqual(allOfSchema.properties[key], schemaList[key])) {
251-
const allOfProp = allOfSchema.properties[key]
251+
const allOfProp = allOfSchema.properties[key]
252+
const schemaListProp = schemaList[key]
253+
254+
if (!this.isEqual(allOfProp, schemaListProp) && !equal(allOfProp, schemaListProp)) {
252255
const allOfPath = getPath(getInfo(allOfProp) as ObjectInfo)
253256
const allOfOriginalPosition = this.map.originalPositionFor(getFilePosition(allOfProp) as FilePosition)
254257

255-
const schemaListProp = schemaList[key]
256258
const schemaListPath = getPath(getInfo(schemaListProp) as ObjectInfo)
257259
const schemaListOriginalPosition = this.map.originalPositionFor(getFilePosition(schemaListProp) as FilePosition)
258260

0 commit comments

Comments
 (0)